提交 b0d6e097 编写于 作者: D Dan Carpenter 提交者: Mark Brown

spi: sprd-adi: silence an uninitialized variable warning

If of_get_property() fails then "size" is uninitialized and it leads to
a static checker warning:

    drivers/spi/spi-sprd-adi.c:288 sprd_adi_hw_init()
    error: uninitialized symbol 'size'.

We can silence the warning by re-arranging the order of these checks.
It obviously doesn't affect runtime at all.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 04063a01
......@@ -285,7 +285,7 @@ static void sprd_adi_hw_init(struct sprd_adi *sadi)
/* Set hardware channels setting */
list = of_get_property(np, "sprd,hw-channels", &size);
if (!size || !list) {
if (!list || !size) {
dev_info(sadi->dev, "no hw channels setting in node\n");
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册