From patchwork Tue Aug 6 01:03:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13754293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DB8AC3DA7F for ; Tue, 6 Aug 2024 01:03:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B968B6B007B; Mon, 5 Aug 2024 21:03:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B46646B0082; Mon, 5 Aug 2024 21:03:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0E836B0083; Mon, 5 Aug 2024 21:03:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8584D6B007B for ; Mon, 5 Aug 2024 21:03:35 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1005781C39 for ; Tue, 6 Aug 2024 01:03:35 +0000 (UTC) X-FDA: 82420022790.10.2418960 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf25.hostedemail.com (Postfix) with ESMTP id 5375BA001D for ; Tue, 6 Aug 2024 01:03:33 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=hczX3Hlc; spf=pass (imf25.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722906164; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=VlBLE24Vf8x82Lx7cHw6i6pfO3iWZul0LPn3B5Z/Ssg=; b=WrhZMlvzIZFvrNCXkBdu8x6Xh/HkcytGuhd8JemPm4DnKi4PdmE3LUQx4oI87pSE+wSnGp x+pelL3EZ3rK9X4/R6r6IKnD+PZn0DzejFd8uXz3ZLZuQOiDQvNMwnFZUXTX9980e4K43A m18zydWgwEpoKYyod8Jg/DSM+WX1/4M= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=hczX3Hlc; spf=pass (imf25.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722906164; a=rsa-sha256; cv=none; b=1yzmUNlQl9FfDnA0ADcGHWr3t1unkagumBkupRenudqiuHDn4Dq2um5ZBq9s3jGdEQacO1 yp2dmQQi4o3qd+uNR1S89xnGaA+M2lNSA3R5Z7nEJfTO244GbP2cblhat7Nfz+Ws7tjsMP JjgFqJjtex10JHlPJBpAM7dVe8kqSsg= Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a7a9cf7d3f3so20418166b.1 for ; Mon, 05 Aug 2024 18:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722906212; x=1723511012; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VlBLE24Vf8x82Lx7cHw6i6pfO3iWZul0LPn3B5Z/Ssg=; b=hczX3HlcsLz3rtrekfxWxY69Akp1uBZlD9pBgIUbTShB1HNXSpxld8tAs7qznSVYhT /tEyK1UrlTUk16Uei4XhT/LbVmpqJdCgxYC33nVfR9Ul38pjuLxJCscqQnvElNVMy7Sn qbX0qZaUMTUYsbaREBihPyjgt+WtGWiHRzp4olumQnwIXb+HOoxPnazYuRux3Fu3VLDE B1uLRUIJ0nslMT9yvi8hTRLslS1x5RPm7m8dG/+VcWr28UJdyaDk441KNSsYbfxj1j7b u73rM1YX/9wa0fqNOLR8B7F11z+c28TQxrjmEEYIScab88RU8vmswdGRN2orRrqz6uLf EkOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722906212; x=1723511012; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VlBLE24Vf8x82Lx7cHw6i6pfO3iWZul0LPn3B5Z/Ssg=; b=j7dWunrXpRNpxuUPv6Cz4RnmfLzzT7fvdqRitEkFleZ1ZxVGxQvdP7G/UKTR+IqcC9 P0eZNkz8lQQXIMT+cge4cXh7Dp4faG6HIHPkT4I7oBpj+AI5/nkQwCpGSyp4aOKRJAFk e7Fimz3v8u1dvj1elIo50AxOzdjilbcfrJtmEwHoXXqP7rlXkXWtuo8StMYx+WfivXB4 Nuvjwx6JBPE24vTnVyMdbKmfeXgIfiUWfx0DUt95C91T2BhIZHgKEE36lV1lqoQL/Rt5 LpprFmmnklkOeawClBTs9kgiVeJfv0RUkhiFPgxLa4AohIvkhkyfw6BMvw8gx7ttSobi N9Cg== X-Forwarded-Encrypted: i=1; AJvYcCUa5tqw9WsLq8ViK7LkbGCFNG5ZHp6RE5ZeGQKxhw4bDmTJOGVLz1dr4SBIrbzbkC4+weXrAlFct5pFtBL8ngsABSI= X-Gm-Message-State: AOJu0YyTLxV5VvRFsnOLCHCJZiTkuWubF9gsRoiTTZUvfrV8vdrV4AMi zCh13i8J+VnzzoHNSqexgaDodhC7fHCxM2mHFQvwQJa7QCuOXH97 X-Google-Smtp-Source: AGHT+IFEb0c3XKnS+5AeW4mcUBerkQ0nLN/+crG/fVNCjco/xxVrkDP0BEGB53GnKBdJSL6aqOXrEQ== X-Received: by 2002:a17:906:6a13:b0:a72:5f9a:159a with SMTP id a640c23a62f3a-a7dc4db4952mr889243766b.2.1722906211430; Mon, 05 Aug 2024 18:03:31 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9bc9d95sm506859566b.10.2024.08.05.18.03.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Aug 2024 18:03:30 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, richard.weiyang@gmail.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v4 1/5] memblock test: fix implicit declaration of function 'virt_to_phys' Date: Tue, 6 Aug 2024 01:03:15 +0000 Message-Id: <20240806010319.29194-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Stat-Signature: kypapqwttasmfn1wtuc66yin5wuzxpyd X-Rspam-User: X-Rspamd-Queue-Id: 5375BA001D X-Rspamd-Server: rspam02 X-HE-Tag: 1722906213-442364 X-HE-Meta: U2FsdGVkX1/3iLSwI/zeVbVPCrGj0Yrv95X3EdzrFhrL4ms6gTHB+bHn2arzpK+II0Y0kNYu4MhDNTt34JghdVaNyP9letnqh0Ccljm18M3+iUzvfxZwOSfHF9TUFPc3ZH6Df03oZtqJ2FRooIbx3EFx/QQCHMo7FLfeB3eh+jxIUG/HuF7ZwENw4bfNQOS+5y1fjK0eeo6/Hhf8a4lkJKH0wc7PUbBqD/FDu81/LVgQLi4M4kaGBsOjKDdLFbml2kK5KFZ/lIRbdK5nkyykTPjmgffig9BGvMT7VCvEgvIg0t0y7YL514Y63LXO3rG5aR/HOFfcDcW8lOUlEZ6hrqPDiHdmXol85WJfcnV/7+EohWy0qIa33XdWxy3e4VVDOz+QFXR0UJDOCwh9zO94XQ8sI8pAG0E3f06WQ+f0vsV8jqqTXFKYYXBfIGx8/s78Me5IpR0ON7NTmzNY0nV9oVuEI3eOsE3/d3zDtQ8/S6NY5eHGGvra3baHsTkcJpO6yUVumx2UA+oqsM3Apx4OxFyoeB5IOxH3bD5gU5sxiCDd0HxD9speX4oADWdnsolhQk4u0vGlIheQpu8inI2WwzquhoddAZHbe2zg46gArpx4xwUlufrRRZtYhwWQAWqtBkDr/TO2C5wA/E2ms8+MivtxdcrlcYj0JqAPFFg7yF0neDR+537YAc9/CJKBpirgNy4P4lgVmUuEAlWs0w+fIgTA6WGh2A/tbYjvmH5i9gKZD2sAvveV6VXqGb8AeMi581obGbayeZ6SAxr4sz59/bgqiEh93PnYSXF6b0Cjjjxd3B9PbchbMdci29yLBQXo9x+Car/Dx6FOiNwq72gHOym3tFtZbG0CmSidp8SJQo55x6jmVn3dTf2IU+fhKI1y5oxzoUGhxwdOughVle5QeC3AnZMM9gkZ2BOKnTuZwfjb5LanR1gT6Vja+8eAk1aHcNY40RiOej7zYYJVa35 zwXScPpb nDNMwkKOdYBtuMdywTBYkHRxA1wO1mT0YH0TpnwIIkYxM7h3JOHx9LP0tk/CmhgFnpmngMa2Z4GGMms7oXYJfjf6RLoaP0BqFGLmKiuIe/ar41dR1LTuFwRIqn4arUqftIJKPhIT1GDOZuHcKG/xC46EKBC8xqVJkhUzclqAl2q+4+3yVDSjkQab7tN4FdcOe95KT0Y9MNfrlgcj6ZPn1q5hJ2C110pu6oB4O8Mp6cHhJ8tRjH6qy74XZXfBzicYEqD7e462ZWhlGDJKYxf7MfhlRIihl4kBOvWUUQSz+qzLMeCw3sLQvfhw3rLhO/xqQ9lm5Dp/snPd8uqx1+Xk4FXyzsu1T/uHpUcmjX2n/3i35+TIKiX34SlYe+dlGwGZibuzr7Yszy4WE1/ocOBRddp1BQQ/CcLHXq+0VQuHEfJTvkom05Yz+brHPWO2nyBZ05WukbS7FkeHpF3M= X-Bogosity: Ham, tests=bogofilter, spamicity=0.008438, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Commit 94ff46de4a73 ("memblock: Move late alloc warning down to phys alloc") introduce the usage of virt_to_phys(), which is not defined in memblock tests. Define it in mm.h to fix the build error. Signed-off-by: Wei Yang --- v4: fix return type v3: use static inline as phys_to_virt v2: move definition to mm.h --- tools/include/linux/mm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h index cad4f2927983..677c37e4a18c 100644 --- a/tools/include/linux/mm.h +++ b/tools/include/linux/mm.h @@ -25,6 +25,12 @@ static inline void *phys_to_virt(unsigned long address) return __va(address); } +#define virt_to_phys virt_to_phys +static inline phys_addr_t virt_to_phys(volatile void *address) +{ + return (phys_addr_t)address; +} + void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid); static inline void totalram_pages_inc(void)