Commit 20e11c2d authored by Julia Lawall's avatar Julia Lawall Committed by Tony Lindgren
Browse files

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 (


// <smpl>
@match exists@
expression x, E;
identifier fld;

* x->fld
  ... when != \(x = E\|&x\)
* x == NULL
// </smpl>
Signed-off-by: default avatarJulia Lawall <>
Cc: Russell King <>
Cc: Hiroshi DOYU <>
Signed-off-by: default avatarTony Lindgren <>
Signed-off-by: default avatarAndrew Morton <>
parent 13a03229
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment