Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3130252rwb; Mon, 7 Aug 2023 08:40:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaNc3tdC/WXRpZ5R1aVd1woUYfD7iptccNEWSdZaUev9B9m1TA/oju8HTThwQ5tJo8wA2K X-Received: by 2002:a05:6402:1507:b0:51a:3159:53c7 with SMTP id f7-20020a056402150700b0051a315953c7mr8771697edw.30.1691422822955; Mon, 07 Aug 2023 08:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691422822; cv=none; d=google.com; s=arc-20160816; b=brvjpXnKNFL6zS9eFccHAuaq7HTv31Vbb+pJD3+TmRNRFrR1dEHO01OnG7nMbLpQTl IJKkpZVZ/TpdwO/AXtguUOz5zYmqWRQJKgDHkxq7FArh2uLLBSLY/K/yjo0z5Oc+7X7M h38rypHXNU676A+ZJvWkqXPs4KHYPHhH8+NHbTmMTiJi3MWuvoa5LnMODmAMJz6jzHzi uOq8Gsd7WT/za3uOHiTZXYs2kBAR3tg6RGQrUDTwDbGn9MeqyTryeFCiGh5brPDY0Ki/ ecoekvStvC0w4JD5T2Y3DP4lZmL7jz4RnwxrUc4rFW+lYQU7r+iXS7JkAyc7yNDU+u/w nxGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X3A2NsvXpmNRnd8PNau9KuaPdja1LGVqq+oucwV7B34=; fh=vmUQn/KoiKBz0TN4QXh4zrTyMSy/18taF2m5XcOxj7k=; b=qQrvgCrNgWv/qOwBFFmB6ZQDFkGzBHkY10uhEtpCQ0Y28EKwS8YmD6CL1kRm+xQh2D XiXuKEsRzXy8SfLrTidA3Aq68ceiOhvfRqyodaYBsZoq0jfL7+7WHYZs7II2p3qmyHFV FSCccApaIi+yslLbhovFphrHzy1qbrNBV3bqioj8U7b+6wFvJEPbOyekF1omj4YDjxDM +Kh33/tulLBBIr3EPccRmm/C++R9iTJ6w1/xcPE64R3Q3Qg1ikzv3JpqsZsz6m9QtjKz ohS2BTb09MyGDZVdjUkOO+GgUMgTh4SmO1z2hrqDSxJBnU/5jKZ7QpTbdf34Ol1sAKo6 fuIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=e6SNj8R7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a056402078300b005221d87d56bsi6321636edy.573.2023.08.07.08.39.58; Mon, 07 Aug 2023 08:40:22 -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=@suse.com header.s=susede1 header.b=e6SNj8R7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjHGPD0 (ORCPT + 99 others); Mon, 7 Aug 2023 11:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbjHGPDX (ORCPT ); Mon, 7 Aug 2023 11:03:23 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55DA610DE for ; Mon, 7 Aug 2023 08:03:22 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id DE1E91FE49; Mon, 7 Aug 2023 15:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1691420600; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X3A2NsvXpmNRnd8PNau9KuaPdja1LGVqq+oucwV7B34=; b=e6SNj8R713ZAAtu9DcuUfZqEtfKTl8DeMypsLAoGTGdfqcoR4T2yEVzvjrykJiB1+VmeYO vcmcyfr/xYigmi95BOsdYOgMbOC+xj8cZff8BI/GiNnTw8pgUn9StcWccERojMAS69TpnF SqkgvXce6Ob9uND7M59kPc3u1X0maqI= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5ADD22C142; Mon, 7 Aug 2023 15:03:20 +0000 (UTC) Date: Mon, 7 Aug 2023 17:03:19 +0200 From: Petr Mladek To: Andy Shevchenko 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: <20230805175027.50029-3-andriy.shevchenko@linux.intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 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. > > Signed-off-by: Andy Shevchenko > --- > include/linux/kernel.h | 30 +----------------------------- > include/linux/sprintf.h | 25 +++++++++++++++++++++++++ > lib/test_printf.c | 1 + > lib/vsprintf.c | 1 + > 4 files changed, 28 insertions(+), 29 deletions(-) > create mode 100644 include/linux/sprintf.h 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? Best Regards, Petr