Skip to content

Commit c680c6a

Browse files
tititiou36brgl
authored andcommitted
gpio: sim: Use correct order for the parameters of devm_kcalloc()
We should have 'n', then 'size', not the opposite. This is harmless because the 2 values are just multiplied, but having the correct order silence a (unpublished yet) smatch warning. Fixes: cb8c474 ("gpio: sim: new testing module") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 7869b48 commit c680c6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-sim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ static int gpio_sim_setup_sysfs(struct gpio_sim_chip *chip)
314314

315315
for (i = 0; i < num_lines; i++) {
316316
attr_group = devm_kzalloc(dev, sizeof(*attr_group), GFP_KERNEL);
317-
attrs = devm_kcalloc(dev, sizeof(*attrs),
318-
GPIO_SIM_NUM_ATTRS, GFP_KERNEL);
317+
attrs = devm_kcalloc(dev, GPIO_SIM_NUM_ATTRS, sizeof(*attrs),
318+
GFP_KERNEL);
319319
val_attr = devm_kzalloc(dev, sizeof(*val_attr), GFP_KERNEL);
320320
pull_attr = devm_kzalloc(dev, sizeof(*pull_attr), GFP_KERNEL);
321321
if (!attr_group || !attrs || !val_attr || !pull_attr)

0 commit comments

Comments
 (0)