]> git.baikalelectronics.ru Git - kernel.git/commit
can: kvaser_usb: kvaser_usb_hydra: Use kzalloc for allocating only one element
authorKenneth Lee <klee33@uw.edu>
Sun, 7 Aug 2022 05:16:56 +0000 (22:16 -0700)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 5 Sep 2022 20:00:42 +0000 (22:00 +0200)
commit20b86eb1bcd5816e20d11ba3376f11aeaf6f73ce
tree0c5e466b3e53662bac649c3387fb3d49bd0803de
parentc624799bd22ac7ef2eff136065c54fef85767dbd
can: kvaser_usb: kvaser_usb_hydra: Use kzalloc for allocating only one element

Use kzalloc(...) rather than kcalloc(1, ...) since because the number of
elements we are specifying in this case is 1, kzalloc would accomplish the
same thing and we can simplify. Also refactor how we calculate the sizeof()
as checkstyle for kzalloc() prefers using the variable we are assigning
to versus the type of that variable for calculating the size to allocate.

Signed-off-by: Kenneth Lee <klee33@uw.edu>
Link: https://lore.kernel.org/all/20220807051656.1991446-1-klee33@uw.edu
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c