[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVu33wTjgAHUXdaLFvgnCqMzXGZkcc7i4iug0QP=-WkLA@mail.gmail.com>
Date: Tue, 22 Apr 2025 12:20:38 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Aditya Garg <gargaditya08@...e.com>, Hector Martin <marcan@...can.st>, alyssa@...enzweig.io,
Petr Mladek <pmladek@...e.com>, Sven Peter <sven@...npeter.dev>,
Thomas Zimmermann <tzimmermann@...e.de>, Aun-Ali Zaidi <admin@...eit.net>,
Maxime Ripard <mripard@...nel.org>, airlied@...hat.com, Simona Vetter <simona@...ll.ch>,
Steven Rostedt <rostedt@...dmis.org>, Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>, Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>, apw@...onical.com, joe@...ches.com,
dwaipayanray1@...il.com, lukas.bulwahn@...il.com, Kees Cook <kees@...nel.org>,
tamird@...il.com, Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dri-devel@...ts.freedesktop.org, linux-doc@...r.kernel.org,
Asahi Linux Mailing List <asahi@...ts.linux.dev>
Subject: Re: [PATCH v4 1/3] lib/vsprintf: Add support for generic FourCCs by
extending %p4cc
Hi Andy,
On Tue, 22 Apr 2025 at 12:12, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> On Tue, Apr 22, 2025 at 10:07:33AM +0200, Geert Uytterhoeven wrote:
> > On Tue, 8 Apr 2025 at 08:48, Aditya Garg <gargaditya08@...e.com> wrote:
>
> ...
>
> > > +Generic FourCC code
> > > +-------------------
> > > +
> > > +::
> > > + %p4c[hnlb] gP00 (0x67503030)
> > > +
> > > +Print a generic FourCC code, as both ASCII characters and its numerical
> > > +value as hexadecimal.
> > > +
> > > +The generic FourCC code is always printed in the big-endian format,
> > > +the most significant byte first. This is the opposite of V4L/DRM FourCCs.
> > > +
> > > +The additional ``h``, ``n``, ``l``, and ``b`` specifiers define what
> > > +endianness is used to load the stored bytes. The data might be interpreted
> > > +using the host byte order, network byte order, little-endian, or big-endian.
> > > +
> > > +Passed by reference.
> > > +
> > > +Examples for a little-endian machine, given &(u32)0x67503030::
> > > +
> > > + %p4ch gP00 (0x67503030)
> > > + %p4cn 00Pg (0x30305067)
> > > + %p4cl gP00 (0x67503030)
> > > + %p4cb 00Pg (0x30305067)
> > > +
> > > +Examples for a big-endian machine, given &(u32)0x67503030::
> > > +
> > > + %p4ch gP00 (0x67503030)
> > > + %p4cn 00Pg (0x30305067)
> >
> > This doesn't look right to me, as network byte order is big endian?
> > Note that I didn't check the code.
>
> Yes, network is big endian and this seems right to me. What is the confusion?
On a big-endian machine, it should print 0x67503030, like the host
or explicit big-endian output.
> > > + %p4cl 00Pg (0x30305067)
> > > + %p4cb gP00 (0x67503030)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists