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)
commit808d5dbeec7863db7c85217dafee02203a4bec94
tree65c79ae5d3c3d953f68875c5f0ec4fad22bbdb5e
parentcb9d73dbe2376600d2cfcc262d972e44cbe0a3c2
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