2022-07-21 22:07:46

by Ben Dooks

[permalink] [raw]
Subject: some sparse fixes

Some small fixes for sparse warnings.



2022-07-21 22:14:04

by Ben Dooks

[permalink] [raw]
Subject: [PATCH 3/3] arm: fix undeclared soft_restart

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?

Signed-off-by: Ben Dooks <[email protected]>
---
arch/arm/kernel/reboot.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c
index 2cb943422554..3f0d5c3dae11 100644
--- a/arch/arm/kernel/reboot.c
+++ b/arch/arm/kernel/reboot.c
@@ -10,6 +10,7 @@
#include <asm/cacheflush.h>
#include <asm/idmap.h>
#include <asm/virt.h>
+#include <asm/system_misc.h>

#include "reboot.h"

--
2.35.1

2022-07-21 22:14:09

by Ben Dooks

[permalink] [raw]
Subject: [PATCH 2/3] arm: dma-mapping: fix pointer/integer warning

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

Signed-off-by: Ben Dooks <[email protected]>
---
arch/arm/mm/dma-mapping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 059cce018570..1483b6a4319d 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -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;
--
2.35.1

2022-07-21 22:33:05

by Ben Dooks

[permalink] [raw]
Subject: [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?

Signed-off-by: Ben Dooks <[email protected]>
---
arch/arm/include/asm/irq_work.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/irq_work.h b/arch/arm/include/asm/irq_work.h
index 8895999834cc..3149e4dc1b54 100644
--- a/arch/arm/include/asm/irq_work.h
+++ b/arch/arm/include/asm/irq_work.h
@@ -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 */
--
2.35.1