MLK-11911-6 mxc IPUv3: Minor improvement for _ipu_is_smfc_chan()
authorLiu Ying <Ying.Liu@freescale.com>
Thu, 26 Nov 2015 08:33:58 +0000 (16:33 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:17 +0000 (14:49 -0500)
A minor improvement for _ipu_is_smfc_chan() to address the following
issue reported by Coverity:
Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an
unsigned value is always true. dma_chan >= 0U.
return ((dma_chan >= 0) && (dma_chan <= 3));

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/mxc/ipu3/ipu_prv.h

index 0a77b58..025a7bd 100644 (file)
@@ -168,7 +168,7 @@ enum ipu_dmfc_type {
 
 static inline int _ipu_is_smfc_chan(uint32_t dma_chan)
 {
-       return ((dma_chan >= 0) && (dma_chan <= 3));
+       return dma_chan <= 3;
 }
 
 static inline u32 ipu_cm_read(struct ipu_soc *ipu, unsigned offset)