* [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
@ 2016-07-13 10:42 ` Kedareswara rao Appana
0 siblings, 0 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2016-07-13 10:42 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
drivers/dma/xilinx/zynqmp_dma.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index f777a5b..2248704 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -970,8 +970,13 @@ 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))) {
+ 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 err;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
@ 2016-07-13 10:42 ` Kedareswara rao Appana
0 siblings, 0 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2016-07-13 10:42 UTC (permalink / raw)
To: dan.j.williams, vinod.koul, michal.simek, soren.brinkmann,
appanad, arnd, dan.carpenter
Cc: dmaengine, linux-arm-kernel, linux-kernel
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>
---
drivers/dma/xilinx/zynqmp_dma.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index f777a5b..2248704 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -970,8 +970,13 @@ 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))) {
+ 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 err;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
2016-07-13 10:42 ` Kedareswara rao Appana
@ 2016-07-13 11:31 ` Dan Carpenter
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-07-13 11:31 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 13, 2016 at 04:12:16PM +0530, Kedareswara rao Appana wrote:
> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
> index f777a5b..2248704 100644
> --- a/drivers/dma/xilinx/zynqmp_dma.c
> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> @@ -970,8 +970,13 @@ 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))) {
> + if (err < 0) {
> + dev_err(&pdev->dev, "missing xlnx,bus-width property\n");
> + return err;
> + }
> +
> + if ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) ||
This has to be an && because it can never be both widths. You didn't
test this patch. Also too many parenthesis (you're thinking of LISP).
> + (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128)) {
> dev_err(zdev->dev, "invalid bus-width value");
> return err;
This has to be a negative error code.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
@ 2016-07-13 11:31 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-07-13 11:31 UTC (permalink / raw)
To: Kedareswara rao Appana
Cc: dan.j.williams, vinod.koul, michal.simek, soren.brinkmann,
appanad, arnd, dmaengine, linux-arm-kernel, linux-kernel
On Wed, Jul 13, 2016 at 04:12:16PM +0530, Kedareswara rao Appana wrote:
> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
> index f777a5b..2248704 100644
> --- a/drivers/dma/xilinx/zynqmp_dma.c
> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> @@ -970,8 +970,13 @@ 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))) {
> + if (err < 0) {
> + dev_err(&pdev->dev, "missing xlnx,bus-width property\n");
> + return err;
> + }
> +
> + if ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) ||
This has to be an && because it can never be both widths. You didn't
test this patch. Also too many parenthesis (you're thinking of LISP).
> + (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128)) {
> dev_err(zdev->dev, "invalid bus-width value");
> return err;
This has to be a negative error code.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
2016-07-13 11:31 ` Dan Carpenter
@ 2016-07-13 12:00 ` Appana Durga Kedareswara Rao
-1 siblings, 0 replies; 6+ messages in thread
From: Appana Durga Kedareswara Rao @ 2016-07-13 12:00 UTC (permalink / raw)
To: linux-arm-kernel
Hi Dan,
Thanks for the review...
> On Wed, Jul 13, 2016 at 04:12:16PM +0530, Kedareswara rao Appana wrote:
> > diff --git a/drivers/dma/xilinx/zynqmp_dma.c
> > b/drivers/dma/xilinx/zynqmp_dma.c index f777a5b..2248704 100644
> > --- a/drivers/dma/xilinx/zynqmp_dma.c
> > +++ b/drivers/dma/xilinx/zynqmp_dma.c
> > @@ -970,8 +970,13 @@ 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))) {
> > + if (err < 0) {
> > + dev_err(&pdev->dev, "missing xlnx,bus-width property\n");
> > + return err;
> > + }
> > +
> > + if ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) ||
>
> This has to be an && because it can never be both widths. You didn't test this
> patch. Also too many parenthesis (you're thinking of LISP).
Will fix in the next version...
>
> > + (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128)) {
> > dev_err(zdev->dev, "invalid bus-width value");
> > return err;
>
> This has to be a negative error code.
Will fix in the next version...
Regards,
Kedar.
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
@ 2016-07-13 12:00 ` Appana Durga Kedareswara Rao
0 siblings, 0 replies; 6+ messages in thread
From: Appana Durga Kedareswara Rao @ 2016-07-13 12:00 UTC (permalink / raw)
To: Dan Carpenter
Cc: dan.j.williams@intel.com, vinod.koul@intel.com, Michal Simek,
Soren Brinkmann, arnd@arndb.de, dmaengine@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Hi Dan,
Thanks for the review...
> On Wed, Jul 13, 2016 at 04:12:16PM +0530, Kedareswara rao Appana wrote:
> > diff --git a/drivers/dma/xilinx/zynqmp_dma.c
> > b/drivers/dma/xilinx/zynqmp_dma.c index f777a5b..2248704 100644
> > --- a/drivers/dma/xilinx/zynqmp_dma.c
> > +++ b/drivers/dma/xilinx/zynqmp_dma.c
> > @@ -970,8 +970,13 @@ 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))) {
> > + if (err < 0) {
> > + dev_err(&pdev->dev, "missing xlnx,bus-width property\n");
> > + return err;
> > + }
> > +
> > + if ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) ||
>
> This has to be an && because it can never be both widths. You didn't test this
> patch. Also too many parenthesis (you're thinking of LISP).
Will fix in the next version...
>
> > + (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128)) {
> > dev_err(zdev->dev, "invalid bus-width value");
> > return err;
>
> This has to be a negative error code.
Will fix in the next version...
Regards,
Kedar.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-13 12:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-13 10:42 [PATCH] dmaengine: zynqmp_dma: Fix static checker warning Kedareswara rao Appana
2016-07-13 10:42 ` Kedareswara rao Appana
2016-07-13 11:31 ` Dan Carpenter
2016-07-13 11:31 ` Dan Carpenter
2016-07-13 12:00 ` Appana Durga Kedareswara Rao
2016-07-13 12:00 ` Appana Durga Kedareswara Rao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.