Skip to contentSkip to conversation

dmaengine: zynqmp_dma: Fix static checker warning

PATCH Applied Kedareswara rao Appana 3 participants 3 messages Jul 14, 2016 – Jul 24, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dmaengine: zynqmp_dma: Fix static checker warning

This patch fixes the below static checker warning drivers/dma/xilinx/zynqmp_dma.c:973 zynqmp_dma_chan_probe()

        warn: was && intended here instead of ||?

---
Changes for v2:
---> Return EINVAL instead of err as suggested by Dan.

 drivers/dma/xilinx/zynqmp_dma.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
drivers/dma/xilinx/zynqmp_dma.c +8 -3
index f777a5b..b18d51f 100644
@@ -970,12 +970,17 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
 	chan->dst_burst_len = ZYNQMP_DMA_AWLEN_RST_VAL;
 	chan->src_burst_len = ZYNQMP_DMA_ARLEN_RST_VAL;
 	err = of_property_read_u32(node, "xlnx,bus-width", &chan->bus_width);
-	if ((err < 0) && ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) ||
-			  (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128))) {
-		dev_err(zdev->dev, "invalid bus-width value");
+	if (err < 0) {
+		dev_err(&pdev->dev, "missing xlnx,bus-width property\n");
 		return err;
 	}
 
+	if (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64 &&
+	    chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128) {
+		dev_err(zdev->dev, "invalid bus-width value");
+		return -EINVAL;
+	}
+
 	chan->is_dmacoherent =  of_property_read_bool(node, "dma-coherent");
 	zdev->chan = chan;
 	tasklet_init(&chan->tasklet, zynqmp_dma_do_tasklet, (ulong)chan);
Signature · 1 line
1.7.1
Applied
#2 lore raw
In reply to Kedareswara rao Appana
Quoted 3 lines · Kedareswara rao Appana

This patch fixes the below static checker warning drivers/dma/xilinx/zynqmp_dma.c:973 zynqmp_dma_chan_probe()

        warn: was && intended here instead of ||?

Applied, thanks

Signature · 1 line
~Vinod