Re: [PATCH v5 5/5] x86/CPU/AMD: Print the reason for the last reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 30, 2025 at 02:17:43PM -0500, Mario Limonciello wrote:
> Well with that approach once you got a known bit set you broke the loop and
> would print a message for that known bit.  But if you have two bits set you
> either need another loop or you only get one message print.

So I gather you want to print for *each* set bit?

If so:

	for (i = 0; i <= ARRAY_SIZE(s5_reset_reason_txt); i++) {
		if (!(value & BIT(i)))
			continue;

		if (s5_reset_reason_txt[i])
			pr_info(...);
	}

Still a lot easier instead of calling some function and dealing with from
which bit to start etc etc.


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux