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]
Date:   Thu, 27 Aug 2020 21:58:22 -0700
From:   Joe Perches <joe@...ches.com>
To:     Pekka Paalanen <ppaalanen@...il.com>,
        Algea Cao <algea.cao@...k-chips.com>
Cc:     mripard@...nel.org, tzimmermann@...e.de,
        linux-kernel@...r.kernel.org, airlied@...ux.ie,
        dri-devel@...ts.freedesktop.org, maarten.lankhorst@...ux.intel.com,
        daniel@...ll.ch, linux-rockchip@...ts.infradead.org
Subject: Re: Printing bitfields in the kernel (Re: [PATCH] drm: Parse
 Colorimetry data block from EDID)

On Thu, 2020-08-27 at 10:34 +0300, Pekka Paalanen wrote:
> On Wed, 26 Aug 2020 22:23:28 +0800
> Algea Cao <algea.cao@...k-chips.com> wrote:
> 
> > CEA 861.3 spec adds colorimetry data block for HDMI.
> > Parsing the block to get the colorimetry data from
> > panel.

If flags are int, I could imagine another %p<foo> extension
where %*p<foo> is used like:

	printk("flags: %*p<foo>n", flags, bitstrings)

where flags is:

	BIT(0)
	BIT(1)
	...
	BIT(last)

and

	char *bitstrings[] = {
		"bit 0 description",
		"bit 1 description",
		...
		"last bit description"
	};

Or define YA struct with 2 entries as the struct members
and use that.

struct foo {
	unsigned long flags,
	char ** descriptions,
};

	struct foo bar = {.flags = <flags> .descriptions = bitstrings};

	printk("flags: %p<foo>\n, &bar);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ