kernel/rh_messages.c: gcc12 warning on redundant NULL test
Upstream Status: RHEL only
Bugzilla: https://bugzilla.redhat.com/2142658
mod->name is embedded in the struct module. No need to test for NULL.
kernel/rh_messages.c: In function ‘mark_tech_preview’:
kernel/rh_messages.c:166:22: warning: the comparison will always evaluate as ‘true’ for the address of ‘name’ will never be NULL [-Waddress]
166 | else if (mod && mod->name)
| ^~
In file included from kernel/rh_messages.c:2:
./include/linux/module.h:371:14: note: ‘name’ declared here
371 | char name[MODULE_NAME_LEN];
| ^~~~
Signed-off-by: Eric Chanudet echanude@redhat.com
Edited by Eric Chanudet