lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAdrkxhHaEpdl05d@smile.fi.intel.com>
Date: Tue, 22 Apr 2025 13:12:35 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
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

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?

> > +       %p4cl   00Pg (0x30305067)
> > +       %p4cb   gP00 (0x67503030)

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ