From: Julia Lawall Date: Sun, 22 Nov 2009 18:11:16 +0000 (-0800) Subject: arch/arm/plat-omap: Drop an unnecessary NULL test X-Git-Tag: v2.6.33-rc1~381^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20e11c2d1c8ca49829ee9e5690adc89488e5da31;p=platform%2Fupstream%2Fkernel-adaptation-pc.git arch/arm/plat-omap: Drop an unnecessary NULL test map_iovm_area is only called from a context where its second argument is known not to be NULL, so drop the unnecessary test. If new could be NULL, the initialization of da should be moved below the test. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld ... when != \(x = E\|&x\) * x == NULL // Signed-off-by: Julia Lawall Cc: Russell King Cc: Hiroshi DOYU Signed-off-by: Tony Lindgren Signed-off-by: Andrew Morton --- diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 544772e..936aef1 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c @@ -446,7 +446,7 @@ static int map_iovm_area(struct iommu *obj, struct iovm_struct *new, struct scatterlist *sg; u32 da = new->da_start; - if (!obj || !new || !sgt) + if (!obj || !sgt) return -EINVAL; BUG_ON(!sgtable_ok(sgt));