mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Aditya Garg <gargaditya08@live.com>,
	Hector Martin <marcan@marcan.st>,
	alyssa@rosenzweig.io, Petr Mladek <pmladek@suse.com>,
	Sven Peter <sven@svenpeter.dev>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Aun-Ali Zaidi <admin@kodeit.net>,
	Maxime Ripard <mripard@kernel.org>,
	airlied@redhat.com, Simona Vetter <simona@ffwll.ch>,
	Steven Rostedt <rostedt@goodmis.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com,
	lukas.bulwahn@gmail.com, Kees Cook <kees@kernel.org>,
	tamird@gmail.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
	Asahi Linux Mailing List <asahi@lists.linux.dev>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v4 1/3] lib/vsprintf: Add support for generic FourCCs by extending %p4cc
Date: Tue, 22 Apr 2025 18:17:46 +0300	[thread overview]
Message-ID: <aAezGqdN9weTxv8_@smile.fi.intel.com> (raw)
In-Reply-To: <CAMuHMdXuM5wBoAeJXK+rTp5Ok8U87NguVGm+dng5WOWaP3O54w@mail.gmail.com>

On Tue, Apr 22, 2025 at 12:32:42PM +0200, Geert Uytterhoeven wrote:
> On Tue, 22 Apr 2025 at 12:16, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Tue, Apr 22, 2025 at 10:43:59AM +0200, Geert Uytterhoeven wrote:
> > > On Tue, 22 Apr 2025 at 10:30, Aditya Garg <gargaditya08@live.com> wrote:
> > > > On 22-04-2025 01:37 pm, Geert Uytterhoeven wrote:
> > > > > On Tue, 8 Apr 2025 at 08:48, Aditya Garg <gargaditya08@live.com> wrote:

...

> > > > Originally, it was %p4cr (reverse-endian), but on the request of the
> > > > maintainers, it was changed to %p4cn.
> > >
> > > Ah, I found it[1]:
> > >
> > > | so, it needs more information that this mimics htonl() / ntohl() for
> > > networking.
> > >
> > > IMHO this does not mimic htonl(), as htonl() is a no-op on big-endian.
> > > while %p4ch and %p4cl yield different results on big-endian.
> > >
> > > > So here network means reverse of host, not strictly big-endian.
> > >
> > > Please don't call it "network byte order" if that does not have the same
> > > meaning as in the network subsystem.
> > >
> > > Personally, I like "%p4r" (reverse) more...
> > > (and "%p4ch" might mean human-readable ;-)
> >
> > It will confuse the reader. h/r is not very established pair. If you really
> > wont see h/n, better to drop them completely for now then. Because I'm against
> > h/r pair.
> 
> I am not against h/n in se, but I am against bad/confusing naming.
> The big question is: should it print
>   (A) the value in network byte order, or
>   (B) the reverse of host byte order?
> 
> If the answer is (A), I see no real reason to have %p4n, as %p4b prints
> the exact same thing.  Moreover, it leaves us without a portable
> way to print values in reverse without the caller doing an explicit
> __swab32() (which is not compatible with the %p pass-by-pointer
> calling convention).
> 
> If the answer is (B), "%p4n using network byte order" is bad/confusing
> naming.

Other %p extensions that have R/r for "reversed" do not have any H/h part for
"host". That's why if we want reversed, than don't use the host, it should be
default. As I said, I think the best is to remove these for now,

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2025-04-22 15:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  6:47 [PATCH v4 0/3] Use proper printk format in appletbdrm Aditya Garg
2025-04-08  6:47 ` [PATCH v4 1/3] lib/vsprintf: Add support for generic FourCCs by extending %p4cc Aditya Garg
2025-04-08  6:49   ` [PATCH v4 3/3] drm/appletbdrm: use %p4cl instead of %p4cc Aditya Garg
2025-04-08 21:56   ` [PATCH v4 1/3] lib/vsprintf: Add support for generic FourCCs by extending %p4cc Kees Cook
2025-04-22  8:07   ` Geert Uytterhoeven
2025-04-22  8:29     ` Aditya Garg
2025-04-22  8:43       ` Geert Uytterhoeven
2025-04-22  9:41         ` Aditya Garg
2025-04-22 10:16         ` Andy Shevchenko
2025-04-22 10:32           ` Geert Uytterhoeven
2025-04-22 15:15             ` Aditya Garg
2025-04-22 15:22               ` Andy Shevchenko
2025-04-22 15:28                 ` Aditya Garg
2025-04-22 15:17             ` Andy Shevchenko [this message]
2025-04-23 13:39         ` Petr Mladek
2025-04-23 13:47           ` Aditya Garg
2025-04-23 14:50           ` Geert Uytterhoeven
2025-04-23 16:29             ` Andy Shevchenko
2025-04-23 17:46               ` Geert Uytterhoeven
2025-04-22 10:12     ` Andy Shevchenko
2025-04-22 10:20       ` Geert Uytterhoeven
2025-04-08  6:48 ` [PATCH v4 2/3] printf: add tests for generic FourCCs Aditya Garg
2025-04-08 21:56   ` Kees Cook
2025-04-08  8:41 ` [PATCH v4 0/3] Use proper printk format in appletbdrm Andy Shevchenko
2025-04-08  8:52   ` Aditya Garg
2025-04-08  9:38     ` Andy Shevchenko
2025-04-09 15:30       ` Petr Mladek
2025-04-17 13:53 ` Aditya Garg
2025-04-21 12:05   ` Alyssa Rosenzweig
2025-04-21 13:05     ` Aditya Garg
2025-04-21 13:07       ` Alyssa Rosenzweig
2025-04-21 13:08         ` Aditya Garg
2025-04-21 13:10           ` Aditya Garg
2025-04-21 13:49             ` Alyssa Rosenzweig
2025-04-21 13:54               ` Aditya Garg
2025-04-21 13:56                 ` Alyssa Rosenzweig
2025-04-21 13:58                   ` Aditya Garg
2025-04-21 14:30 ` Alyssa Rosenzweig

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=aAezGqdN9weTxv8_@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=admin@kodeit.net \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alyssa@rosenzweig.io \
    --cc=apw@canonical.com \
    --cc=asahi@lists.linux.dev \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dwaipayanray1@gmail.com \
    --cc=gargaditya08@live.com \
    --cc=geert@linux-m68k.org \
    --cc=joe@perches.com \
    --cc=kees@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lukas.bulwahn@gmail.com \
    --cc=marcan@marcan.st \
    --cc=mripard@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=simona@ffwll.ch \
    --cc=sven@svenpeter.dev \
    --cc=tamird@gmail.com \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®