]> git.baikalelectronics.ru Git - kernel.git/commit
staging: r8188eu: use sizeof(*pvar) for allocating structs
authorRebecca Mckeever <remckee0@gmail.com>
Wed, 6 Apr 2022 08:31:00 +0000 (03:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Apr 2022 17:52:12 +0000 (19:52 +0200)
commit0f8180e737cf8dbe9b50a89df5f9db9d997d6cb8
tree65c79ae5d3c3d953f68875c5f0ec4fad22bbdb5e
parentb27454446fd94c52fe9cf9effcd5c336ec12d4d9
staging: r8188eu: use sizeof(*pvar) for allocating structs

Use sizeof(*pvar) instead of sizeof(struct var) when allocating memory.
This conforms to Linux kernel coding style, improves readability,
and decreases the opportunity for bugs if the pointer variable type is
changed. Issue found by checkpatch messages of the following format:

CHECK: Prefer kzalloc(sizeof(*pvar)...) over kzalloc(sizeof(struct var)...)

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/5b526d8c178d89328de935ff4ff57651bdd8379b.1649233201.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_cmd.c