From patchwork Sat Aug 5 17:50:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13342645 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 28DE5C001DE for ; Sat, 5 Aug 2023 17:49:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84BC18D0006; Sat, 5 Aug 2023 13:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7AE148D0002; Sat, 5 Aug 2023 13:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 600038D0006; Sat, 5 Aug 2023 13:49: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 38DCC8D0002 for ; Sat, 5 Aug 2023 13:49:39 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 011291C915F for ; Sat, 5 Aug 2023 17:49:38 +0000 (UTC) X-FDA: 81090788478.30.C6CCC9C Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by imf11.hostedemail.com (Postfix) with ESMTP id C681640020 for ; Sat, 5 Aug 2023 17:49:36 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=SfLidcpZ; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf11.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=andriy.shevchenko@linux.intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691257777; 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=YiDRN4KLkDxtCAumuHw+kaAhuG4xOP0mLOcBIaK9ECQ=; b=yy+j+OapxCOF63lfsZOIYdvCM8oEqt5ng52zacSlEJwqocMkRcJDYt7s7rCUNs/ft/5bJJ 9GznxrQ6Bew/g/StFk/5vvhtGlj1PK7XCSLzrRWLzB2sCMZ6gABmApw+Nx0kPrna34/WG1 vmKcKLPBCVIKu41ktKHMjTN/4oQnqBQ= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=SfLidcpZ; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf11.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=andriy.shevchenko@linux.intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691257777; a=rsa-sha256; cv=none; b=5duIPm4Vk6h3EPjIuYs9TZqRP+QtDJhCpucrx4XvqZ+GbIbjxVq7l43XoDQiFIjqeiGDSk ABfPUyHJO6xEtoC4JiRyTV/5SeWCJgnzoI7dLkEVWnl0zDwTKLTERr/wzgXlzdMCqronSR uCx/wlaL9vh6lWHMbwbs/5GKma1JgHM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691257776; x=1722793776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9t4+UHB5bV6ky/Acf0xEikn59MqZgagOLuXamRB5Rw0=; b=SfLidcpZvIBxZ/YztO1Ckf5lU/rzBKZcOeI++agB6SeXSd39XN/+WZzP o/ldur0i4RoNhsC4/8xr4guPBigmWpsYk28qicKLCl0cNt3+RkR0IuDHs 6vcTAADykiDJTw8/MbkXJf2foZ33QIV1Iu0TOMzBbX0iy+7JcRKx4ThPI tX9QGp352uOgWV5zDh43jXzNeYwgmou7+UCEVkjHwhyEUrxfFNraEkG4B vzqjB6tOK3UOu9K0uCivvqCrxYu7ukuhBct5EAVVBewQseZf9aHpuNOO6 sBQ5vhUIiDAqx9acJdi7BW54Fab4Ru85Jv5k3Ic8dby7RHiZSrH/O0kzE Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10793"; a="401292543" X-IronPort-AV: E=Sophos;i="6.01,258,1684825200"; d="scan'208";a="401292543" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2023 10:49:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10793"; a="820494258" X-IronPort-AV: E=Sophos;i="6.01,258,1684825200"; d="scan'208";a="820494258" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 05 Aug 2023 10:49:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id AA2F4F12; Sat, 5 Aug 2023 20:50:29 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Petr Mladek , Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Steven Rostedt , Rasmus Villemoes , Sergey Senozhatsky , Alexander Potapenko , Dmitry Vyukov , Andrew Morton Subject: [PATCH v2 3/3] lib/vsprintf: Declare no_hash_pointers in sprintf.h Date: Sat, 5 Aug 2023 20:50:27 +0300 Message-Id: <20230805175027.50029-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230805175027.50029-1-andriy.shevchenko@linux.intel.com> References: <20230805175027.50029-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: C681640020 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: fjg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mTYlqCjlSWG7q+FSqfYL1RtYNuIJ63lbXKH16WaTFEcpxqVMlfBMnnqG8MrxGAbgeHrhJTO8NqZKBlkTFzPbd8raJGYsY3L71GamFH6A9P27lm3X0GLYb4pa97FfUKGhhTe13GF61NEjGHG08nnAdFSPvZbQDl3FNu4vSVfW+uVVpkTnq0bhhXYzKouy 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 sprintf.h. With this, add a comment to discourage its use if no real need. Signed-off-by: Andy Shevchenko Acked-by: Marco Elver --- include/linux/sprintf.h | 2 ++ lib/test_printf.c | 2 -- mm/kfence/report.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/sprintf.h b/include/linux/sprintf.h index 9ca23bcf9f42..33dcbec71925 100644 --- a/include/linux/sprintf.h +++ b/include/linux/sprintf.h @@ -20,6 +20,8 @@ __printf(2, 0) const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list __scanf(2, 3) int sscanf(const char *, const char *, ...); __scanf(2, 0) int vsscanf(const char *, const char *, va_list); +/* These are for specific cases, do not use without real need */ +extern bool no_hash_pointers; int no_hash_pointers_enable(char *str); #endif /* _LINUX_KERNEL_SPRINTF_H */ diff --git a/lib/test_printf.c b/lib/test_printf.c index 5adca19d34e2..cf861dc22169 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -39,8 +39,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/mm/kfence/report.c b/mm/kfence/report.c index 197430a5be4a..c509aed326ce 100644 --- a/mm/kfence/report.c +++ b/mm/kfence/report.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -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, ...)