Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4606029rwb; Tue, 8 Aug 2023 10:51:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyX41BcE5Wwu8SolDAojUTArUzkRdYo7EayrN0c/0E63SY+Z6nDNH+r9i3J9nxnQPWKneN X-Received: by 2002:a05:6a21:35c4:b0:13e:1712:4c01 with SMTP id ba4-20020a056a2135c400b0013e17124c01mr173052pzc.42.1691517113808; Tue, 08 Aug 2023 10:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691517113; cv=none; d=google.com; s=arc-20160816; b=QlMuGYKigwCylS1AbghrVfX8caVDLjCjBmUA32C4aFqCojMtdUvLwyaZcEJQ3aQWLQ dISinpfoRPwfrkuGnaHIRpWUP9n8q9d44O+HOO/Mt9GvAyiSjizpD/abntaYHZX9zkMQ 0Js46iDWea/5KjOJtLvQyvt+TCK1eqGGEHtnHecQu2i42JsqgfMwOV7CCWPOnR9FS132 RVogKV3E4Ukgu5FOlyPL2gR2ctXuvd9DzMJ6ux7JvFjXmIArUAOlUPyVEcxZ1KAqNlGm Lt7lTuSd8ccQKskwSFtl8Pyg4+5x2fKOfpauF+jY7LDPePnpy7k79zq2JpAsu9Q1t9l/ NWaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=c717CSUcQPSlow7vY+l0D1zfE/3ZWjsjq52MhwiY9jQ=; fh=J8lwpheDG2nnnIgEay13Ip2qo+FJjLxdcKa96+yY5rM=; b=d7vUzCelhfoGV79uUj+iADjSTWys+nsB/lg6mFsxtALfqsKZ/UzoBCp+hiPlKxIvuv OkvPONv6vo3WjL0r/FJ57th3SCJZo6Z/ktNurk802NHkx7mcbNYosFNmpVbM9mMZphjl v8c+Jh5Rxqxlrkmr+p0GTyDf84omwq8v/ah6uYeUDYiW47Q3dw3HQtRrjh+dcKIuc3W7 t8L8PNMox9kux8HYDKue80QX/7oCQ4+5yg2nbyHC7skLiPVxdzQe7CYr+cWpRdn3PWNd MkGE67GYiRXbagn+RNnNO+4qx9pw1PzdUykdyIk4lCoEBNcn7cS3RSNduuF+6G3J19B7 qB0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SC3kfic9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a63dc56000000b0055b7171f86asi7587757pgj.185.2023.08.08.10.51.41; Tue, 08 Aug 2023 10:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SC3kfic9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233572AbjHHQuh (ORCPT + 99 others); Tue, 8 Aug 2023 12:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbjHHQta (ORCPT ); Tue, 8 Aug 2023 12:49:30 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 750744AABF for ; Tue, 8 Aug 2023 08:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691510250; x=1723046250; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WqUbKspfNJbqE0nLiF+n9zQ92CXed0lkUH9NGnIH5hw=; b=SC3kfic9a28LAx/HilnmHWZaGITda5Dt7SwxvEt8GTLUhlOVbQiqF7rD RT8WUsPWWRjWi3ElaHMH1S+TdP31JjEAk0ZVi794cbOMNXYd/w4jeUvS5 E8G0azeoB2nY2X20meQwDlR3lNuTOB/XoTkntd1orKKeKfUU4NV/dERQn Ne6HyiFH9G1C3nkiQZlDNNpw6w0Bhv1CDxcSpuIcJttK9KYcC3iDApRnu JDvFOuGyPTmghKpoecPvdA+IciOgM4RjR2oC5dL2V9MqJFH/aHgkkvv7/ EeAF7A35uwXKvmzy1ZTcIxP6gI0sica2LWSRUv5rvZDILo1Um8t0yhHsp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="369711744" X-IronPort-AV: E=Sophos;i="6.01,156,1684825200"; d="scan'208";a="369711744" 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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