Skip to content

Commit

Permalink
x86: Mark device_nb as static and fix NULL noise
Browse files Browse the repository at this point in the history
This sparse warning:

  arch/x86/kernel/amd_iommu.c:1195:23: warning: symbol 'device_nb' was not declared. Should it be static?

triggers because device_nb is global but is only used in a
single .c file. change device_nb to static to fix that - this
also addresses the sparse warning.

This sparse warning:

  arch/x86/kernel/amd_iommu.c:1766:10: warning: Using plain integer as NULL pointer

triggers because plain integer 0 is used in place of a NULL
pointer. change 0 to NULL to fix that - this also address the
sparse warning.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>
LKML-Reference: <1246458194.6940.20.camel@hpdv5.satnam>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jaswinder Singh Rajput authored and Ingo Molnar committed Jul 1, 2009
1 parent 4497399 commit b25ae67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ static int device_change_notifier(struct notifier_block *nb,
return 0;
}

struct notifier_block device_nb = {
static struct notifier_block device_nb = {
.notifier_call = device_change_notifier,
};

Expand Down Expand Up @@ -1763,7 +1763,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
flag |= __GFP_ZERO;
virt_addr = (void *)__get_free_pages(flag, get_order(size));
if (!virt_addr)
return 0;
return NULL;

paddr = virt_to_phys(virt_addr);

Expand Down

0 comments on commit b25ae67

Please sign in to comment.