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)
commit00784da3e6b8c1f0e58d813272503d014de8f64b
tree0c5e466b3e53662bac649c3387fb3d49bd0803de
parentddbbed25309f1cd0079e5b099748568842a5ec2b
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