The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] drivers/dma: Fix unsigned compared against 0
@ 2024-10-05  9:34 Advait Dhamorikar
  2024-10-14 18:16 ` Vinod Koul
  2024-10-14 18:32 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Advait Dhamorikar @ 2024-10-05  9:34 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dmaengine, linux-kernel, skhan, anupnewsmail, Advait Dhamorikar

An unsigned value can never be negative,
so this test will always evaluate the same way.
In ep93xx_dma_alloc_chan_resources: An unsigned dma_cfg.port's
value is checked against EP93XX_DMA_I2S1 which is 0.

Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
---
 drivers/dma/ep93xx_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index 995427afe077..6d7f6bd12d76 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -929,8 +929,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
 
 	/* Sanity check the channel parameters */
 	if (!edmac->edma->m2m) {
-		if (edmac->dma_cfg.port < EP93XX_DMA_I2S1 ||
-		    edmac->dma_cfg.port > EP93XX_DMA_IRDA)
+		if (edmac->dma_cfg.port > EP93XX_DMA_IRDA)
 			return -EINVAL;
 		if (edmac->dma_cfg.dir != ep93xx_dma_chan_direction(chan))
 			return -EINVAL;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-14 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-05  9:34 [PATCH] drivers/dma: Fix unsigned compared against 0 Advait Dhamorikar
2024-10-14 18:16 ` Vinod Koul
2024-10-14 18:32 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox