Skip to content
Commit 00784da3 authored by Kenneth Lee's avatar Kenneth Lee Committed by Marc Kleine-Budde
Browse files

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: default avatarKenneth Lee <klee33@uw.edu>
Link: https://lore.kernel.org/all/20220807051656.1991446-1-klee33@uw.edu


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent ddbbed25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment