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: <aQMVivr15od8Mpct@smile.fi.intel.com>
Date: Thu, 30 Oct 2025 09:36:42 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Feng Tang <feng.tang@...ux.alibaba.com>
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
	Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH v2 3/6] panic: sys_info: Replace struct sys_info_name
 with plain array of strings

On Thu, Oct 30, 2025 at 10:01:49AM +0800, Feng Tang wrote:
> On Wed, Oct 29, 2025 at 12:07:38PM +0100, Andy Shevchenko wrote:
> > There is no need to keep a custom structure just for the need of
> > a plain array of strings. Replace struct sys_info_name with plain
> > array of strings.
> > 
> > With that done, simplify the code, in particular, naturally use
> > for_each_set_bit() when iterating over si_bits_global bitmap.

...

> >  		names[0] = '\0';
> > -		for (i = 0; i < ARRAY_SIZE(si_names); i++) {
> > -			if (si_bits & si_names[i].bit) {
> > -				len += scnprintf(names + len, sizeof(names) - len,
> > -					"%s%s", delim, si_names[i].name);
> > -				delim = ",";
> > -			}
> > +		for_each_set_bit(i, &si_bits, ARRAY_SIZE(si_names)) {
> > +			len += scnprintf(names + len, sizeof(names) - len,
> > +					 "%s%s", delim, si_names[i]);
> > +			delim = ",";
> 
> For SYS_INFO_PANIC_CONSOLE_REPLAY bit, it is a NULL string, no need for
> an extra ','?

If you look closer to the original code, the behaviour is the same. Feel free
to update behaviour separately as I tried to keep the functionality to be not
changed with my series (with the exceptions of the fetching issue).

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ