]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc4eab0e26637ef37bc3b58709d08d02d75bae2d5
tree12ebc1cdf87201a35ccc03a772c65155666f6769
parent081eed959d81ecba2c41c4f82c41def49d024674
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