Commit 6fbeee29 authored by Chris Metcalf's avatar Chris Metcalf

tile: fix some -Wsign-compare warnings

Normally the build doesn't include these warnings, but at one
point I built with -Wsign-compare, and noticed a few things that
are technically bugs.  This change fixes those things.
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent e56059f2
...@@ -255,7 +255,7 @@ static inline void writeq(u64 val, unsigned long addr) ...@@ -255,7 +255,7 @@ static inline void writeq(u64 val, unsigned long addr)
static inline void memset_io(volatile void *dst, int val, size_t len) static inline void memset_io(volatile void *dst, int val, size_t len)
{ {
int x; size_t x;
BUG_ON((unsigned long)dst & 0x3); BUG_ON((unsigned long)dst & 0x3);
val = (val & 0xff) * 0x01010101; val = (val & 0xff) * 0x01010101;
for (x = 0; x < len; x += 4) for (x = 0; x < len; x += 4)
...@@ -265,7 +265,7 @@ static inline void memset_io(volatile void *dst, int val, size_t len) ...@@ -265,7 +265,7 @@ static inline void memset_io(volatile void *dst, int val, size_t len)
static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
size_t len) size_t len)
{ {
int x; size_t x;
BUG_ON((unsigned long)src & 0x3); BUG_ON((unsigned long)src & 0x3);
for (x = 0; x < len; x += 4) for (x = 0; x < len; x += 4)
*(u32 *)(dst + x) = readl(src + x); *(u32 *)(dst + x) = readl(src + x);
...@@ -274,7 +274,7 @@ static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, ...@@ -274,7 +274,7 @@ static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
static inline void memcpy_toio(volatile void __iomem *dst, const void *src, static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
size_t len) size_t len)
{ {
int x; size_t x;
BUG_ON((unsigned long)dst & 0x3); BUG_ON((unsigned long)dst & 0x3);
for (x = 0; x < len; x += 4) for (x = 0; x < len; x += 4)
writel(*(u32 *)(src + x), dst + x); writel(*(u32 *)(src + x), dst + x);
......
...@@ -42,7 +42,7 @@ static inline int pfn_to_nid(unsigned long pfn) ...@@ -42,7 +42,7 @@ static inline int pfn_to_nid(unsigned long pfn)
#define kern_addr_valid(kaddr) virt_addr_valid((void *)kaddr) #define kern_addr_valid(kaddr) virt_addr_valid((void *)kaddr)
static inline int pfn_valid(int pfn) static inline int pfn_valid(unsigned long pfn)
{ {
int nid = pfn_to_nid(pfn); int nid = pfn_to_nid(pfn);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* Return the "current" portion of a ticket lock value, * Return the "current" portion of a ticket lock value,
* i.e. the number that currently owns the lock. * i.e. the number that currently owns the lock.
*/ */
static inline int arch_spin_current(u32 val) static inline u32 arch_spin_current(u32 val)
{ {
return val >> __ARCH_SPIN_CURRENT_SHIFT; return val >> __ARCH_SPIN_CURRENT_SHIFT;
} }
...@@ -36,7 +36,7 @@ static inline int arch_spin_current(u32 val) ...@@ -36,7 +36,7 @@ static inline int arch_spin_current(u32 val)
* Return the "next" portion of a ticket lock value, * Return the "next" portion of a ticket lock value,
* i.e. the number that the next task to try to acquire the lock will get. * i.e. the number that the next task to try to acquire the lock will get.
*/ */
static inline int arch_spin_next(u32 val) static inline u32 arch_spin_next(u32 val)
{ {
return val & __ARCH_SPIN_NEXT_MASK; return val & __ARCH_SPIN_NEXT_MASK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment