[PATCH v5 1/2] imx-drm: ipu-dmfc: Remove unneeded 'dmfc' check

Fabio Estevam festevam at gmail.com
Fri Feb 28 14:39:41 UTC 2014


From: Fabio Estevam <fabio.estevam at freescale.com>

Fix the following static checker warning:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: variable dereferenced before check 'dmfc' (see line 157)

As 'dmfc' could never be null, there is no need to do such check.

Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
Changes since v4:
- Remove the check instead of moving it earlier

 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
index 98070dd..4521301 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
@@ -161,9 +161,6 @@ static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
 			"dmfc: using %d slots starting from segment %d for IPU channel %d\n",
 			slots, segment, dmfc->data->ipu_channel);
 
-	if (!dmfc)
-		return -EINVAL;
-
 	switch (slots) {
 	case 1:
 		field = DMFC_FIFO_SIZE_64;
-- 
1.8.1.2



More information about the devel mailing list