staging: r8188eu: use sizeof(*pvar) for allocating structs
authorRebecca Mckeever <remckee0@gmail.com>
Thu, 31 Mar 2022 17:16:04 +0000 (12:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 05:33:49 +0000 (07:33 +0200)
commita76d5a6e3dc11e97aae17f3f029dcc3f22d50c5b
tree12ebc1cdf87201a35ccc03a772c65155666f6769
parentacc24ef13ebdb893b2c348cbbaf508f96b1b40ca
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/YkXh1HBqaHwT38UC@bertie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme.c
drivers/staging/r8188eu/core/rtw_mlme_ext.c