Commit 39a85bcb authored by Colin Ian King's avatar Colin Ian King Committed by Lee Jones

mfd: omap-usb-tll: Fix cppcheck sizeof warning

Static analysis from cppcheck issued the following warning:

[drivers/mfd/omap-usb-tll.c:255]: (warning) Found calculation
  inside sizeof().

The current size calculation is not obvious and is easy to
miscomprehend, so re-work the size of the allocation based
on the size of the struct pointer and quantity to allocate.
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 0414855f
......@@ -252,7 +252,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)
break;
}
tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk * [tll->nch]),
tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
GFP_KERNEL);
if (!tll->ch_clk) {
ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment