linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Konrad Gräfe" <k.graefe@gateware.de>
To: Petr Mladek <pmladek@suse.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Andrzej Pietrasiewicz <andrzej.p@collabora.com>,
	Felipe Balbi <balbi@ti.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 1/2] vsprintf: Add %p[mM]U for uppercase MAC address
Date: Thu, 4 May 2023 15:25:40 +0200	[thread overview]
Message-ID: <69e232c0-56ff-268c-43c4-ff40f5b00568@gateware.de> (raw)
In-Reply-To: <ZFEAq7r-awo0OYzp@alley>


[-- Attachment #1.1: Type: text/plain, Size: 1377 bytes --]

On 02.05.23 14:23, Petr Mladek wrote:
> On Fri 2023-04-28 08:56:59, 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.
>>
>> In this case, the caller can just as well call string_upper() on the
>> result
> 
> I tend to agree with Rasmus. string_upper() is a super-easy solution.
> One user does not look worth adding all the churn into vsprintf().
> 
> Best Regards,
> Petr

I do agree as well. That would basically be v1 [1] without the 
hand-crafted string_upper(). (I didn't know the function.)

Regards,
Konrad

[1]: 
https://lore.kernel.org/linux-usb/94afd6e0-7300-e8f4-d52e-c21acec04f5b@gateware.de/

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

      reply	other threads:[~2023-05-04 13:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 13:15 [PATCH] usb: gadget: u_ether: Fix host MAC address case Konrad Gräfe
2023-04-25 13:37 ` Greg KH
2023-04-26 10:17   ` Konrad Gräfe
2023-04-26 11:49     ` Quentin Schulz
2023-04-26 11:49     ` Greg KH
2023-04-27 11:51       ` [PATCH v3 1/2] vsprintf: Add %p[mM]U for uppercase MAC address Konrad Gräfe
2023-04-27 11:51         ` [PATCH v3 2/2] usb: gadget: u_ether: Fix host MAC address case Konrad Gräfe
2023-04-28  6:49           ` [PATCH v4 1/2] vsprintf: Add %p[mM]U for uppercase MAC address Konrad Gräfe
2023-04-28  6:49             ` [PATCH v4 2/2] usb: gadget: u_ether: Fix host MAC address case Konrad Gräfe
2023-05-02 20:03             ` [PATCH v4 1/2] vsprintf: Add %p[mM]U for uppercase MAC address Andy Shevchenko
2023-05-05 14:36           ` [PATCH v5] usb: gadget: u_ether: Fix host MAC address case Konrad Gräfe
2023-04-27 12:26         ` [PATCH v3 1/2] vsprintf: Add %p[mM]U for uppercase MAC address Greg Kroah-Hartman
2023-04-27 12:35         ` Rasmus Villemoes
2023-04-27 14:26           ` Konrad Gräfe
2023-04-27 21:30           ` Peter Seiderer
2023-04-28  6:56         ` Rasmus Villemoes
2023-04-28  7:19           ` Greg Kroah-Hartman
2023-04-28  7:46           ` David Laight
2023-05-02 20:01             ` Andy Shevchenko
2023-05-02 12:23           ` Petr Mladek
2023-05-04 13:25             ` Konrad Gräfe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69e232c0-56ff-268c-43c4-ff40f5b00568@gateware.de \
    --to=k.graefe@gateware.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andrzej.p@collabora.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).