From patchwork Fri Aug 2 01:09:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13750994 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 B8630C3DA4A for ; Fri, 2 Aug 2024 01:09:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 261576B007B; Thu, 1 Aug 2024 21:09:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2122B6B0083; Thu, 1 Aug 2024 21:09:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D9276B0085; Thu, 1 Aug 2024 21:09:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E573D6B007B for ; Thu, 1 Aug 2024 21:09:37 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 778AA140C10 for ; Fri, 2 Aug 2024 01:09:37 +0000 (UTC) X-FDA: 82405522794.16.718E8E9 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf06.hostedemail.com (Postfix) with ESMTP id C175E180013 for ; Fri, 2 Aug 2024 01:09:35 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kt9QIF0L; spf=pass (imf06.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.45 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=1722560946; a=rsa-sha256; cv=none; b=Yv8PRKrOb2mUhX9lxvVOUC6r1UIcL2INrGunvWqYZxL4hUp5tWI1ddBJYrgClrRjtObHeD uFFKsD6evtdLH1P2mkuH71+7mleQRhzInSy8yMTv6L28fSbw4UCenOvY+vNalhH2D1l/8B HU5L97bXwmt1nbWTj4d9YgkULtCzxaA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kt9QIF0L; spf=pass (imf06.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.45 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=1722560946; 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=E3htfNHgZGtTKSRwOgeGEYeAav5n0bsRhJ35ivdzxLI=; b=T3PhrT8safjOeyN0q9ypJEc0FI0raftGFM6gFXSqXQjxC3Krk8GTH0WxmOsHlbKFaulP4W ZdllXdjCG2Y5WIqbx/PEOxcNeH4LxLo42wqKeMF6x0zVRYkMHbYdlJ27D7+TKSLkTU+pmj 3XiL56h4P9jL/nQCHwxZEK6BRLJ6ON8= Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a7a91cdcc78so449873866b.3 for ; Thu, 01 Aug 2024 18:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722560974; x=1723165774; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E3htfNHgZGtTKSRwOgeGEYeAav5n0bsRhJ35ivdzxLI=; b=kt9QIF0LW49olq/64v9TdokwjzqJz+muLza3dlzD35OiVy9eBt7t4VdWPRN7hEs8YY 3biu3ftdOLcr+dmUaNKntn9gBO5JlZEgWzvsrNjEWwZpfCivvzKjZhCwi9IGnQzGf2FP Pj5tCwf8X0NP1wh+PKQ98NSLVCDOLe53ilRKLqsJeVzan0LCR/oTQmEfIlb43G2Uaycd dN181vWNHUlK4ga9hyIYzNtXoV1vghszU2dawE5G3D4BBaJmgBSnAL8d3ZabdqWMQxQs zeKWqpdi42JK8VbukFRZzxn4uXytLdwCZGxqIxKqHI+Tewg96nZdOgEoElheZ3Y+j8iu WEdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722560974; x=1723165774; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E3htfNHgZGtTKSRwOgeGEYeAav5n0bsRhJ35ivdzxLI=; b=QQi/1YARAICBMOD9aItr0JSHyY6qB00fYy/ZMvclNf51xGsTafboBMkU/Jw2/OThr6 ekyfdxb1C4iub3QX+gB+zYIG/je3jieAsfNwYMKfgWnn8+yzJAGQ2FWdZoXF60usmIVQ 1WrP5ohNEKqdl13vsb4zdrRKaSxBzOQwHskp45gzZiSI13zXi1RdWX/+ccpSxga1PoMe BJgq9/JvW4i1+MC9TAGxZ2UVeckdcUS5iBqznaG2ou9al74ayCobGX+2Hmeql0zjevBs oJtMuf3OdQG/1LVlcURGchPaXkfbenA6KDTXWucj8KfArLFfQGEug0B/+fe/c8t/EAS+ U8CA== X-Forwarded-Encrypted: i=1; AJvYcCWIiTxqzAQ9h3Kt76NyS+3N10mkWKw+cKD8m/wj9A01ZmEVKThT/ppJZng1ENE/idJx8scvcrX9dCX7E4dHFipZy0E= X-Gm-Message-State: AOJu0YxG+cFcLzysqNLTRCjF4WjCTlMjZy0cFOEmmvWY9hSP0L2oRZYI DednWt0RqoOad+p9qOBdakA4oe17YjWEtTPkKi10PGy2usUaB2Sd X-Google-Smtp-Source: AGHT+IGk96XkxqZGR+9KE5YgVgC2rAoZZFUtfBkFOOk5wXY+CwMv7bMbEr3HKxnVi8q3W4MAS0niTg== X-Received: by 2002:a05:6402:114e:b0:5a1:5692:b5f9 with SMTP id 4fb4d7f45d1cf-5b7f56fd3dbmr1500125a12.38.1722560973847; Thu, 01 Aug 2024 18:09:33 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b839b26d13sm406598a12.21.2024.08.01.18.09.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Aug 2024 18:09:33 -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 v3 1/5] memblock test: fix implicit declaration of function 'virt_to_phys' Date: Fri, 2 Aug 2024 01:09:19 +0000 Message-Id: <20240802010923.15577-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Stat-Signature: 3w7aejnujhwkifc4dxcrex6kuibmbdzu X-Rspamd-Queue-Id: C175E180013 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722560975-662369 X-HE-Meta: U2FsdGVkX19isgY8wMQgtM9Em0mBcOB8H+Z2h9U4Jvy1JgI1cqsMHIMV+PZwc2lGAUs0liSMNKG0fABfY9PfYaXiltuFqpMl5IzLXGR9uCSJMUDMJG0W8E4Q8apx+8NwUQyAIuOxbg8dn//x1S1sx21vQaej54L9sz/sjoduPA+16lSTPiUKS/TfoKkH830/8Mhb25YtAwzcxZvRTp8/dw5sbk1LxL/Xfc44G8eE5nL6Nhfi5vMtCqKurq29enFna30ivXT3/SC8DX/GWxidwpvo2+2r2Bp4oC7S4DO0RmJBVLVXYx1MCBGsEdgI31SrjIMLeWvWGp77hyZH4mOiLE1dwdEDX1+F5Y6rS+aEeMYjGJWP5w6FpTYI6WrnyDIgNkKZ1Dl7j1ATfJmqPjluRBCsL1GJOKk7Z7OmQafyPZINOBYyw9QGjGJbl4Q3sEyil1xkjWbW9ddfLxpwzHd4PXin+mJ6u4m386hao9+b571FfifkP1qVA+m3rD1PyYj1yHFKmc1XcLf7M5KXfIHLzPky5mpKrV/jlYjeonz2kSyQybKH0tqkZB+UOJ3tjSw/Er88t+PcOwFKVDiFZt88ZPHN+fWRQGXaEVHqceGEFd2M/75HbEv9lle3YidaXdkQTyDnMLtlSzJ94NNbN3/6FzpgaiUECj+QHA2W04UOF/eQGcYujm15VicDy12YB4ilkGdUygLAph5vh9q4IiTf6zjLBH5eQrESxb/5/BzPOkCxfFUzYDrRUOinGrKud2RaEmz1xYx7RlcTPc1mpI3Jw5qPFv+morD5QoOEg08b4eSe2LewYKtyID0fdJhcuLEyjrDR5M7nUixS9V/+yBQqzwmcd2QHK3Di8Y4rNtR/2DZ0aqtMQPVQd5v60eUGJ8aWr34YBBoQSEwkbXZhDsKBiQsyvDQCqIgw6QJOkmWpj0GAJYxQQbOMxQZ7BImMss86kdPF5RNqxIabuAUsdJV hW5R6Px8 2DPjPFtsoje2YTnnuACFbw7wkJolF1yNLSTxSxszkI16CoJIrXouuZ2DKdn6ztzloG5y2laMFko4/GNkGQk9RglGuZGEZ4P2WNLr9d2tD5+iWQHAK/FJ4MQ0SYFP7qe7MflsqWXOlmEAac5gF4R5Ac/cpLC+b9AJom5qWKzC5OtLwQsFq41PZ4FgnpaPQ4bMc2piu75jqzF54FZd4KVL8FWWT1+vTU+iYCvFPxEkt+iQSexT4o6b15HUcmRxiEvMgHDjX45e0Z3Y3gIinYUNE64jje1R/XfAPlJPByV70mldTevDvwMEWjkTlxT2fCgtlCnAahtnCEckl2/Divmkum4LeRslGhh4/zS4km3jblAAVq80qvb7jHlWAhfNOjSif5Y2dOCu9oVMMQBJtvDtNwlbuhZYqadgPIJEK1aNiLRlLA1KbAThcGci0Vz063xOT5Slh3mVmRTr3Tf4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 --- 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..c9e915914add 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 (unsigned long)address; +} + void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid); static inline void totalram_pages_inc(void) From patchwork Fri Aug 2 01:09:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13750995 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 0BE70C3DA64 for ; Fri, 2 Aug 2024 01:09:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45D996B0083; Thu, 1 Aug 2024 21:09:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40DC56B0085; Thu, 1 Aug 2024 21:09:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D6CC6B0088; Thu, 1 Aug 2024 21:09:39 -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 0F2C46B0083 for ; Thu, 1 Aug 2024 21:09:39 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 722D316102C for ; Fri, 2 Aug 2024 01:09:38 +0000 (UTC) X-FDA: 82405522836.01.33814DF Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf23.hostedemail.com (Postfix) with ESMTP id B007214000C for ; Fri, 2 Aug 2024 01:09:36 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="JpRo3Ti/"; spf=pass (imf23.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.50 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=1722560948; 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:in-reply-to: references:references:dkim-signature; bh=BbCh2qq+GqJnDj1NLZnr9Rls+DkMZwrRCOx9dR1Do1E=; b=IWk+dJyGu+nmiKYaTMAVl27pt4RiG7w7931YhRX4+BtdYhA+WLJ7q9ORLBtlyyrMSG5mqp M05gnUsN728lnjlrpWFHIaCOV5l/UqDZAR8GaXeBPJEMAJwkGJMYx8xXzfanVN3kbcjQvR 5wFOX/7GiNCHA6rnsh/5Stg9cZ9EIvo= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="JpRo3Ti/"; spf=pass (imf23.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.50 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=1722560948; a=rsa-sha256; cv=none; b=H42JSTdCTHz0FRbixcdg7sByWeceWCq2S+qEjkZE1NeJn0H7EuBNqCOMj1hBn+7i54MhtS erNFeJOYaAyCsISe8mNk1AqgmFTTx5l0fk7YQp0JtKFBFFxdQ2Suunqz0DMrGx54gPBMW2 w/FWaE7LYJrukF9y7MX9BvFWqP6YSkk= Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5af51684d52so8676116a12.1 for ; Thu, 01 Aug 2024 18:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722560975; x=1723165775; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=BbCh2qq+GqJnDj1NLZnr9Rls+DkMZwrRCOx9dR1Do1E=; b=JpRo3Ti/EVxLIT1vcUpz8BZk0Micva/fj59FGKLJde/SjCwQhEpr9eqxeGKkrPAi44 JswRyYvZPjcrI3r09Lq59g41NTRDh/9xB3MECjqElFmGJ0eZ/donFphJ900VzPZLNj1r k4ei9Lx1QRl27XCC8x143tgbxFvyHqk2NvdNGB0iAtSfArRzpwmVsmiWI+NuhfNVyE98 QmoOGcVl+iRFcawcB7I2IjljpX4cC7WauT+Z6p4k2+uISfYIlMF+mBARJzy2xi+KDhH2 N+0VQmD5IPsm39eAXBvw3xDwKhQrpQB1aKhStPxud2c6A46d//WO8DAQa5qxhFIW9jdv HvSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722560975; x=1723165775; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BbCh2qq+GqJnDj1NLZnr9Rls+DkMZwrRCOx9dR1Do1E=; b=T9EJkOz8DVcmdA2z0PEm0NlBCqiPpNNZzqiEGuKULC9VXIB/fMvWegjtnD0eViyRF/ fdlfBPNh85IKYdhuGwNbMpdlQ4QSSDTj/RWuU3k8FHcbfKHB0fj1fdwPI/RVscYRh4W8 AaxFXCjythGpaIpHiOQ/k7m9n8Vmvlc8vHhHg6VU8fUz5+vu8t0hiJWD3vwJSQ+qk21E ah7CeeJVy3usaMZVdlBI/+jQcC6lno9e7gnBu9GCQZ9YF9Wf0P3YuxOCcozee4n3Rvo3 qAQBojJL+N/X6RELeKX1aEDdWXuI/vVg+/DbhSh0442bT6a4G2ctV9s9stk+lkrMoe2H CyXw== X-Forwarded-Encrypted: i=1; AJvYcCWJhpnZOvuJ+aHJVMYP6lVD4yB4xGoueSctBPZOnH8LfuSVqB6yCGO77q1jsFCiNxynviCGYDuc3v+nGB+ss4RW9xA= X-Gm-Message-State: AOJu0YzHqbCCNRdCxdjZ8NbnG06Ir/zI8idd9Stgs5XryQrB+Rl0iRUf TZCEeQyGmU7vBcHe65Y5ej6sJtgx7Fdm4580kWAXTuPMWmkG5oB5 X-Google-Smtp-Source: AGHT+IEWJ/rEpduxi5nKxB1TDcKkBxA4cQbX6nPfFw0nWnayCRn9XuSyJ4S4tCylzwzeT02VOCPEvg== X-Received: by 2002:a17:907:3e1c:b0:a7d:26ff:aeb0 with SMTP id a640c23a62f3a-a7dc4fa89dfmr115937866b.30.1722560974799; Thu, 01 Aug 2024 18:09:34 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9c0c185sm37411466b.61.2024.08.01.18.09.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Aug 2024 18:09:34 -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 v3 2/5] memblock test: add the definition of __setup() Date: Fri, 2 Aug 2024 01:09:20 +0000 Message-Id: <20240802010923.15577-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240802010923.15577-1-richard.weiyang@gmail.com> References: <20240802010923.15577-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: B007214000C X-Stat-Signature: 8urpa3pqfosh6rc7tfka6mgzgka8n1hm X-HE-Tag: 1722560976-174555 X-HE-Meta: U2FsdGVkX1+w5nEEc8anHFkcMG/VghPynX+JfPgSZW9QIsjkqjHJtWqX9MBE3BWtw8+44X1hR2u+Z1vu7j6mGM1OH1N7Ka8wxrFIqzLHD4oAKzcyktBFQoJAWQU8TVHIZaZbSD4i7JpIMCgV4Z3USBbByVO52rYwumJMOlbS6I0ethfikmqTl5jKZtxC71BRBStx6PspV+IMUiC40BVjID9oRFfk1xKTkb/9Mxsp5D/AmPEyWv5lYo0NbeVh7iCVohTeKFaHohN+U2BY34gQHP+y1ARAp+uISieatFUJ2wvTVlf6PE4n8CMAeEQTouCtO1ngT77K1XqvXRwwglY3Vpo335ZzaJlf0HVWQMzaL38ynM+RVgurp49bQVKaR2WV94gjqJbNI7kHHd8oLYzQZM0EscYMuGB8fqSxfhnhoTwG7+4ne7jlj9tIBhR6Pi6FRdjNedC/z5owqlsbhVkNphOIWx3FKNXaniEVk6PX4QYm5gZ49v1mH6YlQ4YkTnmggI7v85DIhR8EAdceQVPTo+LtKrbs8G2AlI3TDQyIkkgBHsfW7SCIFLISXkc9hej22G44RXXeohmzTJF8+n2b8SrYuLGZ1fubWmpMGgsC221qEpRKloWKEFo9mGyy34M9VIICwyJXuqTc+nHBkZZeT8y3/yq3bNNpO+DR5UURNxosH5o8XsLctc7l/ublJm+eyBEW8Pqt2n/o+ACmdmCZfpKy+hDuoo6e6Sq+B2r3mLjJUjTTgRswUEQCQPSZT3c5/cKHOhlg0j2nEMwDCSM1J2VC5Yla2vKqjJggvHWDfCkxfz0chbnvL2aVb0v9HoYxCMS8Dgl3J+Q6p/ULzbYgm6zu5K6LfRpUatNYRfnTfuvtOCZ2woRgChRJcoIfZfPoA/hbknOkuEaqV+EbdoFUO4EFKO54l5vBE0r/bwph+iuG5fBqM98N2xyKrK+ihHuWIAVkn3itku2N4tb0r/c j1Z657rZ eueg/FCd8jj3SqpyZ0z2hkm8IPVANEB5fWmIId9yWnnwRFKDwvl0G7ql0xQ6gHrul7VsiM8ED4nFKNJJ3PzTwExH8r6QmQ42J4fU2uux2Aidl9u2GQQi746ezJMOfWiUaepapgb6Dv++djSY4aL+X8+Tvvqi9RbE3WaY4IF08CoB0Z8N3OCBc7KqMJ1ZCT2uCaIE+aKeaz70DR5SVAcGJT6SKifM+SVOayBgdIEhpY6JrrMhNd4p4KeddI9HvbmRJ/F/1M5nOP7s6iL7o8DwMgWVcro7QlxIPGF+UuRHGiE4CkTpuJrSLaUGoEjBDOH7TMUza3657xs9avDALH9K8plefA9WRqApcjOXsFgbY+GENbsmTLmFqem7+//Rcsd1e9W+qiVAxvgQqNjc/KPq4lxto85rt10Pmqa/43Dp0jlxaPty1WbxtbG/Sy2kEzOfXtIG/UjlFYo4VZR8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.008513, 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 1e4c64b71c9b ("mm/memblock: Add "reserve_mem" to reserved named memory at boot up") introduce usage of __setup(), which is not defined in memblock test. Define it in init.h to fix the build error. Signed-off-by: Wei Yang --- tools/testing/memblock/linux/init.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/memblock/linux/init.h b/tools/testing/memblock/linux/init.h index 828e0ee0bc6c..036616a25427 100644 --- a/tools/testing/memblock/linux/init.h +++ b/tools/testing/memblock/linux/init.h @@ -28,6 +28,9 @@ struct obs_kernel_param { __aligned(__alignof__(struct obs_kernel_param)) = \ { __setup_str_##unique_id, fn, early } +#define __setup(str, fn) \ + __setup_param(str, fn, fn, 0) + #define early_param(str, fn) \ __setup_param(str, fn, fn, 1) From patchwork Fri Aug 2 01:09:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13750996 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 55DDEC3DA4A for ; Fri, 2 Aug 2024 01:09:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 129C36B0085; Thu, 1 Aug 2024 21:09:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DA916B0088; Thu, 1 Aug 2024 21:09:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E20756B0089; Thu, 1 Aug 2024 21:09:39 -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 C77396B0085 for ; Thu, 1 Aug 2024 21:09:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7D02C80FA7 for ; Fri, 2 Aug 2024 01:09:39 +0000 (UTC) X-FDA: 82405522878.12.7CC5CDB Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by imf06.hostedemail.com (Postfix) with ESMTP id 9A9A9180013 for ; Fri, 2 Aug 2024 01:09:37 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=QkCBn39b; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.42 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722560972; a=rsa-sha256; cv=none; b=l3VxuwnbJq6uTWp65lg/krC4HKzTyWU4y8564Fex6Rz7u2IAWdTjaKOixqYRGuFI22NXx/ gNxncoVJUSA4/ykjUfoqjMGSGE6A6fiUyryKRPLvA24WG4lBhexo2zGxgqvTGUI0rMb7Jw IiPTuXDvfBkDuI+TNL/LP7E+NZfXRXM= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=QkCBn39b; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.42 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722560972; 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:in-reply-to: references:references:dkim-signature; bh=qyYOlz2K4LoDSHsLe8705YksXRaxa+aqBd+KCuRDSeI=; b=roDaHJm6FCygFGdtEmNsfq1EpxuVj9DU6cQeeJf9fndWLFLasrzu+vvMONv+p7LrBMiRZV t5jzqJs7FoOBA0t9iIHTcS6Qy7M2SQevoZLOK9c7sS7+THdLrflZvj6Qg9sXouv45yP6Si y1chSRl90d06MyWxl+ZI07DsM0t1THs= Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a7d89bb07e7so493354566b.3 for ; Thu, 01 Aug 2024 18:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722560976; x=1723165776; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=qyYOlz2K4LoDSHsLe8705YksXRaxa+aqBd+KCuRDSeI=; b=QkCBn39beKFVaY36Om8VubrCnm5fCE/ln2QvCDvp1T/PmYjYrmZ9CO+eplfet6PvSj C1URD+dDStLF8OeVPirF0mG4H9sJdA8/Vx+vPKgAJ56A0EetHNMFppujLx9fv/bXYZPX oQR+g4vt3nMyiiw6wKeTa8uFlHUnGTA5DG337xuWcP8o9PoibitApEz5HtkHumJmtOJB Dqa+p1fHVqpnxs2IpYELKopC1/HJzYtNqwxAD3iLyCMaZdTA/quIin3RvX6BpwyHFInB zkweIvC7W3SEIBbqLpk9T5OXQyFIpQjAmCKzI+v2Viq6im1UGSZMH34/XcLQgELPuM5O lQDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722560976; x=1723165776; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qyYOlz2K4LoDSHsLe8705YksXRaxa+aqBd+KCuRDSeI=; b=Y7Hb1j9acFJBPdfGBMkxAI3wuLmMAFYilBmAH5ypAlyHTVZmwCqwp4huH8nM6417u8 KN1r6q2+Noyfb3OEPh9oC699zeHO+m7eDnkbdMZkfXY2zhhlB9prKmkqxO+lyigm/dGM alV2k5APwaPQwK5mMLLAZ81idO6j1qgzd0sOi0EtS9BA/kTfzDsC64l+EoDKxVsrjDUb 6v9ykqMA7xQiv7C+6dWgY9BI816tewyCaghMnCBTCkWRjh3+BAzljSO5MAP7EAIfcQpW eKiWlqglg29gUIYVv+EI4mEbVKQgJjI4bKY0NkdDlOAw1hIY6b3N7P9NRqythmJD2368 kUcg== X-Forwarded-Encrypted: i=1; AJvYcCVjKWDl1VBWKtGOxzJPLZKKWgJqwliIwpOknUMS4jY/cvqjs9j1ZPeFP49TDQQqtxI4H6F/cCV+8pJBcZvQP2DCNns= X-Gm-Message-State: AOJu0YydaJEXr93fQl3P6J3x0v9xaWGwZ5SCd5IZVzf6Su3k5KjJXgQC Yl+oTwvOJ1a0gU+/obtB6e9kwa18AtzyNNUi4UzcIJhag89/0GMKeUQIvA== X-Google-Smtp-Source: AGHT+IGfRdSWtp+1onxx+iLVymNrzaKRpWBWPTb0pHFWlRNECurwh/KBXdrhvYQIruR2C0q5uxG1Jw== X-Received: by 2002:a17:906:d542:b0:a7a:8e98:890d with SMTP id a640c23a62f3a-a7dc4e2808emr112728166b.16.1722560975756; Thu, 01 Aug 2024 18:09:35 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d42615sm37107766b.99.2024.08.01.18.09.35 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Aug 2024 18:09:35 -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 v3 3/5] memblock test: fix implicit declaration of function 'memparse' Date: Fri, 2 Aug 2024 01:09:21 +0000 Message-Id: <20240802010923.15577-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240802010923.15577-1-richard.weiyang@gmail.com> References: <20240802010923.15577-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Queue-Id: 9A9A9180013 X-Rspamd-Server: rspam01 X-Stat-Signature: oadmnsk83nihq6iwjdqsxjp4fdxfuoar X-HE-Tag: 1722560977-724925 X-HE-Meta: U2FsdGVkX1+2mJNazBtS/tRSV1oxfOWUDyncoeLIAdTD86BmoBFqrDhAMBkEC+e8cmD2Nsnzyy/YhcPfFA4/HJEE2JDPpqlxjvDsoznw64cg3RUHHzLSaiYAhK7GMNmw/UB/WIxIku+tQYWAP9dvuMfTp4C4F+4dkz7zY/cbcgNRZbBzQDgPFgfUur/eRHMfqrnlWm4B9tybjbHwoaQ7bTqKCNRT8Lm2OvTgtaOW3q3fBzERJyx9qDavo/UDpjGouUJ0PEJavTreWzPl3comfic5tuil5gDNF+bION2cuz059UG9UjcuJb3X8sH/xwSZjB5WWYM/LFak1FMsV9ATL8kM36zwEvIGuA3mhS7uSC5Sqp+YkIOyBH0lcFMaBR4/p7Ra6hj9upvlwEgk03exsbC+7dsPySIHT5e2cyToXmZ9SAtl8uYS5vjIgWZiLERX1YdtH843bKCyeFFyHEsqKT9ihR5EMhdEPX3ljNC/4+flOdlyJt9tR2xupXvrgaKssfFmlIwnkRmRpWY9xF7vkthDvaXnhOV+CmeR9B/lVaEwoKjW8sMOoB4N4As4U35SYoPh1YCF0wkoJwwvhDK1EPiNGku5VjVBbqh34iLOnYe6AdDetu9Q0CfwNUbMIrEeZXJ06vmG+VYIqWSyQqV9oDwyau2xYPspPvuf2+0IITsF4SiY2+eatuQy6Nkf5ffiPFdybxFUXDajBPqBE5K4xkuBZKtUUGB+L6HXPAhSLwVsEXia1Hm6fqUphJ1y4hv0DEpumeY+W707Yf3HeiaBK11K4bwrr8P0Yu3UJ6JSYsJKmFt2JtlJ9qtuwJM/776yfUaGpZRsDKRaV+Xfs+Prj/gAcFDGei9+TE40E7eFy6HR5desHO3+wL4ZvwZS9ydKa2kqiSlVcE9RzptDOQAN4WsbeiNx5q9Tpw3pwgDAr2VdNbISYStTny3CgsiBUOeC831av7Z+OW7Aj4emyOc yKOsQJMM HgVpLUkev0l5aW4Q9NBHraLmdpRBibOtDI248PeITJ786jjR+vBc0BNkkxWDgDqMXHrzI5M3lEFPsRtT6+KLjL91YyHJDmtixb7cBCjsNLAitd75+huCsJqxh4gLmDbSK6hejN6YmciW4aR3i32UB6JMVLzIcJKW3hM78sPjO1Wiuk0f8iK7lNN7pKCutGiU9JRYju6MTmiNkGY3evVOAG8g2xJag9GiaYh7w+l2Xxre1b5AEFmk7ZSe/wBvh6UajL9Poyks99OefxmhC97nUDUIuuJQ6is3MPOvu+mnQnL1p/rSZ9e/ZWoVr3uNY3EJVwtkuV8rIGlNiN8if2CP49ZpTI7YmYoa1MthRTUbrLkeFTWIBtdtUjljfOPNn21hCOF0+wVcRoUayxQ9tPC4r7wRjFI/OQHZMBtzR X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 1e4c64b71c9b ("mm/memblock: Add "reserve_mem" to reserved named memory at boot up") introduce the usage of memparse(), which is not defined in memblock test. Add the definition and link it to fix the build. Signed-off-by: Wei Yang --- tools/include/linux/string.h | 1 + tools/lib/cmdline.c | 53 +++++++++++++++++++++++++++ tools/testing/memblock/Makefile | 2 +- tools/testing/memblock/linux/kernel.h | 1 + 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 tools/lib/cmdline.c diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h index db5c99318c79..fb8eda3019b5 100644 --- a/tools/include/linux/string.h +++ b/tools/include/linux/string.h @@ -47,4 +47,5 @@ extern char * __must_check skip_spaces(const char *); extern char *strim(char *); extern void *memchr_inv(const void *start, int c, size_t bytes); +extern unsigned long long memparse(const char *ptr, char **retptr); #endif /* _TOOLS_LINUX_STRING_H_ */ diff --git a/tools/lib/cmdline.c b/tools/lib/cmdline.c new file mode 100644 index 000000000000..c85f00f43c5e --- /dev/null +++ b/tools/lib/cmdline.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * From lib/cmdline.c + */ +#include + +#if __has_attribute(__fallthrough__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0) /* fallthrough */ +#endif + +unsigned long long memparse(const char *ptr, char **retptr) +{ + char *endptr; /* local pointer to end of parsed string */ + + unsigned long long ret = strtoll(ptr, &endptr, 0); + + switch (*endptr) { + case 'E': + case 'e': + ret <<= 10; + fallthrough; + case 'P': + case 'p': + ret <<= 10; + fallthrough; + case 'T': + case 't': + ret <<= 10; + fallthrough; + case 'G': + case 'g': + ret <<= 10; + fallthrough; + case 'M': + case 'm': + ret <<= 10; + fallthrough; + case 'K': + case 'k': + ret <<= 10; + endptr++; + fallthrough; + default: + break; + } + + if (retptr) + *retptr = endptr; + + return ret; +} diff --git a/tools/testing/memblock/Makefile b/tools/testing/memblock/Makefile index 7a1ca694a982..d80982ccdc20 100644 --- a/tools/testing/memblock/Makefile +++ b/tools/testing/memblock/Makefile @@ -8,7 +8,7 @@ LDFLAGS += -fsanitize=address -fsanitize=undefined TARGETS = main TEST_OFILES = tests/alloc_nid_api.o tests/alloc_helpers_api.o tests/alloc_api.o \ tests/basic_api.o tests/common.o tests/alloc_exact_nid_api.o -DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o +DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o cmdline.o OFILES = main.o $(DEP_OFILES) $(TEST_OFILES) EXTR_SRC = ../../../mm/memblock.c diff --git a/tools/testing/memblock/linux/kernel.h b/tools/testing/memblock/linux/kernel.h index d2f148bd8902..c16d9cd2d1ae 100644 --- a/tools/testing/memblock/linux/kernel.h +++ b/tools/testing/memblock/linux/kernel.h @@ -8,5 +8,6 @@ #include #include #include +#include #endif From patchwork Fri Aug 2 01:09:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13750997 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 EBC14C52D54 for ; Fri, 2 Aug 2024 01:09:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E5536B0089; Thu, 1 Aug 2024 21:09:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5959A6B008C; Thu, 1 Aug 2024 21:09:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40DD46B008A; Thu, 1 Aug 2024 21:09:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 288D16B0088 for ; Thu, 1 Aug 2024 21:09:41 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B7B2D1C2165 for ; Fri, 2 Aug 2024 01:09:40 +0000 (UTC) X-FDA: 82405522920.05.E48F8A9 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by imf12.hostedemail.com (Postfix) with ESMTP id EEF494000A for ; Fri, 2 Aug 2024 01:09:38 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MJZ25faq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf12.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.49 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722560932; a=rsa-sha256; cv=none; b=buyw2MkXHrCU5//Nv3CX/yWuXYddmQ/dnI2+lPMZCkPUZwHn3fdQCwpvpbIFtDm/UaZtWz nM6TuLE5BJP+ZcRTzTRBODJpIvzckOoJczRldiiFwKhxmp/xQu7//fvXMsr7s1KvsZna+4 IqtdKU6Np3ketPI3pQlZlpbKsbwviJ4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MJZ25faq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf12.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.49 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722560932; 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:in-reply-to: references:references:dkim-signature; bh=3+JPYPQt1yTaGk3WXPjbRRDMHWDKLDoRYgnwrc901qQ=; b=eijy/gSw96Dz/HvQZcyi0kohyhl+C1uImbXh3+VHrGSUOqjPKbIOpxRbiC6xrxlKyKi9/8 VjF0AjxoPjy6L/C5b4AkAjx5WwkfUcodaWyiIWpJHKnb2hrphH4x1l3shB88mSHsRPqa1o edbY7EeBLMpYuxJHRB+0mqrW82KBxBw= Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5a10835480bso10900038a12.2 for ; Thu, 01 Aug 2024 18:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722560977; x=1723165777; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=3+JPYPQt1yTaGk3WXPjbRRDMHWDKLDoRYgnwrc901qQ=; b=MJZ25faqJJj08XvlvUhVIzLdrJzaCNx3iNy/HuxJxaBb3RgJPs0V5/o1ljViIcgQsR UJfrlovsBtPRQs4AIe3TFOXmpNVFS4nCzhlThvbEtcSUsUmOjwK80DxYBgesWpV38Wtj q4ejqkWmOwPhhbb/3g3M4SNnbkHvy9dJaBNMsDphEG1xV0+SnOvl0oFG+SnjTszCz82a TfHw5qwf3/3rNypZeoLbopITJGTotyP3dLJTz3Ds4sk6fpDHTy775CThGUu347vTds/K fntZfertvmWNzJel4vNXNt0JQZAS71NcS2qPAjeXEGOCG87C7iuluEz8BE9gjFRlKJ1u LFLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722560977; x=1723165777; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3+JPYPQt1yTaGk3WXPjbRRDMHWDKLDoRYgnwrc901qQ=; b=V0F1luI1bumOW9JBJG+ARmkDaYUMs27FakufUqpGuz5sNw6lV3hQP9Vnzn4OGSWtn5 OF47uTbNYGnw4zBczBEg4l05OMppbmkeuh5CzrUX7iZ3iAhb8mzInkiBqm0LW6FnC/Vr P+3LDM2Def4iFuu3TKxlYnQpPtgRKp8q+/reyKaRNIHq/03Bodfs6Isf4f2IZ5h/13ew pxsiUkoZa6HfnA4gV/2HIDhG1O87yEpwGhDYNNa4kF4ufk0LeHdqk+QVkmG8qyPl9orN kX5A46XFz+YckK42QwbnMaF7uz7fBn5C3hbbfq+9go3QXe5Xq4poLrBSEsAn3lmKsrBU 3BwQ== X-Forwarded-Encrypted: i=1; AJvYcCUxXrkBHbWIrkPg1cyf9OG2nLXWpLL6TNVCf0eyIJjQCfwWhAZlTBYJtbxBN9+cZ5CmK4BJDCM5/UiEOAsmXcMB8yk= X-Gm-Message-State: AOJu0YzItO+f45tuXTev+j3aibQpHqSbySBEyRkUwv6keue9j9akgBoC 3caj3Lg5G2AOvdPN+9Uc8mnFfksphV3bmlbH0rtK6WZ68dJYnOsh X-Google-Smtp-Source: AGHT+IHH9gnl3KVlZJuaWCLeBUtTiHBLMppMhdSgZyiqE3c4pDFS+dgOTRi8caOWBu6UptY9DHlNxQ== X-Received: by 2002:aa7:d604:0:b0:5a3:76e3:1dc with SMTP id 4fb4d7f45d1cf-5b7f39e043bmr1346910a12.10.1722560977346; Thu, 01 Aug 2024 18:09:37 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b839c2a61csm406639a12.36.2024.08.01.18.09.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Aug 2024 18:09:36 -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 v3 4/5] memblock test: fix implicit declaration of function 'isspace' Date: Fri, 2 Aug 2024 01:09:22 +0000 Message-Id: <20240802010923.15577-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240802010923.15577-1-richard.weiyang@gmail.com> References: <20240802010923.15577-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EEF494000A X-Stat-Signature: aifq8458bm8hxesj7yyd1ryhi4osdgjj X-Rspam-User: X-HE-Tag: 1722560978-626336 X-HE-Meta: U2FsdGVkX18SoiwZ8DipXRDJLrjZxPDdnaMn/ievY377606oL3JX4jB6rDpixpekwZ0w30KC7+JcJdJtxXjmOIruvZFlyk40jZigu2uzHl+E7YPMt8aC+M3c/j4Khgf0MWsdZJ3eRBDeLxu8nPpn1agUTk3SYz80GlpSA0yx63MmQG0j09hmf98fY9llRcuBrbu6ZUVlFUbanjE4WlRfN3l67G3mQ6MZPeh8rdNOhOLLltdE8AsodZhljWSMnfTp8FgiNeRicseJ/+5Me0mOAe0nYTP2TXwDY9BxGY5CPtAMs69EKybPwLGAeN6leZlP9ioE/5djMxGW0IaeeAgnTM7iGwP3C30Dr7ZKU3hAND1DSRYVz30Vt27zAooAv2JN6AmOHJUUzlBlCDvptq3QW9GvFGvJMeNcI4ZalHSqhkiLOhZKiIzb1TI6hPzRwWOc95nSBk67XVAD6MgZunu6bxcEzYtOSq4CKExD/MyDipKh8nQBPYG4rkrJ60QMJRza3kPLnIOYKsAIgXpX7oY9vt6QnLFP/F81lWNN6uz8ymy0NsRtIYk1XAN1R7oDuvVOm3Gv74yzSL5FVLdqEjY3tpxN3gNnrBU9X9Y+Z47K+E+aEm6wG4NT0JCBm5Sbp3n7tN81h31xWt6/mJjJvIoFnTiufzlBf3m1k03vUfkbOhJLgzxuVQbACancbcnHlTGUFr0USyqxnD3gV+FypZdRO+iEO7nZBgpOQj7TwPH8DAUgG3o4MdV8xFX8tf5g0GuVRXM0HSnqLp2CmrC5r652u93w/5IYObLca3hac9Ypc76mMBPRwPG7+4wM6rbOOt+lbwfn7gXJZCm3tYFwD3wjsC0Ar1nveMCHQwmNtSS5UBK0hs62FzNJtds9eU2xlYG8/7kHdQrtkjj9Ma00pG68EsssM1SkTf/MgAz3XJKJVrIh/Lr9weVVsEflF+4L8J38k4bUqZWw5wJ8tdbH/qV 20ahid7a TcU3c5SX0L+H389TmRhWdnzxefEN9YXzQNNzfx5zXLxm+UuO3juifEUW8THCgO34A4oPwWUFiwQMlO549iLKBEHcds9zt3HaxNGaJA/+hZYCfYNJ2Xw+WIp8MG+lglL6iDxk4SphVpbl9kytzrLkdtU8i7nfUilOX8M7et6/06Q489DEZii/JKk/rjJULNBETIqGdQ4nhLKfoTKFBv4CU8GEdHbjdBf/3w27sZ461zqFn0TQgDrYVtwY48BYwMoeitas11wNB7rpZ4EkRvOomqq6qhDIy9xgPUGa2qKgewfMkvhvQQ/suaqgmTObwjkfudwSS/bz8+oSRcwmW+eh3WOg03diJlHoTdfU8JAGfNAdAaWngZhRL64XTjMffaqkqs36/kbdntL1OU1We+5eZnfCgTvnbJdf1RfjPoWwNZpPAVX2qBIYsp0MS7neXr8G2y75XCvtiIG407qs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 1e4c64b71c9b ("mm/memblock: Add "reserve_mem" to reserved named memory at boot up") introduce usage of isspace(). Let's include in kernel.h to fix this. Signed-off-by: Wei Yang --- v2: include ctype.h in kernel.h --- tools/testing/memblock/linux/kernel.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/memblock/linux/kernel.h b/tools/testing/memblock/linux/kernel.h index c16d9cd2d1ae..4d1012d5be6e 100644 --- a/tools/testing/memblock/linux/kernel.h +++ b/tools/testing/memblock/linux/kernel.h @@ -9,5 +9,6 @@ #include #include #include +#include #endif From patchwork Fri Aug 2 01:09:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13750998 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 860C6C3DA64 for ; Fri, 2 Aug 2024 01:09:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C74C06B008A; Thu, 1 Aug 2024 21:09:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C044C6B008C; Thu, 1 Aug 2024 21:09:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A50136B0092; Thu, 1 Aug 2024 21:09:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 84BFB6B008A for ; Thu, 1 Aug 2024 21:09:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0A773A57FA for ; Fri, 2 Aug 2024 01:09:42 +0000 (UTC) X-FDA: 82405523004.19.BF8A8B9 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by imf01.hostedemail.com (Postfix) with ESMTP id 3B2CA40017 for ; Fri, 2 Aug 2024 01:09:39 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GCgd2ElR; spf=pass (imf01.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.52 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=1722560951; 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:in-reply-to: references:references:dkim-signature; bh=MG9S6gbxwdSBJfdbb/Z4n1WtX6iDsEmG4mLp80lBudU=; b=66yoHcBFJCqBwLMyGp8NqScfI/e5fu66YuyWQ0CGv0INsXBfzqjxbqGdI3D3jJO6kXt4Eh pcV6wpOs0CIy3MIA1gPJUIsnubuD1bt+iK0LtaMvweFSf/eEklIU7X2h4M3hWKiQnWfjbr xOLXlitV5esvYk5JoNd8VAf9QMDI9Tc= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GCgd2ElR; spf=pass (imf01.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.52 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=1722560952; a=rsa-sha256; cv=none; b=Sd4E/iKupaLq5sVyOy24Ih8eZYy+unABCNhOg+fdXuM1QwQGr5x3aJOfNXbeLVtP3O8RBS 1MBBHnWCjQwzty9yHEndm3LjrU7FLaG1Lza3zdo1tm13MvhOjNYBb4qU0HYY8WcKGjvIYW nn7/mFkvNGVMvHnlQdnpgf3J3wamT1M= Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5b391c8abd7so6749544a12.2 for ; Thu, 01 Aug 2024 18:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722560979; x=1723165779; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=MG9S6gbxwdSBJfdbb/Z4n1WtX6iDsEmG4mLp80lBudU=; b=GCgd2ElRVl/F1rPJGtSYQC5QXesCmDwo0VMxEeg0h1HXji1by+JvF7LEDGbY5BUPM8 hGfGHxP1FcFOVMawq+hgmwIALOqk7t41Io0qOeqPDxjV6h5Rh0FmQgGtJi3OCU9Yxks6 8qsBOyNU07ypnyokhCeP+ESiQ1JGxY8aG4QcTkShXATjRLrzfi0ojiHaT3IZuToCdGeB 2L775WtRy3b5IAI6YmTofiLfvMJW+kVdHbWS4PLBJ3sk3fM6Tg1jDG2DOTlG+c5xp61D KKshTGmR5slh8u1K7bqs8TchIjejx1ypW98Xn89tybhEJK83v1cOZujQSv4ILUoJ5NAT AK5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722560979; x=1723165779; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MG9S6gbxwdSBJfdbb/Z4n1WtX6iDsEmG4mLp80lBudU=; b=JaFdiFzMxk5Kv4qcBqPkyXZsjlJ3mr3oBivrLxb8VrDGm5XwEbomrp4MQXs/LTanqe Drw2cnXEFshpw1pUeRAkKmaYcfhbqO8qiV3nQoF6fjqEM7JlTUAR44EgzyzZ7y9ib6qh haesxCgK3Ow6cFyl/Cg6Wy0EBzgQi1GOLOrRCHuv0w1iJlElM6c7DPL8hQKH4R946EkJ T52b/6tt8hWRln/3G7vdc2qNrKmh8/FEdfsBsmjgty/Rq5Jim945q6U0zP2JfLXAgsaq St/rbQOwGLuoOFHfNDVVRsCAxcpeNA4xbXrqHdVw5iqAa6aEbDiIxcGqUI/ju1RBfg/7 2Qnw== X-Forwarded-Encrypted: i=1; AJvYcCXHJfy03zRa+NdRCqMr+Lfw4tWBWpwsGLAAvj0GObq7xZHTW2S/soBaN8tTEiNtE6reQLvaYV9Bwo2bUOPT/zqeeVs= X-Gm-Message-State: AOJu0YwUEkbvIXLGozoidOZEs/VeMVEpMRyt6k5qV26lTxXB+Jny8qZp cw8eLI+PwP7jVcojRw1C/ZjJtiLz3Ck94pFBs1ytu/EN290AN7Dd X-Google-Smtp-Source: AGHT+IE5ShbfZbDdd2LTvz66bL2KLfOUkM9NClobxGX5rHyYVvmXyG6VbQdGvzCZl64uSWIFNbkDuQ== X-Received: by 2002:a05:6402:8c7:b0:5a1:83c4:c5a8 with SMTP id 4fb4d7f45d1cf-5b7f3cc54f2mr1247625a12.14.1722560978637; Thu, 01 Aug 2024 18:09:38 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b839705d44sm408708a12.11.2024.08.01.18.09.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Aug 2024 18:09:37 -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 v3 5/5] memblock test: fix implicit declaration of function 'strscpy' Date: Fri, 2 Aug 2024 01:09:23 +0000 Message-Id: <20240802010923.15577-5-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240802010923.15577-1-richard.weiyang@gmail.com> References: <20240802010923.15577-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 3B2CA40017 X-Stat-Signature: hh5jrdczfzjzywsmxs6qkryaw6wfd31d X-HE-Tag: 1722560979-35330 X-HE-Meta: U2FsdGVkX1/ojzdRhXgH9tOD7epFwxeHwGkgMB9oxGMT4v4yK8To49Mitnu4jyN0pOy0XPHwqA7UhLlrTLd6Wno9/xQ4Qq0nVaoyeo9l/TUfJuAKh3fzc9y4uyJEnNlwpsM9zj//aaW22YzMEfWmrsZYLM/nSIbeisQzCVODJut/8CvYwNpJOdLIyOR/OxloUABApEFOqF1SAICfk07OqB4x2TQcKBuorD9sfia8AlMpE2O816GlOBfHbL29EMTxA7VN5YwsaUYK/iD7QWKk/SjESrA3Z6eoOOnrX/yTt/iMDqWjLiYCXgP88wq5zV94NxNSQGiNbiKU5yTHnAt2aC1WbbUkt8NY+tGfneQQfuekJopN56IwG5xQxmMznVtdxNaftl902vhS/K/wCpw7hoJ887IEdqys5qszNiUKYqq1i1qbVTRh0qedLHfwLWzr5LvqRMzVBCGklM7+BzUKS1m9zVNHXNq8rYtO+q7uVMxYne/WxhTJ6NV3XQ2Ku9bvvNY0cEk0ja5xv+P7VCyt9dhuYFUOtQPaYkLaTDIzOrYz1+eoV+Xm1iXKmdauR5yMHSNrrjrWvjMO8chyVjLidn6sHMFbj98UTKg7ZkujbKZ/JcdEPHdhYy8wQffQGgz7W4msLPR6e7uKiNoi2zDwnQ/spukWM6e9zgJiqOuOOuPSj+ydXaJGfcyGapYQCDpLAQoPCvqp4vmNTDitEtLZEwOT1oLDvoql3ggAIQF2M3L9AQdZvoB4J8Fdpgk4pIv3emoTc4S1OZpyRqdzscbXVxkKuOn5VE92zhz/ZWDxXW/h5z3rmGDRD0UEcYhGLe1i0tmGtE7PPKSvoKyxKYX2ZDZR041AOjDMifCImkM/KBz/j+gGhpAcFDqjVtPJ2veNRSOb4G5KhXybRq8VMIrX7sPa4v4yc8CGnhzBDIPzhXYmvTryk0a269HYRWP/KbpBJYqSgsYjoKVSaLnRT5s Ck+cD/Hn kqNZeBopLX+r/wAHDhmMSUqEeOMjsnp0DpImQRkIp6mkcdjwxQuEqpOi85td62nLv5lv2359NGv7lJHDEqQTC7q+zL2HLcJL4UniilE7gKV5ZFjSJTli2WgkVokPPeWJ60HusvmtVpkOG0GhmB+tyyuVp0Ef2ta5swNWTA2f9KJXqKlTaHnLnp4SBzdCWJ3mvBnkv0MWGzZRxjlOhyf9wM/Cm3Jn7rBRRlQe47SNDBK9QwcG0LQCTorcCRfZ86VvvcSgdaNQ9T8bpkLcj7DY+cuDR9dXQfR8kM8O/aUfUtT32xz2WRbydCGty6tisWTiAhtdzm/CukrSsRcOfqabFxoRhydLp15i1/DKaiOSnps6oAWF9N8iY9HHaGwglXsxfzfu1y8woBZ+SHYYAV/P2mFxQbgUG6oJIP/JT X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 1e4c64b71c9b ("mm/memblock: Add "reserve_mem" to reserved named memory at boot up") introduce the usage of strscpy, which breaks the memblock test. Let's define it as strcpy in userspace to fix it. Signed-off-by: Wei Yang --- tools/include/linux/string.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h index fb8eda3019b5..41e7fa734922 100644 --- a/tools/include/linux/string.h +++ b/tools/include/linux/string.h @@ -12,6 +12,8 @@ void argv_free(char **argv); int strtobool(const char *s, bool *res); +#define strscpy strcpy + /* * glibc based builds needs the extern while uClibc doesn't. * However uClibc headers also define __GLIBC__ hence the hack below