Skip to content

Commit 68fdb64

Browse files
jmberg-intelrichardweinberger
authored andcommitted
lib/logic_iomem: fix sparse warnings
A couple of sparse warnings happened here due to casts on the prints, a missing static and a missing include. Fix all of them. Reported-by: kernel test robot <lkp@intel.com> Fixes: ca2e334 ("lib: add iomem emulation (logic_iomem)") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent b76dd93 commit 68fdb64

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/logic_iomem.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/types.h>
77
#include <linux/slab.h>
88
#include <linux/logic_iomem.h>
9+
#include <asm/io.h>
910

1011
struct logic_iomem_region {
1112
const struct resource *res;
@@ -78,7 +79,7 @@ static void __iomem *real_ioremap(phys_addr_t offset, size_t size)
7879
static void real_iounmap(void __iomem *addr)
7980
{
8081
WARN(1, "invalid iounmap for addr 0x%llx\n",
81-
(unsigned long long)addr);
82+
(unsigned long long __force)addr);
8283
}
8384
#endif /* CONFIG_LOGIC_IOMEM_FALLBACK */
8485

@@ -172,14 +173,15 @@ EXPORT_SYMBOL(iounmap);
172173
static u##sz real_raw_read ## op(const volatile void __iomem *addr) \
173174
{ \
174175
WARN(1, "Invalid read" #op " at address %llx\n", \
175-
(unsigned long long)addr); \
176+
(unsigned long long __force)addr); \
176177
return (u ## sz)~0ULL; \
177178
} \
178179
\
179-
void real_raw_write ## op(u ## sz val, volatile void __iomem *addr) \
180+
static void real_raw_write ## op(u ## sz val, \
181+
volatile void __iomem *addr) \
180182
{ \
181183
WARN(1, "Invalid writeq" #op " of 0x%llx at address %llx\n", \
182-
(unsigned long long)val, (unsigned long long)addr); \
184+
(unsigned long long)val, (unsigned long long __force)addr);\
183185
} \
184186

185187
MAKE_FALLBACK(b, 8);
@@ -192,14 +194,14 @@ MAKE_FALLBACK(q, 64);
192194
static void real_memset_io(volatile void __iomem *addr, int value, size_t size)
193195
{
194196
WARN(1, "Invalid memset_io at address 0x%llx\n",
195-
(unsigned long long)addr);
197+
(unsigned long long __force)addr);
196198
}
197199

198200
static void real_memcpy_fromio(void *buffer, const volatile void __iomem *addr,
199201
size_t size)
200202
{
201203
WARN(1, "Invalid memcpy_fromio at address 0x%llx\n",
202-
(unsigned long long)addr);
204+
(unsigned long long __force)addr);
203205

204206
memset(buffer, 0xff, size);
205207
}
@@ -208,7 +210,7 @@ static void real_memcpy_toio(volatile void __iomem *addr, const void *buffer,
208210
size_t size)
209211
{
210212
WARN(1, "Invalid memcpy_toio at address 0x%llx\n",
211-
(unsigned long long)addr);
213+
(unsigned long long __force)addr);
212214
}
213215
#endif /* CONFIG_LOGIC_IOMEM_FALLBACK */
214216

0 commit comments

Comments
 (0)