From nobody Sat Feb 7 23:12:18 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38310C001DB for ; Fri, 4 Aug 2023 08:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234651AbjHDI0t (ORCPT ); Fri, 4 Aug 2023 04:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234559AbjHDI01 (ORCPT ); Fri, 4 Aug 2023 04:26:27 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C07C468C for ; Fri, 4 Aug 2023 01:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691137586; x=1722673586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uw2Ld+AeDxNhMI9Z37vKGF4a6VjahNfcrZb6asDNsiE=; b=mC848biGolxTU//b5meWB1Si295wqlpxTsgNzpPxOWQuNK8qmhZNl3m1 +NbiUoebLllBnC3c+h7/6X77HYD+Mqyf13croL4qJUS3JSuqDCY27lWWl Lwl0DBuMVJuN456tDHuLpLY1SSGFVkMeztR7s5CcVmRPDpoFtRFg4zySH 9Zx0l+ui1hwbmYdCQ/Gz/kc4Y0X2Rr0ve9ZXdjCw9UcQsK8pXHxTildHJ lEMmIdJqJaX0HuEzVsb8c8wtVk1eBOVuJaFOO0yxZj39uyHm7dA7Py1yu FwPwGvC1VwMV/3LX9ayBbiR3rCmrEt4eUZKu7TMEwDTTFFWVcn+xu4y8H w==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="433952152" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="433952152" 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Sparse is not happy to see non-static variable without declaration: lib/vsprintf.c:61:6: warning: symbol 'no_hash_pointers' was not declared. S= hould 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 @@ =20 #include =20 +#include "vsprintf.h" + #include "../tools/testing/selftests/kselftest_module.h" =20 #define BUF_SIZE 256 @@ -41,8 +43,6 @@ KSTM_MODULE_GLOBALS(); static char *test_buffer __initdata; static char *alloced_buffer __initdata; =20 -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 @@ =20 #include #include "kstrtox.h" +#include "vsprintf.h" =20 /* 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 @@ =20 #include =20 +#include "../../lib/vsprintf.h" #include "kfence.h" =20 /* May be overridden by . */ @@ -26,8 +27,6 @@ #define ARCH_FUNC_PREFIX "" #endif =20 -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, ...) --=20 2.40.0.1.gaa8946217a0b From nobody Sat Feb 7 23:12:18 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66148C001DB for ; Fri, 4 Aug 2023 08:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234601AbjHDI0x (ORCPT ); Fri, 4 Aug 2023 04:26:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234564AbjHDI02 (ORCPT ); Fri, 4 Aug 2023 04:26:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF24A4696 for ; Fri, 4 Aug 2023 01:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691137586; x=1722673586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9je9OUfnXEviEXKQNXB4gUKmQR3Ey4mpBgwuRjMpZ5o=; b=mlSVorM3xUk2ULomzOf0Uwsstg78ZW3bu6sMBjntjXgz+1fTepacBxxB 6a1P3PaHrbyKC/BW+Cps4hGSJjm+obUMtoxQPH9coDf/HFr6qqsTDxYon /xKr+8F5Nh6Z975giawYu8Q+3+EN2oBlyTQi/QiqTuMOgVaI6+t6DCqC0 UGeEUU4ifKVIAwfV+k0/QcKDV6pYAgN5fDTS/gLtBF3vRqsla0sUiqM8Q 4tmwPhI2eJuxet6FIOO5Neh1kUs8GO7hWtK4a/QTVCF2vytpO36EKZ5TP EjJhH2BHRxvcsK0IcPS/uD+4ITs5FC/E2c2KY3Y3lTW9cpUNeipG6SSem Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="370090221" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="370090221" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2023 01:26:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="733132238" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="733132238" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 04 Aug 2023 01:26:21 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 868F8F4D; 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 2/4] lib/vsprintf: Sort headers alphabetically Date: Fri, 4 Aug 2023 11:26:17 +0300 Message-Id: <20230804082619.61833-3-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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Sorting headers alphabetically helps locating duplicates, and make it easier to figure out where to insert new headers. Signed-off-by: Andy Shevchenko --- lib/vsprintf.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 6774cf84e623..63afffab4249 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -17,42 +17,44 @@ * - scnprintf and vscnprintf */ =20 -#include #include #include #include -#include -#include /* for KSYM_SYMBOL_LEN */ -#include -#include +#include +#include #include -#include +#include +#include +#include #include +#include #include -#include -#include -#include -#include +#include /* for KSYM_SYMBOL_LEN */ +#include +#include +#include #include +#include +#include +#include +#include #include +#include +#include #include -#include -#include -#include -#include -#include -#include + #ifdef CONFIG_BLOCK #include #endif =20 +#include + #include "../mm/internal.h" /* For the trace_print_flags arrays */ =20 -#include /* for PAGE_SIZE */ #include /* cpu_to_le16 */ +#include /* for PAGE_SIZE */ #include =20 -#include #include "kstrtox.h" #include "vsprintf.h" =20 --=20 2.40.0.1.gaa8946217a0b From nobody Sat Feb 7 23:12:18 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FBA1C001DB for ; Fri, 4 Aug 2023 08:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230023AbjHDI05 (ORCPT ); Fri, 4 Aug 2023 04:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234565AbjHDI02 (ORCPT ); Fri, 4 Aug 2023 04:26:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E38A4698 for ; Fri, 4 Aug 2023 01:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691137587; x=1722673587; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GrsynOg2xgorKiT0iE4UnCXSWHQ9xboHF2x1Jg9/Yuk=; b=LK86CKOJjzgIs5ylME9YVbqixUVTCj0xjeCMI2JA8KO7IbMutQW9YNiC QeHxkHvpxAGwxweQCVtdIdGMmZQoEOFrkImhi5DY12Wx0NXK4l/U4mfu7 XJhirmGYD1mmRfEbRHp3jOMqpu3IOHpCPc/XYeIiPDAKmGnFaKqRxlCZf JWe+OjPeX2gE8x2KNT0c616SCEzemPAIV3+U0W9zUAJsUeZm1di9S8fyf h+21KmupxrB9B1TAs76ijYlHTKySjNqSxPIDtQz4bK0ARA9cyPtKn/95I yr1Tf8J7MEBIsmIFIdxbeCF8peZQfOerS7ZJBS4FBNxfaGTCc4ua82xmS A==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="433952161" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="433952161" 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="706907757" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="706907757" 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 8F3DF1341; 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 3/4] lib/vsprintf: Remove implied inclusions Date: Fri, 4 Aug 2023 11:26:18 +0300 Message-Id: <20230804082619.61833-4-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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove inclusions that are implied and guaranteed to be provided by others: compiler.h by types.h string.hi by string_helpers.h Signed-off-by: Andy Shevchenko --- lib/vsprintf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 63afffab4249..eb0934d02722 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -36,7 +35,6 @@ #include #include #include -#include #include #include #include --=20 2.40.0.1.gaa8946217a0b From nobody Sat Feb 7 23:12:18 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF867C001DB for ; Fri, 4 Aug 2023 08:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234622AbjHDI0m (ORCPT ); Fri, 4 Aug 2023 04:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234558AbjHDI00 (ORCPT ); Fri, 4 Aug 2023 04:26:26 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8695730E0 for ; Fri, 4 Aug 2023 01:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691137585; x=1722673585; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oOKhR2UGvbPRHxNgYwLaRfSIwQ0Gyd6LYZcMKMFhKWQ=; b=ResE7mYAXbqhbH0c3BBb9SaOuQIeXhH9h3nAgnc/kpTMlgkIgOJ1OeBe N6x3p6yscqtG+Tm6K6DLlkH0/Wnfn3puSUJld+6p/NBECV+tzOte3A1CU /TGBbeVNELxROIDrQK8eRX9qczFA4D0ozhX1D8lvgLDY4sueuw+SDi4uu WE2F1K5An4IQGoFOrx2hd0bgMv07UA0ZDj7/M2inj9hQLGJaHV6Jq3YP1 QaTv1CqK9SAcieZBvOSRzX/93lfJPsPZPkkRMQdqKdoQbLhy3gkN9BaGu IeKWf3762c0juWNkivmehS30w/k4HKPO26C+m+oC4D60M6fz4JlMkJ1pu A==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="370090212" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="370090212" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2023 01:26:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="733132237" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="733132237" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 04 Aug 2023 01:26:21 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 99899F12; 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 4/4] lib/vsprintf: Split out sprintf() and friends Date: Fri, 4 Aug 2023 11:26:19 +0300 Message-Id: <20230804082619.61833-5-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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" kernel.h is being used as a dump for all kinds of stuff for a long time. sprintf() and friends are used in many drivers without need of the full kernel.h dependency train with it. Here is the attempt on cleaning it up by splitting out sprintf() and friends. Signed-off-by: Andy Shevchenko --- include/linux/kernel.h | 30 +----------------------------- include/linux/sprintf.h | 24 ++++++++++++++++++++++++ lib/vsprintf.c | 1 + 3 files changed, 26 insertions(+), 29 deletions(-) create mode 100644 include/linux/sprintf.h diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b9e76f717a7e..cee8fe87e9f4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -203,35 +204,6 @@ static inline void might_fault(void) { } =20 void do_exit(long error_code) __noreturn; =20 -extern int num_to_str(char *buf, int size, - unsigned long long num, unsigned int width); - -/* lib/printf utilities */ - -extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...); -extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list); -extern __printf(3, 4) -int snprintf(char *buf, size_t size, const char *fmt, ...); -extern __printf(3, 0) -int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); -extern __printf(3, 4) -int scnprintf(char *buf, size_t size, const char *fmt, ...); -extern __printf(3, 0) -int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); -extern __printf(2, 3) __malloc -char *kasprintf(gfp_t gfp, const char *fmt, ...); -extern __printf(2, 0) __malloc -char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); -extern __printf(2, 0) -const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list args); - -extern __scanf(2, 3) -int sscanf(const char *, const char *, ...); -extern __scanf(2, 0) -int vsscanf(const char *, const char *, va_list); - -extern int no_hash_pointers_enable(char *str); - extern int get_option(char **str, int *pint); extern char *get_options(const char *str, int nints, int *ints); extern unsigned long long memparse(const char *ptr, char **retptr); diff --git a/include/linux/sprintf.h b/include/linux/sprintf.h new file mode 100644 index 000000000000..00d1fdc70a3e --- /dev/null +++ b/include/linux/sprintf.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_KERNEL_SPRINTF_H_ +#define _LINUX_KERNEL_SPRINTF_H_ + +#include + +int num_to_str(char *buf, int size, unsigned long long num, unsigned int w= idth); + +__printf(2, 3) int sprintf(char *buf, const char * fmt, ...); +__printf(2, 0) int vsprintf(char *buf, const char *, va_list); +__printf(3, 4) int snprintf(char *buf, size_t size, const char *fmt, ...); +__printf(3, 0) int vsnprintf(char *buf, size_t size, const char *fmt, va_l= ist args); +__printf(3, 4) int scnprintf(char *buf, size_t size, const char *fmt, ...); +__printf(3, 0) int vscnprintf(char *buf, size_t size, const char *fmt, va_= list args); +__printf(2, 3) __malloc char *kasprintf(gfp_t gfp, const char *fmt, ...); +__printf(2, 0) __malloc char *kvasprintf(gfp_t gfp, const char *fmt, va_li= st args); +__printf(2, 0) const char *kvasprintf_const(gfp_t gfp, const char *fmt, va= _list args); + +__scanf(2, 3) int sscanf(const char *, const char *, ...); +__scanf(2, 0) int vsscanf(const char *, const char *, va_list); + +int no_hash_pointers_enable(char *str); + +#endif /* _LINUX_KERNEL_SPRINTF_H */ diff --git a/lib/vsprintf.c b/lib/vsprintf.c index eb0934d02722..e553bc9e18f3 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include --=20 2.40.0.1.gaa8946217a0b