Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1730822rwr; Fri, 28 Apr 2023 00:36:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7r/9Y7m7GeB8oXisnAMAtTdTHyd/Up7gGeaDBYMgj/I2E3SeaL3Zn0YGQJ5LSUQphqOcST X-Received: by 2002:a17:903:41c4:b0:1a6:e58f:8aee with SMTP id u4-20020a17090341c400b001a6e58f8aeemr4813108ple.65.1682667398311; Fri, 28 Apr 2023 00:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682667398; cv=none; d=google.com; s=arc-20160816; b=o796bA3oXipXMYTvhqpy77m6/SAxbrpe+HYFwgmtacc8cKtLe7GFgoA3uCXzhvGklC 1i8Dx8m9DN1SN6KxKwml9n9Z1Quk6wUkEQFM/lEuuoY6XAsd8xBmBqLvSkgP5TWZZ3lQ d8TfTTUJ6AD68Uds7HylS50o4k0kGCNPinfsDGRPFr2dZ/ECApXQynJ7jA4XlEhUm2bi FmzVhIB2U83lChptnrhU8TT41In5/R9oOG+tS8xYCPH/PdjwZLN8mM9fmwsHoZ9o8unv GSpDutVS+Nczl1dSxhQp/i31LKBWnAHoYnL87Ftn2pXQZk24aGRP/HRAxqBz4QnXMCon vxrQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zPBuY/kBAJ16npsMbLjFXMj4Tcyt4g13CHVcimOoGY4=; b=Rt8AWZO1ltxmiZ257MW4jwaNkIqGdXc1RpLfPGIqyyF/h5XLMFof3ZgVX52bEpJszX FKVPHRGgQV9a3/hwntYKk0f13/70AflwLFj3TmHaKLCz4HupQFnDXjayssMZk7DxwBlv E0bXsGGpmtZF8nozDMhYrSyh4bEEYbozOVNkm3YLn0ACIsgT2tS7rnNcPm43V885Tr+z HUkz4Xs5hSa9pp4gpG1GL7SidTSakuog06JJc48wJHKvl3YQwjOWfRLwR987sjZeND2d 4JToFQUMoQa76QdqB2fDQyvQq9H94FRSihXnb9IGtQ0IvP26cuyCgYkJaU25JRBnHxqx xjkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oQccHbkn; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a170902f78d00b0019c33978781si21207525pln.283.2023.04.28.00.36.23; Fri, 28 Apr 2023 00:36:38 -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=@linuxfoundation.org header.s=korg header.b=oQccHbkn; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345505AbjD1HTf (ORCPT + 99 others); Fri, 28 Apr 2023 03:19:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345483AbjD1HTY (ORCPT ); Fri, 28 Apr 2023 03:19:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4274419D; Fri, 28 Apr 2023 00:19:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90C93611B9; Fri, 28 Apr 2023 07:19:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 736EFC4339C; Fri, 28 Apr 2023 07:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1682666362; bh=SBNac9jS/BNRjGAVVN/JSSN0yPxOjtUBPHY5Mv3soH8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oQccHbknLU/UZyOV6gPCWgClywqH+bzAnio+39gZpuQ3d+ZnPpZ3bQWZ240uny4fD HxJARrL3JyA6bTkL4CaoAuaIQox5L/svg7saVXXbsV+UynGV7jjOOhUgJ4KwhPi1jx NavFzDtn3nTyzphYDAoo5kGu8groasq8DMDmk/MI= Date: Fri, 28 Apr 2023 09:19:19 +0200 From: Greg Kroah-Hartman To: Rasmus Villemoes Cc: Konrad =?iso-8859-1?Q?Gr=E4fe?= , Quentin Schulz , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kyungmin Park , Andrzej Pietrasiewicz , Felipe Balbi , stable@vger.kernel.org Subject: Re: [PATCH v3 1/2] vsprintf: Add %p[mM]U for uppercase MAC address Message-ID: <2023042842-embattled-collected-8638@gregkh> References: <2023042625-rendition-distort-fe06@gregkh> <20230427115120.241954-1-k.graefe@gateware.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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 Fri, Apr 28, 2023 at 08:56:59AM +0200, Rasmus Villemoes wrote: > On 27/04/2023 13.51, Konrad Gr?fe wrote: > > The CDC-ECM specification requires an USB gadget to send the host MAC > > address as uppercase hex string. This change adds the appropriate > > modifier. > > Thinking more about it, I'm not sure this is appropriate, not for a > single user like this. vsprintf() should not and cannot satisfy all > possible string formatting requirements for the whole kernel. The %pX > extensions are convenient for use with printk() and friends where one > needs what in other languages would be "string interpolation" (because > then the caller doesn't need to deal with temporary stack buffers and > pass them as %s arguments), but for single items like this, snprintf() > is not necessarily the right tool for the job. But sprintf() already creates mac address strings today, adding yet-another-modifier makes it so that we don't have to hand-roll this type of logic in the individual drivers that require it. thanks, greg k-h