From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
Cc: dan.j.williams@intel.com, vinod.koul@intel.com,
michal.simek@xilinx.com, soren.brinkmann@xilinx.com,
appanad@xilinx.com, arnd@arndb.de, dmaengine@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: zynqmp_dma: Fix static checker warning
Date: Wed, 13 Jul 2016 14:31:01 +0300 [thread overview]
Message-ID: <20160713113101.GU32247@mwanda> (raw)
In-Reply-To: <1468406536-6350-1-git-send-email-appanad@xilinx.com>
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
next prev parent reply other threads:[~2016-07-13 11:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 10:42 [PATCH] dmaengine: zynqmp_dma: Fix static checker warning Kedareswara rao Appana
2016-07-13 11:31 ` Dan Carpenter [this message]
2016-07-13 12:00 ` Appana Durga Kedareswara Rao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160713113101.GU32247@mwanda \
--to=dan.carpenter@oracle.com \
--cc=appana.durga.rao@xilinx.com \
--cc=appanad@xilinx.com \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=soren.brinkmann@xilinx.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox