Skip to contentSkip to conversation

some sparse fixes

PATCH New Ben Dooks 1 participant 4 messages Jul 21, 2022 Arm (32-bit)

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

Some small fixes for sparse warnings.

author
#1 lore raw

PATCH 1/3 arm: add definition of arch_irq_work_raise()

The arm <asm/irq_work.h> does not define arch_irq_work_raise() so is triggering the following sparse warning. Add a definiton to fix this:

kernel/irq_work.c:70:13: warning: symbol 'arch_irq_work_raise' was not declared. Should it be static? arch/arm/kernel/smp.c:582:6: warning: symbol 'arch_irq_work_raise' was not declared. Should it be static?

---
 arch/arm/include/asm/irq_work.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/irq_work.h +2 -0
index 8895999834cc..3149e4dc1b54 100644
@@ -9,4 +9,6 @@ static inline bool arch_irq_work_has_interrupt(void)
 	return is_smp();
 }
 
+extern void arch_irq_work_raise(void);
+
 #endif /* _ASM_ARM_IRQ_WORK_H */
Signature · 1 line
2.35.1
author
#2 lore raw

PATCH 2/3 arm: dma-mapping: fix pointer/integer warning

In reply to Ben Dooks

Fix the use of a pointer assignment from integer where false is being used instead of NULL. Fix the following warning by usign NULL:

arch/arm/mm/dma-mapping.c:712:52: warning: Using plain integer as NULL pointer

---
 arch/arm/mm/dma-mapping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mm/dma-mapping.c +1 -1
index 059cce018570..1483b6a4319d 100644
@@ -709,7 +709,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
 
 	*handle = DMA_MAPPING_ERROR;
 	allowblock = gfpflags_allow_blocking(gfp);
-	cma = allowblock ? dev_get_cma_area(dev) : false;
+	cma = allowblock ? dev_get_cma_area(dev) : NULL;
 
 	if (cma)
 		buf->allocator = &cma_allocator;
Signature · 1 line
2.35.1
author
#3 lore raw

PATCH 3/3 arm: fix undeclared soft_restart

In reply to Ben Dooks

The soft_restart() is declared in <asm/system_misc.h> so include that to fix the following sparse warning:

arch/arm/kernel/reboot.c:78:6: warning: symbol 'soft_restart' was not declared. Should it be static?

---
 arch/arm/kernel/reboot.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/reboot.c +1 -0
index 2cb943422554..3f0d5c3dae11 100644
@@ -10,6 +10,7 @@
 #include <asm/cacheflush.h>
 #include <asm/idmap.h>
 #include <asm/virt.h>
+#include <asm/system_misc.h>
 
 #include "reboot.h"
 
Signature · 1 line
2.35.1