From: Vinod Koul <vkoul@kernel.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dmaengine@vger.kernel.org, Hyun Kwon <hyun.kwon@xilinx.com>,
Michal Simek <michal.simek@xilinx.com>
Subject: Re: [PATCH 1/3] dmaengine: xilinx: dpdma: remove comparison of unsigned expression
Date: Wed, 22 Jul 2020 19:55:47 +0530 [thread overview]
Message-ID: <20200722142547.GQ12965@vkoul-mobl> (raw)
In-Reply-To: <20200722124458.GF5833@pendragon.ideasonboard.com>
On 22-07-20, 15:44, Laurent Pinchart wrote:
> Hi Vinod,
>
> Thank you for the patch.
>
> On Sat, Jul 18, 2020 at 07:21:59PM +0530, Vinod Koul wrote:
> > xilinx_dpdma_config() channel id is unsigned int and compares with
> > ZYNQMP_DPDMA_VIDEO0 which is zero, so remove this comparison
> >
> > drivers/dma/xilinx/xilinx_dpdma.c:1073:15: warning: comparison of
> > unsigned expression in ‘>= 0’ is always true [-Wtype-limits] if
> > (chan->id >= ZYNQMP_DPDMA_VIDEO0 && chan->id <= ZYNQMP_DPDMA_VIDEO2)
>
> I didn't see that warning, how do you produce it ?
I see it with gcc and W=1.
>
> > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> > ---
> > drivers/dma/xilinx/xilinx_dpdma.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c
> > index af88a6762ef4..8e602378f2dc 100644
> > --- a/drivers/dma/xilinx/xilinx_dpdma.c
> > +++ b/drivers/dma/xilinx/xilinx_dpdma.c
> > @@ -1070,7 +1070,7 @@ static int xilinx_dpdma_config(struct dma_chan *dchan,
> > * Abuse the slave_id to indicate that the channel is part of a video
> > * group.
> > */
> > - if (chan->id >= ZYNQMP_DPDMA_VIDEO0 && chan->id <= ZYNQMP_DPDMA_VIDEO2)
> > + if (chan->id <= ZYNQMP_DPDMA_VIDEO2)
>
> While this doesn't affect the behaviour, I'm worried about the risk of
> introducing bugs in the future if the ZYNQMP_DPDMA_VIDEO0 becomes
> non-zero. On the other hand, that's part of the DT ABI, so it shouldn't
> change. How about
>
> switch (chan->id) {
> case ZYNQMP_DPDMA_VIDEO0:
> case ZYNQMP_DPDMA_VIDEO1:
> case ZYNQMP_DPDMA_VIDEO2:
> chan->video_group = config->slave_id != 0;
> break;
> }
>
> instead ?
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Thanks
>
> > chan->video_group = config->slave_id != 0;
> >
> > spin_unlock_irqrestore(&chan->lock, flags);
>
> --
> Regards,
>
> Laurent Pinchart
--
~Vinod
prev parent reply other threads:[~2020-07-22 14:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-18 13:51 [PATCH 1/3] dmaengine: xilinx: dpdma: remove comparison of unsigned expression Vinod Koul
2020-07-18 13:52 ` [PATCH 2/3] dmaengine: xilinx: dpdma: add missing kernel doc Vinod Koul
2020-07-22 12:45 ` Laurent Pinchart
2020-07-18 13:52 ` [PATCH 3/3] dmaengine: xilinx: dpdma: fix kernel doc format Vinod Koul
2020-07-22 13:11 ` Laurent Pinchart
2020-07-22 14:26 ` Vinod Koul
2020-07-22 14:51 ` Laurent Pinchart
2020-07-22 14:54 ` Vinod Koul
2020-07-22 16:18 ` Laurent Pinchart
2020-07-22 12:44 ` [PATCH 1/3] dmaengine: xilinx: dpdma: remove comparison of unsigned expression Laurent Pinchart
2020-07-22 14:25 ` Vinod Koul [this message]
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=20200722142547.GQ12965@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=hyun.kwon@xilinx.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=michal.simek@xilinx.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