From patchwork Fri Jul 12 03:51:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13731267 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 15B50C3DA45 for ; Fri, 12 Jul 2024 03:51:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 64B506B00A1; Thu, 11 Jul 2024 23:51:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5FC3C6B00A3; Thu, 11 Jul 2024 23:51:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 316316B00A4; Thu, 11 Jul 2024 23:51:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EDCB46B00A1 for ; Thu, 11 Jul 2024 23:51:47 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B313F120609 for ; Fri, 12 Jul 2024 03:51:47 +0000 (UTC) X-FDA: 82329726654.18.63D7DA4 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by imf27.hostedemail.com (Postfix) with ESMTP id E548240015 for ; Fri, 12 Jul 2024 03:51:45 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cHfP+ZDN; spf=pass (imf27.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.179 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=1720756290; 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=TyQlU6I/jiYkGlfq1197jGcyZ0KF+HN5OropbzcVk08=; b=hRFkGd7kti0CgTu5KC8Xq0f06e/QiMv/q3fIUgn1POahSkdTkXoD16AhgkQ6fM4MqOOEvZ Inpp7RPIjZDM3AnQE3xyYW5+0gIzU3XGxP+S0uLDEnen78Jak2y/6FU2ilv+G8R2tjS+41 W2BDl2mOQB573JeHBeIZ4ruRE4BbtWY= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cHfP+ZDN; spf=pass (imf27.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.179 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=1720756290; a=rsa-sha256; cv=none; b=kWZpVOV/XzsH9zuRrGnXrD6q1fcdeLiY4nYZQ6TrDbbC4rtDdj99Xb/w799shi6cKL+Ytj IpSlKgtDFudRhJ3+kXIkcg66MHhgaalmDPiINGDNzhp2OsUPd9dINMix45v+1EFrVntgNk v2Wc5XnO+LQaaqD2Otu/YrzT2lt4RB4= Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2ee90f56e02so16781051fa.2 for ; Thu, 11 Jul 2024 20:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720756304; x=1721361104; 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=TyQlU6I/jiYkGlfq1197jGcyZ0KF+HN5OropbzcVk08=; b=cHfP+ZDNkc/KoJfNOukSpS73yF6/sDvHVL16YTnNxXH/dVTTNVR6M/GYW2xz6dHRno QlVECI5GQBJVY8eG7sX1xNGpC2KzQeDTu0oMn827qv3N4OvnvTSFVXvzOH82/15SlJra doOB4c7AyPmlFlZPrCH/0sv+A+iDPb0CuSjR6EMtvv2qUAVD/qwVmAuxR2EK3R/YIebS /1+In/EygM7e+JHmmcA12UBky0G4ZpIyjUZ5jpLdnjPTBF3WXf6KOwXp5FNAal2S+75t xyjv8xLdFQbANFdcYOgbqhqTneGJdL7anuxWMrUnFPRkdbh1WXEud0AVmJisUwTOtNzl qgbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720756304; x=1721361104; 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=TyQlU6I/jiYkGlfq1197jGcyZ0KF+HN5OropbzcVk08=; b=paxuZouOPx3g/mJrrXRKfosh+CZpY9lC8W7kzqD5mxLyAJH5r1pPqjT6DM6sZuqPRu m7BMVmVqSwhLUWRyPIsCMDX7GBPSTWTBfadeydC4xHjFc6jb9pA1/huf3pgD118ficTU puLEGpC5LR5hD8qOZoceOldLRgXoH7LvcWFaWyoHVCCca2u7Ey707sRq9L3Wja6WWnhH BYErBjPMTtviALJePN3wG0gI1UdbQqhSEQVC7dcGzT8wKKlQbj92J1ykGC7XPG3s92fS ejsW5UM+K/viT3veOU/exYTDkWKXYO7HZfrz0fkRNsx5mSsaRzWu9wyiN60O6CFF01EX kg7A== X-Forwarded-Encrypted: i=1; AJvYcCXb+sHg66U7C7SYBP3GXzb+YRRGcQxT18DBbkxChT+vvCLS8c5BC7biwguodu8iPlITGcpGPKBOK9r3fgBB3llSxdQ= X-Gm-Message-State: AOJu0YySHRbB3yhzcMJf+q95WVaoY7ALpO4VbA1ISIbMXAGZr9nt5DEZ Qyb1yVLu3iNysHn2HKLP2rkohRTuYcd1N2V7LnH8SjJIDLHZULp0mLei3dSP X-Google-Smtp-Source: AGHT+IEK9t2pOh9KJ0YSVooVs/Js8zZyCAua2NoCqtsWQcOWOWHE6kuCTkxYpkqw/hXZwXoTIs1YyA== X-Received: by 2002:a2e:a401:0:b0:2ea:7d8f:8d12 with SMTP id 38308e7fff4ca-2eeb31979bdmr63277511fa.48.1720756303816; Thu, 11 Jul 2024 20:51:43 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-595b1c0c869sm3285535a12.30.2024.07.11.20.51.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jul 2024 20:51:43 -0700 (PDT) From: Wei Yang To: rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com, will@kernel.org, broonie@kernel.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Wei Yang Subject: [PATCH 3/3] tools/testing: abstract two init.h into common include directory Date: Fri, 12 Jul 2024 03:51:38 +0000 Message-Id: <20240712035138.24674-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240712035138.24674-1-richard.weiyang@gmail.com> References: <20240712035138.24674-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E548240015 X-Stat-Signature: xskbu65dythhiu7m9r53mkpyi15x7ihw X-HE-Tag: 1720756305-172149 X-HE-Meta: U2FsdGVkX183RtEENMfQNJd+CGMdVWdhbOvCJX5fkCR+I+f+F4u+y4XcBo+83JVqdPbAtotyD9IEZ9k5rL0znhXre8qJOhAyxoU08+wsMkWkeU+DdOMS4hkJz9JnCO8Iy3qiT79/qA7dJ3K5SGSamgONg/8z0R6r0lxnAasa5E05scmW/lRIu82KX5cYVMOAwO8XEGuYV4MzUcIwMnYywoxz8OesaumZBImcRJ7ySxBKG1Qj7qRfqol4L4wfKrJcNlezFo5pKEhOgMnvFXP7+Uszfby5PTUOJC3UdP5fnUEX62x7c2PN/pgPs6Im/yCroq/Vm3Fs2FtdbjkdJt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LH2rKYcBna+Y9MI7t2tCYFPYDHz3JpVaWGWlvQDEuhcvLLvSukwmzfPPzud8iIcVTkATmeGUpgMJHyrA== 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: Currently we have two test suits define its own init.h. This is a little redundant. Let's create a init.h in common include directory and merge these two into it. Signed-off-by: Wei Yang CC: Mike Rapoport CC: "Liam R. Howlett" --- tools/include/linux/compiler.h | 4 ---- tools/{testing/memblock => include}/linux/init.h | 14 +++++++++++--- tools/testing/radix-tree/linux/init.h | 2 -- tools/testing/radix-tree/maple.c | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) rename tools/{testing/memblock => include}/linux/init.h (81%) delete mode 100644 tools/testing/radix-tree/linux/init.h diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h index 8a63a9913495..e0aaabd18a99 100644 --- a/tools/include/linux/compiler.h +++ b/tools/include/linux/compiler.h @@ -122,10 +122,6 @@ # define unlikely(x) __builtin_expect(!!(x), 0) #endif -#ifndef __init -# define __init -#endif - #include /* diff --git a/tools/testing/memblock/linux/init.h b/tools/include/linux/init.h similarity index 81% rename from tools/testing/memblock/linux/init.h rename to tools/include/linux/init.h index bd74abc5cba6..7ed407976dda 100644 --- a/tools/testing/memblock/linux/init.h +++ b/tools/include/linux/init.h @@ -1,9 +1,17 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _LINUX_INIT_H -#define _LINUX_INIT_H +#ifndef _TOOLS_LINUX_INIT_H_ +#define _TOOLS_LINUX_INIT_H_ #include +#ifndef __init +# define __init +#endif + +#ifndef __exit +# define __exit +#endif + #define __section(section) __attribute__((__section__(section))) #define __initconst @@ -29,4 +37,4 @@ struct obs_kernel_param { #define early_param(str, fn) \ __setup_param(str, fn, fn, 1) -#endif +#endif /* _TOOLS_LINUX_INIT_H_ */ diff --git a/tools/testing/radix-tree/linux/init.h b/tools/testing/radix-tree/linux/init.h deleted file mode 100644 index 81563c3dfce7..000000000000 --- a/tools/testing/radix-tree/linux/init.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __init -#define __exit diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index f1caf4bcf937..d6c72838652c 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -14,7 +14,7 @@ #include "test.h" #include #include -#include "linux/init.h" +#include #define module_init(x) #define module_exit(x)