From patchwork Thu Sep 14 07:56:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 139419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp183064vqi; Thu, 14 Sep 2023 00:59:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH59Mo981+RT3PzKC4pPoMuGEvjRcIaPk+hTPCoYXzhiuKC8MrBHaLFiXFMGSLvwe39D+4g X-Received: by 2002:a05:6a00:847:b0:68f:cb69:8e78 with SMTP id q7-20020a056a00084700b0068fcb698e78mr5756077pfk.5.1694678398760; Thu, 14 Sep 2023 00:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694678398; cv=none; d=google.com; s=arc-20160816; b=a/yNgxECw71COzawM0uUV9YN75V2RzdacKL3XqzIczolJZQUh/+nKyonZD1/tRIJEm LIutYKPadyUbJGqDhVlZs5ZGczK/cKmV06GEtiVVm54LpJBacwGq3LkBrg9tssLEYxlB +9QU9d3I/ThWHFFKRoC2ZhAwsgovIzXy9c/cryCHCKUtMSwewBVS9bxONpkMt0C+x2qo +vltGcxjAB4dQE/BQIxnIJ8yKRuw5ikZR4+rGTo8nWm8mVLfng8TJ5nEdFTUcYGwZacH MF+YVNy/7f1czw9Pen9n4D+nCIUjqYQWd/qigCjUEs/1JpbVpBzadhxxU6iu06NMN7D2 9deA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=thSMwp1+oYnYBVswQ47ILEV1PRhPp3DO3ndk8vH4O2Q=; fh=fwStCqjhUX7M3xSS+y9hGH2Aj4Ysyh0lvKOLTCiQ8J0=; b=VMyheminyOrIJIUokhqzuQ9/WkgAXBB18xMJEZZGURI3zmJ6uwFxaW7hQAYbtAYp6t NVSBrGDFge9zSv8d8NPXskVx2OdSbsTy/uaG9qcUmjHpzOVkxpx/MzIaOJaSdymr61xb sBPxijbCHFXkFmWZLfzM7phrfE2YioWWA56Su/jtxGGKGjFL2WUFyx5k4rKwO7+QRS7m VhZl5TAms8uFTP/LNMRTbbQ5xO9v7snWlemkCfm+8sqwA8kg0p/3u0ZSijRC7NG/R/PI dKKKuh1Ytloblaiu0QJ7MTQxU+Hie7bLM+kZr9GzBMGptxYaiivRJpKtDlUTZxPNMc03 hoVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kdHUcK77; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id x6-20020aa79a86000000b0068896692255si993972pfi.86.2023.09.14.00.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 00:59:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kdHUcK77; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 34CA780225B5; Thu, 14 Sep 2023 00:57:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235980AbjINH4z (ORCPT + 35 others); Thu, 14 Sep 2023 03:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235935AbjINH4u (ORCPT ); Thu, 14 Sep 2023 03:56:50 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE4671FC0 for ; Thu, 14 Sep 2023 00:56:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4188BC433C7; Thu, 14 Sep 2023 07:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694678205; bh=43+dXaouu7djoigVoxm+HE1AawyJHHKsfY707t/g9tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kdHUcK77snHtiH1fIoj0JBOIn6Atut9NYodwp5lUWUVzNxD8HUeW+Wr4Zk4sXrAqv IvuWlXrl5Cq6Agmxx3Dn08a2n60FttFEdpJ/7O+fgEluQRNsGL/Rq+LNNg1tsi55DA pA/UxvpXRVQuoXCmlbO4Zjk8+/97NfnuaCA/NAO4aJPtH3dL6xslM9qe1BxIYsXO8s nQ0ZSrmVGQbxuxU5dQVyYRbhnnljE7VJVJ6ty7RoNfFb/nKZ8gTTlHXiX9h4zbfmcy /sSvgkShjcY3VvpCWsQt/B22w13h9n2HXcnVh7FZXGXjEFSnVGGa1vR/SpXCU3oTzr jF8zlgVbaTCGQ== From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Mike Rapoport , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] memblock tests: fix warning: "__ALIGN_KERNEL" redefined Date: Thu, 14 Sep 2023 10:56:31 +0300 Message-Id: <20230914075632.9515-2-rppt@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914075632.9515-1-rppt@kernel.org> References: <20230914075632.9515-1-rppt@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Sep 2023 00:57:03 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776999096386254581 X-GMAIL-MSGID: 1776999096386254581 From: "Mike Rapoport (IBM)" Building memblock tests produces the following warning: cc -I. -I../../include -Wall -O2 -fsanitize=address -fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT -c -o main.o main.c In file included from ../../include/linux/pfn.h:5, from ./linux/memory_hotplug.h:6, from ./linux/init.h:7, from ./linux/memblock.h:11, from tests/common.h:8, from tests/basic_api.h:5, from main.c:2: ../../include/linux/mm.h:14: warning: "__ALIGN_KERNEL" redefined 14 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) | In file included from ../../include/linux/mm.h:6, from ../../include/linux/pfn.h:5, from ./linux/memory_hotplug.h:6, from ./linux/init.h:7, from ./linux/memblock.h:11, from tests/common.h:8, from tests/basic_api.h:5, from main.c:2: ../../include/uapi/linux/const.h:31: note: this is the location of the previous definition 31 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) | Remove definitions of __ALIGN_KERNEL and __ALIGN_KERNEL_MASK from tools/include/linux/mm.h to fix it. Signed-off-by: Mike Rapoport (IBM) --- tools/include/linux/mm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h index 2bc94079d616..f3c82ab5b14c 100644 --- a/tools/include/linux/mm.h +++ b/tools/include/linux/mm.h @@ -11,8 +11,6 @@ #define PHYS_ADDR_MAX (~(phys_addr_t)0) -#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) -#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) From patchwork Thu Sep 14 07:56:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 139420 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp183177vqi; Thu, 14 Sep 2023 01:00:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOL643iprW0WAtstZ59OdWgFJkjfIy5A6O9w4FkbK1sxD097JjbmBCQe3lQVyrvVCiHFJG X-Received: by 2002:a05:6358:4187:b0:13a:6748:927d with SMTP id w7-20020a056358418700b0013a6748927dmr5618617rwc.0.1694678411367; Thu, 14 Sep 2023 01:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694678411; cv=none; d=google.com; s=arc-20160816; b=qUMOt9ghg/Q+9RmwAC1RoQRgXMnUlaNWlDnMo44/yuHHLlHK7tYHW6EdwgBilLAxKO cdFQ728WjSXNR//krUrajvEuIp23VM3O3/SF13Vg1xjBiAswrlHWgwx6JPEWKiZs8bK6 9KPdyoxSz6hy/KOKv3oDdzrM+aSe8UM/eheTCFYXGf+9XX1/DnHslKwV2UNwwJ9wDNhW e+VoF5K9/u2BQmOmmeWQtko0aXhCg80tkqjdYzfyYzmbEy9Tz473UnOj9R36NBOevrDv ptwatqzEo5l2gIZkaN8gkrrx0O5AQwcfK5YXcGiBywJCQ9yS+/KMc8lyXL0X1VaLhaFH r/Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Cfe0hDGbytL9liaKJu3LI5U5h3FSA+aUkj07C67WOO8=; fh=fwStCqjhUX7M3xSS+y9hGH2Aj4Ysyh0lvKOLTCiQ8J0=; b=Tg5Mmpo58+QrqkXezBqOLCL59dqaD6K8DK4CprwEwUcUoQQQUk8eQjO6B/49WsC8uO engB7HeMqK0JuzQb4v7auPePRlCH44TkQmwpbGXESGankxNrB4bPG6q2G4DJeRv6PcHc jUNhDT263lAGwi80pXcx+10aEflEX+Vvz4V6ocD3NeCKSXxIy/eHc8+Dgakjxoc2bjJd C8k+U8PNWw1wFou0J0vFByf1GPMcujynCbnsu9l7HGTjCo+FLBBYS03lAY9F0oOFugmY HFaSeacr3hpMtr9ChZJ8GnbHhDMM3KGkEXVn7Bmd/79ZY1cCDsswKjvaStRdgkA3An8/ 02hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V3a1jkgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b00565d3043716si929979pgv.76.2023.09.14.01.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 01:00:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V3a1jkgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id ECB2D802D183; Thu, 14 Sep 2023 00:57:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236133AbjINH45 (ORCPT + 35 others); Thu, 14 Sep 2023 03:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235969AbjINH4x (ORCPT ); Thu, 14 Sep 2023 03:56:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABCFA1FC6 for ; Thu, 14 Sep 2023 00:56:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11FECC433C8; Thu, 14 Sep 2023 07:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694678207; bh=9jZHF/WoDrDlTmD+rv+EN7tkrTG84HymGbe+Wx1tQBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3a1jkgx9h+3UFijQVLP596H5NMlokw0rtDhGLa+6AnN9nFjHRxDbPK3jqxOSBkVe pNRkd3kQ8dKOVloME4WOpqPOZtj7QJ2lHRl1klNDehztjRoSsA86BxzBb5pNUWEYRd 4XagF7Pn5Kiam4qFc32kA40Gio4zdZsHdDXQ9BtrFWba3uIC9uvnyGfrO7vcTSxk5N P2mvhgAudOb02jT+O4Ez56iVMQjqXKq92Oe4z4DwrTGQfn7Cs2G79AVyQNs2pYKeMk SxlQFp4iOv06AAbeDOPHtHbk5kf7R/GpdFdOW5hBqTqyusOTLW+AHj7m4qQIyIq0RN aF1Pg56fqCHug== From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Mike Rapoport , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] =?utf-8?q?memblock_tests=3A_fix_warning_=E2=80=98struct?= =?utf-8?q?_seq=5Ffile=E2=80=99_declared_inside_parameter_list?= Date: Thu, 14 Sep 2023 10:56:32 +0300 Message-Id: <20230914075632.9515-3-rppt@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914075632.9515-1-rppt@kernel.org> References: <20230914075632.9515-1-rppt@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 14 Sep 2023 00:57:05 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776999109972536548 X-GMAIL-MSGID: 1776999109972536548 From: "Mike Rapoport (IBM)" Building memblock tests produces the following warning: cc -I. -I../../include -Wall -O2 -fsanitize=address -fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT -c -o main.o main.c In file included from tests/common.h:9, from tests/basic_api.h:5, from main.c:2: ./linux/memblock.h:601:50: warning: ‘struct seq_file’ declared inside parameter list will not be visible outside of this definition or declaration 601 | static inline void memtest_report_meminfo(struct seq_file *m) { } | ^~~~~~~~ Add declaration of 'struct seq_file' to tools/include/linux/seq_file.h to fix it. Signed-off-by: Mike Rapoport (IBM) --- tools/include/linux/seq_file.h | 2 ++ tools/testing/memblock/tests/basic_api.c | 2 +- tools/testing/memblock/tests/common.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/include/linux/seq_file.h b/tools/include/linux/seq_file.h index 102fd9217f1f..f6bc226af0c1 100644 --- a/tools/include/linux/seq_file.h +++ b/tools/include/linux/seq_file.h @@ -1,4 +1,6 @@ #ifndef _TOOLS_INCLUDE_LINUX_SEQ_FILE_H #define _TOOLS_INCLUDE_LINUX_SEQ_FILE_H +struct seq_file; + #endif /* _TOOLS_INCLUDE_LINUX_SEQ_FILE_H */ diff --git a/tools/testing/memblock/tests/basic_api.c b/tools/testing/memblock/tests/basic_api.c index 411647094cc3..57bf2688edfd 100644 --- a/tools/testing/memblock/tests/basic_api.c +++ b/tools/testing/memblock/tests/basic_api.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#include "basic_api.h" #include #include -#include "basic_api.h" #define EXPECTED_MEMBLOCK_REGIONS 128 #define FUNC_ADD "memblock_add" diff --git a/tools/testing/memblock/tests/common.h b/tools/testing/memblock/tests/common.h index 4f23302ee677..b5ec59aa62d7 100644 --- a/tools/testing/memblock/tests/common.h +++ b/tools/testing/memblock/tests/common.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include