davidker / unisys

Master repository for new changes to drivers/staging/unisys and drivers/visorbus
Other
2 stars 1 forks source link

checkpatch: `WARNING: char * array declaration might be better as static const` #11

Closed selltc closed 8 years ago

selltc commented 8 years ago
drivers/staging/unisys/visorbus/visorchipset.c:1453: WARNING: char * array declaration might be better as static const
drivers/staging/unisys/visorbus/visorchipset.c:1603: WARNING: char * array declaration might be better as static const
selltc commented 8 years ago

This checkpatch warning is bogus. They canNOT be a static const as the warning message recommends, because both cases are assigning the entries in the array to pointers on the stack, which eliminates the possibility of "static". The pointers HAVE to be on the stack, because the values they point to are dynamically built within the functions. If that's not enough, almost every kernel invocation of kobject_uevent_env() does it exactly the same way we are doing it, and gets the same checkpatch warning. Nobody else was able to pull off any type of "static const" trick.

I think that's enough ammunition to close this one.