summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-09-22 22:48:08 +0200
committerMark Brown <broonie@kernel.org>2017-09-25 18:09:44 +0200
commitb0d6e097b922ac7f538623c52794d9d63d6ee378 (patch)
tree09fbbd7b76de5daf5ec73b85db9cd514ba714cfb
parentspi: sprd-adi: checking for NULL instead of IS_ERR() (diff)
downloadlinux-b0d6e097b922ac7f538623c52794d9d63d6ee378.tar.xz
linux-b0d6e097b922ac7f538623c52794d9d63d6ee378.zip
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-sprd-adi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index bff6ef1caad7..1324463244d3 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -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;
}