From patchwork Fri Aug 4 08:26:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13341453 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 D7574C04A94 for ; Fri, 4 Aug 2023 08:26:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53A612802D5; Fri, 4 Aug 2023 04:26:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EBFA2802D4; Fri, 4 Aug 2023 04:26:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27B892802D7; Fri, 4 Aug 2023 04:26:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 100B12802D5 for ; Fri, 4 Aug 2023 04:26:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C5AF580112 for ; Fri, 4 Aug 2023 08:26:31 +0000 (UTC) X-FDA: 81085740582.19.039E5EC Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by imf02.hostedemail.com (Postfix) with ESMTP id 98CD68000F for ; Fri, 4 Aug 2023 08:26:29 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=KXKqQOOc; spf=none (imf02.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 134.134.136.31) smtp.mailfrom=andriy.shevchenko@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691137589; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zA/dH5Y7WcTQ2A6+oZfsEez4kkDuyoFFdNy1mTJzEFY=; b=DCJhMO8MVggoXHc4yITuvngwc2QRPoAkGxFIr8gTWiZWIh02Be7XR1VMKNLziwbzn5MCXS b0GFwqGIY4uTugK3P5ofuPJuRWPF6wYhWE5Zg6fs8va2HqsfTH/18pjhjjJSCjXxFVYY+T R8Yi6y+7zPu9IE4ZuqDPSpOwgVBJRjk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691137589; a=rsa-sha256; cv=none; b=lJNXd/aT3t61LOja8jnl/oN26R9YlcYY/MwiF00CGgnxRg9x3gC62mLZzSby5kcoqBfbiP 1V7lngWuW0TTRFQXBqkmhCBiUUA8o8OW4nDsbVIH04FtIzFD9xL/Ojl9hkW3MWkIojy2Vc r7crM6pbxPX4cUvTHUeNMkl7AWaaNHM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=KXKqQOOc; spf=none (imf02.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 134.134.136.31) smtp.mailfrom=andriy.shevchenko@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691137589; x=1722673589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uw2Ld+AeDxNhMI9Z37vKGF4a6VjahNfcrZb6asDNsiE=; b=KXKqQOOcUZARtH62v/rHSCCNP2fcGyR7mJ4V/6huTF+vZDUVimKLf58p eZl0G6BZr2oHIWJXAxXp/BCq7CRZWE0ohoEto2MShm9RhTsUi8mfU7VWC Xmm+WVvVRjjfb9dHBxLPHAecvllNSwh0uEmj37DEmuM952fDxCvv2fVFK 0KfL1s20VPbyAMPyJj/UhdmEi3SU3gPNiL7pb5fBLt0SBoKjR38M8c3Q6 RUd+yF79kc9mLYiF3KkeE8VDiUzLtg/98rNHj45kfFrt0N66rgPw3sfYq g5FHajw7tEhuroXN6yZyKfrjTm+b+gN03qfO3J62gqk7y6UcReXlJiwxL A==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="433952154" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="433952154" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2023 01:26:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="706907756" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="706907756" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 04 Aug 2023 01:26:21 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 78DB16A6; Fri, 4 Aug 2023 11:26:32 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Petr Mladek , Steven Rostedt , Rasmus Villemoes , Sergey Senozhatsky , Alexander Potapenko , Dmitry Vyukov , Andrew Morton Subject: [PATCH v1 1/4] lib/vsprintf: Declare no_hash_pointers in a local header Date: Fri, 4 Aug 2023 11:26:16 +0300 Message-Id: <20230804082619.61833-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230804082619.61833-1-andriy.shevchenko@linux.intel.com> References: <20230804082619.61833-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 98CD68000F X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: w5ix6acp8q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isXiEgb68LD5qpk5qtXtEkWKZCFS86JPLOT2bX0nHS2Vevzt1fETWjwrhqaq1jb+Y1aQSiMQ51NuJBxF3bp64wm4IpcGbkG0HmkULBdJ821F6grkHLmUmzSLTkfD4Lfe9h9kPPaaiPIW+2V0NKe0pg76X2BnI1SDXO42NXjBzOChYniVg3XKZUOCN+CU 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: Sparse is not happy to see non-static variable without declaration: lib/vsprintf.c:61:6: warning: symbol 'no_hash_pointers' was not declared. Should it be static? Declare respective variable in the local header. Signed-off-by: Andy Shevchenko --- lib/test_printf.c | 4 ++-- lib/vsprintf.c | 1 + lib/vsprintf.h | 7 +++++++ mm/kfence/report.c | 3 +-- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 lib/vsprintf.h diff --git a/lib/test_printf.c b/lib/test_printf.c index 7677ebccf3c3..9e04b5f7244a 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -24,6 +24,8 @@ #include +#include "vsprintf.h" + #include "../tools/testing/selftests/kselftest_module.h" #define BUF_SIZE 256 @@ -41,8 +43,6 @@ KSTM_MODULE_GLOBALS(); static char *test_buffer __initdata; static char *alloced_buffer __initdata; -extern bool no_hash_pointers; - static int __printf(4, 0) __init do_test(int bufsize, const char *expect, int elen, const char *fmt, va_list ap) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 40f560959b16..6774cf84e623 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -54,6 +54,7 @@ #include #include "kstrtox.h" +#include "vsprintf.h" /* Disable pointer hashing if requested */ bool no_hash_pointers __ro_after_init; diff --git a/lib/vsprintf.h b/lib/vsprintf.h new file mode 100644 index 000000000000..ddffde905824 --- /dev/null +++ b/lib/vsprintf.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LIB_VSPRINTF_H +#define _LIB_VSPRINTF_H + +extern bool no_hash_pointers; + +#endif diff --git a/mm/kfence/report.c b/mm/kfence/report.c index 197430a5be4a..fb28c6abd58e 100644 --- a/mm/kfence/report.c +++ b/mm/kfence/report.c @@ -19,6 +19,7 @@ #include +#include "../../lib/vsprintf.h" #include "kfence.h" /* May be overridden by . */ @@ -26,8 +27,6 @@ #define ARCH_FUNC_PREFIX "" #endif -extern bool no_hash_pointers; - /* Helper function to either print to a seq_file or to console. */ __printf(2, 3) static void seq_con_printf(struct seq_file *seq, const char *fmt, ...)