diff options
author | Julia Lawall <julia@diku.dk> | 2009-11-22 13:11:16 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-11-22 13:24:32 -0500 |
commit | 20e11c2d1c8ca49829ee9e5690adc89488e5da31 (patch) | |
tree | 621be172dfa44ee49052b97ae8913ac41e62d317 /arch/arm/plat-omap | |
parent | 13a032295710b49d331bb53086a7de4557243851 (diff) |
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/):
// <smpl>
@match exists@
expression x, E;
identifier fld;
@@
* x->fld
... when != \(x = E\|&x\)
* x == NULL
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 544772ede470..936aef1971cd 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, | |||
446 | struct scatterlist *sg; | 446 | struct scatterlist *sg; |
447 | u32 da = new->da_start; | 447 | u32 da = new->da_start; |
448 | 448 | ||
449 | if (!obj || !new || !sgt) | 449 | if (!obj || !sgt) |
450 | return -EINVAL; | 450 | return -EINVAL; |
451 | 451 | ||
452 | BUG_ON(!sgtable_ok(sgt)); | 452 | BUG_ON(!sgtable_ok(sgt)); |