From mboxrd@z Thu Jan 1 00:00:00 1970 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 E413CC001DB for ; Mon, 7 Aug 2023 15:12:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B5B66B007B; Mon, 7 Aug 2023 11:12:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 666538D0003; Mon, 7 Aug 2023 11:12:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52D7D8D0001; Mon, 7 Aug 2023 11:12:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 44E486B007B for ; Mon, 7 Aug 2023 11:12:22 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E6809120B71 for ; Mon, 7 Aug 2023 15:12:21 +0000 (UTC) X-FDA: 81097649682.08.9A90C6C Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by imf26.hostedemail.com (Postfix) with ESMTP id 5EBA614000D for ; Mon, 7 Aug 2023 15:12:19 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=EXC47946; spf=none (imf26.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691421139; a=rsa-sha256; cv=none; b=jGQDAdcqwzelvhfyIOaSI9fZWlyB/7zAm8jurVfCtxjbIyWey2GSkPT8iXKNDhRxtD895K kA7VcKIX7KZ1ByllJntKRB8ce5CgOshe901ZIGxmNHcZS6Bi+ONYVl1eq7ozZQbuvMWXU9 O554HxHeoswolWIGvAYnww3mK+HJ2/g= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=EXC47946; spf=none (imf26.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=1691421139; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=guMrud55VTtcvPdgdTU777r0FixjH6cD/wJk+UegkBQ=; b=DWk/XnHfk0XdmKUbb/iK35SmiVVm3vC/KmzFKcdborhrVFMe7dOfpmcH0F1/k1Mh3oJHpl DQidiH6Dwz8wNdOKzY1PN0gp3+p0phBicNyTeCkUj0E/uN52fjyF/jDKoG1FNHi1H1vEWH ESOpSQgpKQRC6zaPujXzr9XejQahNW0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691421139; x=1722957139; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=W68uUCvV0Z+4rklVXDyvUrYFp1GzMOTZPtJmbE5mzSs=; b=EXC47946lMQqxkBdBR0fl6KEgUSvkreLmI74Qp+GsI6aHNzz7m7R1K4F UtW41+T/HhSb6VzW4x0gyeXAQYXFAh2HK3wkbhi0moQpmlS/4cYo/i+VV 3hPXijiPRwLLjftIA4LIc8Rv4zvOc3nLZ8WZIm0t92Qwb9XljHJC71ago 3PAfp5NK438Xbqr85IAB+KfAP2oyN3gpQAKNAK2Rdi31VBZOOaFo0r/2r DdtoGLCbgV0Mn+8kwETAg5Y0FLZ5N9PG4ss10rQSr63KBjscls88hp1J2 /1LUlxKBTEEaNJDsPpodaySIiHph9T6CvQsxInLwm/1xq6CSTokqWA0a0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="434417652" X-IronPort-AV: E=Sophos;i="6.01,262,1684825200"; d="scan'208";a="434417652" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 08:11:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="854692563" X-IronPort-AV: E=Sophos;i="6.01,262,1684825200"; d="scan'208";a="854692563" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga004.jf.intel.com with ESMTP; 07 Aug 2023 08:11:26 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qT1tE-00GnnI-0l; Mon, 07 Aug 2023 18:11:24 +0300 Date: Mon, 7 Aug 2023 18:11:23 +0300 From: Andy Shevchenko To: Petr Mladek Cc: Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, Steven Rostedt , Rasmus Villemoes , Sergey Senozhatsky , Alexander Potapenko , Dmitry Vyukov , Andrew Morton Subject: Re: [PATCH v2 2/3] lib/vsprintf: Split out sprintf() and friends Message-ID: References: <20230805175027.50029-1-andriy.shevchenko@linux.intel.com> <20230805175027.50029-3-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5EBA614000D X-Stat-Signature: jwnmsddd67d57zsy187cto9bddbjxqfy X-Rspam-User: X-HE-Tag: 1691421139-440590 X-HE-Meta: U2FsdGVkX18smZCqNpD5OGvck0u5kd7qrq/QbyIKiGhJCOHYPsWJ95fJGP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xG5+g9VrJ5Cly6RWfShE= 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: On Mon, Aug 07, 2023 at 06:09:54PM +0300, Andy Shevchenko wrote: > On Mon, Aug 07, 2023 at 05:03:19PM +0200, Petr Mladek wrote: > > On Sat 2023-08-05 20:50:26, Andy Shevchenko wrote: ... > > I agree that kernel.h is not the right place. But are there any > > numbers how much separate sprintf.h might safe? > > Maybe, we should not reinvent the wheel and get inspired by > > userspace. > > > > sprintf() and friends are basic functions which most people know > > from userspace. And it is pretty handy that the kernel variants > > are are mostly compatible as well. > > > > IMHO, it might be handful when they are also included similar way > > as in userspace. From my POV printk.h is like stdio.h. And we already > > have include/linux/stdarg.h where the v*print*() function might > > fit nicely. > > > > How does this sound, please? > > Not every user (especially _header_) wants to have printk.h included just for > sprintf.h that may have nothing to do with real output. So, same reasoning > from me as keeping that in kernel.h, i.e. printk.h no better. (haven't check these, just to show how many _headers_ uses sprintf() call) $ git grep -lw s.*printf -- include/linux/ include/linux/acpi.h include/linux/audit.h include/linux/btf.h include/linux/dev_printk.h include/linux/device-mapper.h include/linux/efi.h include/linux/fortify-string.h include/linux/fs.h include/linux/gameport.h include/linux/kdb.h include/linux/kdev_t.h include/linux/kernel.h include/linux/mmiotrace.h include/linux/netlink.h include/linux/pci-p2pdma.h include/linux/perf_event.h include/linux/printk.h include/linux/seq_buf.h include/linux/seq_file.h include/linux/shrinker.h include/linux/string.h include/linux/sunrpc/svc_xprt.h include/linux/tnum.h include/linux/trace_seq.h include/linux/usb.h include/linux/usb/gadget_configfs.h -- With Best Regards, Andy Shevchenko