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 39562C001DB for ; Tue, 8 Aug 2023 12:51:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B1A8C6B0071; Tue, 8 Aug 2023 08:51:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACB4C6B0074; Tue, 8 Aug 2023 08:51:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 992558D0001; Tue, 8 Aug 2023 08:51:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8B2326B0071 for ; Tue, 8 Aug 2023 08:51:06 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5011E40202 for ; Tue, 8 Aug 2023 12:51:06 +0000 (UTC) X-FDA: 81100922532.26.91EFF89 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by imf25.hostedemail.com (Postfix) with ESMTP id F32ADA001E for ; Tue, 8 Aug 2023 12:51:02 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=lBP8HwQC; spf=none (imf25.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.120) 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=1691499063; 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=c717CSUcQPSlow7vY+l0D1zfE/3ZWjsjq52MhwiY9jQ=; b=INlpPl4eyjAZaC4GNvmWZkkEesr7hZB7tkYmrEqyJ0eMd9k1DpHpyqEEFHY/KLf5Ke/7Z2 xj8DHYd88mVWYPss5UcU4RZubm6r3JDSB8ZVge54wpw1JkbL/bZfRVa2EKKDujm9JLbeyX U0McF5gqjh9Lov2DXEHq2KFY4DunTrI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=lBP8HwQC; spf=none (imf25.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.120) 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=1691499063; a=rsa-sha256; cv=none; b=JgJrpmxHuqYD28Db8GpBYD6Pm/rqTs1CsPFCo64f5S2pfllwSPA7sraE+1N7aPVoiIYEaY xOKSAYhaOTEB2Icpayb4MjdNgQkzIstj295dENkBeQpkIlZbzR3D9mUyTZR0d0d/TgMru1 3P3dty5Si8VWJFT3/MQjFsXBy3iC6u4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691499063; x=1723035063; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WqUbKspfNJbqE0nLiF+n9zQ92CXed0lkUH9NGnIH5hw=; b=lBP8HwQCC1dlBtxJIyIdZY6p3p5fGfCJ8JBMKC7nQn2qc/mrpwpi11oN gKVDaLV9KfbxQYYRH9ZTt5YQbUgshTt/WNHHSgcFbIaVD+pUKYjjlqJao LQYY2o/5EaQdxnszGt+fvzafxfk8X5Br97II6R274YElN5gVfc+pPKDYf SjUHbGO7PVQqlOW6TOTkAemu8Rc5AyMwaQdW1IcJFNgSsD6Kw23bcPfIp s6y9wDObzQTRBUk1TdCdMmmVseXxLw8hj/+RGHgC8zQ/FhvnAgvapsmSf ZMwN613Lmc+hI3uEs5RGzR02Aq45JzoAd3oqr8mglEovWQaJSJpEK436n w==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="369711746" X-IronPort-AV: E=Sophos;i="6.01,156,1684825200"; d="scan'208";a="369711746" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 05:49:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="681226171" X-IronPort-AV: E=Sophos;i="6.01,156,1684825200"; d="scan'208";a="681226171" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 08 Aug 2023 05:49:56 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qTM9q-008S3O-2i; Tue, 08 Aug 2023 15:49:54 +0300 Date: Tue, 8 Aug 2023 15:49:54 +0300 From: Andy Shevchenko To: Steven Rostedt Cc: Petr Mladek , Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, 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> <20230807222455.27874f80@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230807222455.27874f80@gandalf.local.home> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Rspamd-Queue-Id: F32ADA001E X-Rspam-User: X-Stat-Signature: spgj338i77xzxpdxof934zw8tjwhtock X-Rspamd-Server: rspam01 X-HE-Tag: 1691499062-512822 X-HE-Meta: U2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D+gsicg2w4IliCrZEcnuB+X5LS1WgJoVK3b6q3X8Pe7fHD79NZ3djv3HsdnvIbCDGIVHtWpCpw73/QsUumkyKaVoaufqJhVbAyw+H6DcrbD5Ksh 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 10:24:55PM -0400, Steven Rostedt wrote: > On Mon, 7 Aug 2023 18:09:54 +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: > > > > 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. ... > > > 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. > > If you separate out the sprintf() into its own header and still include > that in kernel.h, then for what you said in the other email: > > > What to do with _headers_ that include kernel.h for no reason other than > > sprintf.h (as an example)? Your suggestion, please? > > It can include sprintf.h (or printk.h or stdio.h, whatever) instead of kernel.h. > > What's the issue? The issue is the same, printk.h brings a lot more than just s*printf(). Why should I include it for a, let's say, single sprintf() call? -- With Best Regards, Andy Shevchenko