Commit 7bfa122c authored by Julia Lawall's avatar Julia Lawall Committed by Paul Mundt

arch/sh/mm: Move a dereference below a NULL test

If the NULL test is necessary, then the dereference should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/).

// <smpl>
@disable is_null@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if (E == NULL) S
  f(...,E->fld,...);
- if (E == NULL) S

@@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if (!E) S
  f(...,E->fld,...);
- if (!E) S
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent f3b8436a
...@@ -71,9 +71,9 @@ void *__ioremap(unsigned long phys_addr, unsigned long size, ...@@ -71,9 +71,9 @@ void *__ioremap(unsigned long phys_addr, unsigned long size,
* Ok, go for it.. * Ok, go for it..
*/ */
area = get_vm_area(size, VM_IOREMAP); area = get_vm_area(size, VM_IOREMAP);
pr_debug("Get vm_area returns %p addr %p\n",area,area->addr);
if (!area) if (!area)
return NULL; return NULL;
pr_debug("Get vm_area returns %p addr %p\n", area, area->addr);
area->phys_addr = phys_addr; area->phys_addr = phys_addr;
addr = area->addr; addr = area->addr;
if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
......
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