Skip to content

Commit

Permalink
spi: intel: Use correct order for the parameters of devm_kcalloc()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/d114558dd0351b863ced8cc01b31754a5a4b960d.1653116362.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Mark Brown committed Jun 6, 2022
1 parent dd9c232 commit 1f19a2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,8 @@ static int intel_spi_populate_chip(struct intel_spi *ispi)
return -ENOMEM;

pdata->nr_parts = 1;
pdata->parts = devm_kcalloc(ispi->dev, sizeof(*pdata->parts),
pdata->nr_parts, GFP_KERNEL);
pdata->parts = devm_kcalloc(ispi->dev, pdata->nr_parts,
sizeof(*pdata->parts), GFP_KERNEL);
if (!pdata->parts)
return -ENOMEM;

Expand Down

0 comments on commit 1f19a2d

Please sign in to comment.