Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1443456 > unrolled thread
| Started by | Kedareswara rao Appana <appana.durga.rao@xilinx.com> |
|---|---|
| First post | 2016-07-14 15:40 +0200 |
| Last post | 2016-07-24 07:50 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v2] dmaengine: zynqmp_dma: Fix static checker warning Kedareswara rao Appana <appana.durga.rao@xilinx.com> - 2016-07-14 15:40 +0200
Re: [PATCH v2] dmaengine: zynqmp_dma: Fix static checker warning Dan Carpenter <dan.carpenter@oracle.com> - 2016-07-14 15:50 +0200
Re: [PATCH v2] dmaengine: zynqmp_dma: Fix static checker warning Vinod Koul <vinod.koul@intel.com> - 2016-07-24 07:50 +0200
| From | Kedareswara rao Appana <appana.durga.rao@xilinx.com> |
|---|---|
| Date | 2016-07-14 15:40 +0200 |
| Subject | [PATCH v2] dmaengine: zynqmp_dma: Fix static checker warning |
| Message-ID | <rUP1T-1Qz-9@gated-at.bofh.it> |
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 ||?
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
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(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index f777a5b..b18d51f 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -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);
--
1.7.1
[toc] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-07-14 15:50 +0200 |
| Message-ID | <rUPbA-1TY-3@gated-at.bofh.it> |
| In reply to | #1443456 |
Looks good. Thanks! regards, dan carpenter
[toc] | [prev] | [next] | [standalone]
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Date | 2016-07-24 07:50 +0200 |
| Message-ID | <rYksx-3WL-3@gated-at.bofh.it> |
| In reply to | #1443456 |
On Thu, Jul 14, 2016 at 07:00:55PM +0530, Kedareswara rao Appana wrote: > 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 -- ~Vinod
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web