From patchwork Mon Aug 14 16:33:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13353069 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 E0B0AC001DB for ; Mon, 14 Aug 2023 16:26:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DD846B0075; Mon, 14 Aug 2023 12:26:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78D476B0078; Mon, 14 Aug 2023 12:26:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 607808E0001; Mon, 14 Aug 2023 12:26:27 -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 48CEE6B0075 for ; Mon, 14 Aug 2023 12:26:27 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1B4DAA0B21 for ; Mon, 14 Aug 2023 16:26:27 +0000 (UTC) X-FDA: 81123238014.19.6116A72 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by imf24.hostedemail.com (Postfix) with ESMTP id C4C3E18001A for ; Mon, 14 Aug 2023 16:26:24 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=QhFAmBw8; spf=none (imf24.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 134.134.136.24) 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=1692030385; 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=V3WuGizvUxC5vuhzZZFDGOR3mhwu63Zix/qU35Czt8E=; b=rD9vNFfP9ICQgGa43x45YxPQvmQYAb3T7MkSIDS0E9UYkMqA/O2MwDIcQdDzwRfI5fhw1+ afVo/8R6UDcIH5t0G3i0BrQnbO1qT+kJK0I6MDuQsRhqiDV7oe5tyZ0a6GQ/ohPufvXWz0 Jw85gyHeiFqP87T1sFa1ptnepjBbrNk= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=QhFAmBw8; spf=none (imf24.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 134.134.136.24) smtp.mailfrom=andriy.shevchenko@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692030385; a=rsa-sha256; cv=none; b=Q9Sftwi6hlXFFd5gqMX1YOqugT1GjC+lI3HPR53XKdpMSzeBq/M0YC8CAY78WWNgukMKvz 5YNTW1Otwr2ycr5OM9T79qsImqMKm+O0oREs817d3XTL4GTy+napTG9UtgmtcT774z93lx TN+zcEBw4yIQYpefXDC+l7SCvOAHaOI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692030384; x=1723566384; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8kHf+dvmKQBM1iVcpQWZ+d+J4wh5hZpOnrYE1R/YRJ0=; b=QhFAmBw8AGBBWwYbMnl583c7iQhhv/SI12YvcRcwTe2VuwSZFxqU2iFW ggUAWc9NDSe9P3v0kQSsQsDmShNT36fJejPcBTRMuAxpU6g4wp6b3BVZX SrCJevIUqc+hcZzuogu9BqEQo+8nxaXK6AOxGHxncqeqsGrkC2Br5l3bs 6npqw0cvFcdhv7WHJCPu0T9UdHsWTlluOgJFdt/gDQb0UaeZ92MDkYQlI 3PrEP8fbShsqHvVU1k4YsXnrFJ3ffU+07E3b4bJXumgrZPfkRevqaryPz gjmAi4QtuU2pTQDGiSJLk9b36l9klLYq11i03LRXZMjz0cMSyF9m9zXM8 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="374852974" X-IronPort-AV: E=Sophos;i="6.01,173,1684825200"; d="scan'208";a="374852974" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2023 09:26:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="762991308" X-IronPort-AV: E=Sophos;i="6.01,173,1684825200"; d="scan'208";a="762991308" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 14 Aug 2023 09:26:19 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D6FF8374; Mon, 14 Aug 2023 19:33:48 +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 v3 2/2] lib/vsprintf: Declare no_hash_pointers in sprintf.h Date: Mon, 14 Aug 2023 19:33:44 +0300 Message-Id: <20230814163344.17429-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230814163344.17429-1-andriy.shevchenko@linux.intel.com> References: <20230814163344.17429-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: C4C3E18001A X-Rspam-User: X-Stat-Signature: mh3umdembfd1fybgscnm6f5h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FRqtwld7NVEsd5oZOZcgwFrWxmUkp27RIvPdJFdNsXu1pp06wlj+BgngwyELiBAyTLaBen6t4DQ7vppJVAHZdQ00Nm5+wrd25bETBETK7yY9WPBikJqiKpjIml6eXSTv/RhNOidrCyAXtVsY+T86Adzr8BRVIWQW7Msy5WZBuqH8G9hg== 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 Reviewed-by: Petr Mladek --- 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 ce749cfac033..69b6a5e177f2 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -42,8 +42,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, ...)