mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02: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:
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],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user