mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 03:35:32 -04:00
powerpc/pseries: Simplify attribute description check in papr_init()
Check only the first byte instead of scanning the entire string with strnlen(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260626110718.4367-2-thorsten.blum@linux.dev
This commit is contained in:
committed by
Madhavan Srinivasan
parent
c7b7cea42c
commit
7cc3d3fdc9
@@ -323,12 +323,8 @@ static int __init papr_init(void)
|
||||
}
|
||||
|
||||
for (idx = 0; idx < num_attrs; idx++) {
|
||||
bool show_val_desc = true;
|
||||
|
||||
/* Do not add the value desc attr if it does not exist */
|
||||
if (strnlen(esi_attrs[idx].value_desc,
|
||||
sizeof(esi_attrs[idx].value_desc)) == 0)
|
||||
show_val_desc = false;
|
||||
bool show_val_desc = *esi_attrs[idx].value_desc != '\0';
|
||||
|
||||
if (add_attr_group(be64_to_cpu(esi_attrs[idx].id),
|
||||
&papr_groups[idx],
|
||||
|
||||
Reference in New Issue
Block a user