x86: amd_iommu.c device_nb should be static
PATCH 1/1 x86: amd_iommu.c device_nb should be static
device_nb is used only by same file, it should be static.
Also fixed NULL pointer issue.
Fixed following sparse warnings :
arch/x86/kernel/amd_iommu.c:1195:23: warning: symbol 'device_nb' was not declared. Should it be static? arch/x86/kernel/amd_iommu.c:1766:10: warning: Using plain integer as NULL pointer
Signed-off-by Jaswinder Singh Rajput <[email protected]>
--- arch/x86/kernel/amd_iommu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/amd_iommu.c +2 -2
@@ -1192,7 +1192,7 @@ out:return 0 ; } -struct notifier_block device_nb = { +static struct notifier_block device_nb = { .notifier_call = device_change_notifier, };
@@ -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);
Signature · 1 line
1.6.0.6
[AMD-IOMMU] amd_iommu.c device_nb should be static
device_nb is used only by same file, it should be static.
Also fixed NULL pointer issue.
Fixed following sparse warnings :
arch/x86/kernel/amd_iommu.c:1195:23: warning: symbol 'device_nb' was not declared. Should it be static? arch/x86/kernel/amd_iommu.c:1766:10: warning: Using plain integer as NULL pointer
Signed-off-by Jaswinder Singh Rajput <[email protected]>
--- arch/x86/kernel/amd_iommu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/amd_iommu.c +2 -2
@@ -1192,7 +1192,7 @@ out:return 0 ; } -struct notifier_block device_nb = { +static struct notifier_block device_nb = { .notifier_call = device_change_notifier, };
@@ -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);
Signature · 1 line
1.6.0.6