[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231108201905.GCZUvtOSDkVqFPBmfk@fat_crate.local>
Date: Wed, 8 Nov 2023 21:19:05 +0100
From: Borislav Petkov <bp@...en8.de>
To: Avadhut Naik <avadhut.naik@....com>
Cc: linux-acpi@...r.kernel.org, rafael@...nel.org, lenb@...nel.org,
james.morse@....com, tony.luck@...el.com,
gregkh@...uxfoundation.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, alexey.kardashevskiy@....com,
yazen.ghannam@....com, avadnaik@....com
Subject: Re: [RESEND v5 1/4] ACPI: APEI: EINJ: Refactor
available_error_type_show()
On Tue, Nov 07, 2023 at 03:36:44PM -0600, Avadhut Naik wrote:
> +static struct { u32 mask; const char *str; } const einj_error_type_string[] = {
> + {BIT(0), "Processor Correctable"},
> + {BIT(1), "Processor Uncorrectable non-fatal"},
> + {BIT(2), "Processor Uncorrectable fatal"},
> + {BIT(3), "Memory Correctable"},
> + {BIT(4), "Memory Uncorrectable non-fatal"},
> + {BIT(5), "Memory Uncorrectable fatal"},
> + {BIT(6), "PCI Express Correctable"},
> + {BIT(7), "PCI Express Uncorrectable non-fatal"},
> + {BIT(8), "PCI Express Uncorrectable fatal"},
> + {BIT(9), "Platform Correctable"},
> + {BIT(10), "Platform Uncorrectable non-fatal"},
> + {BIT(11), "Platform Uncorrectable fatal"},
> + {BIT(12), "CXL.cache Protocol Correctable"},
> + {BIT(13), "CXL.cache Protocol Uncorrectable non-fatal"},
> + {BIT(14), "CXL.cache Protocol Uncorrectable fatal"},
> + {BIT(15), "CXL.mem Protocol Correctable"},
> + {BIT(16), "CXL.mem Protocol Uncorrectable non-fatal"},
> + {BIT(17), "CXL.mem Protocol Uncorrectable fatal"},
Might as well put spaces between the '{' and '}' brackets for better
readability.
> static int available_error_type_show(struct seq_file *m, void *v)
> @@ -607,8 +607,9 @@ static int available_error_type_show(struct seq_file *m, void *v)
> if (rc)
> return rc;
> for (int pos = 0; pos < ARRAY_SIZE(einj_error_type_string); pos++)
> - if (available_error_type & BIT(pos))
> - seq_puts(m, einj_error_type_string[pos]);
> + if (available_error_type & einj_error_type_string[pos].mask)
Call that variable simply "error_type". Those are simple functions, one
can see that it is the available error type.
> + seq_printf(m, "0x%08x\t%s\n", einj_error_type_string[pos].mask,
> + einj_error_type_string[pos].str);
>
> return 0;
But those are just nitpicks.
Reviewed-by: Borislav Petkov (AMD) <bp@...en8.de>
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists