[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <97a875be-3ebc-4d73-a4f1-2633b28b1111@amd.com>
Date: Thu, 16 Nov 2023 15:46:45 -0600
From: Avadhut Naik <avadnaik@....com>
To: Borislav Petkov <bp@...en8.de>, 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
Subject: Re: [RESEND v5 1/4] ACPI: APEI: EINJ: Refactor
available_error_type_show()
Hi,
On 11/8/2023 14:19, Borislav Petkov wrote:
> 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>
>
Thanks for reviewing. Will address this in v6.
> Thx.
>
--
Thanks,
Avadhut Naik
Powered by blists - more mailing lists