diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-09 16:53:50 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-30 11:56:50 -0400 |
commit | 6fbeee29a2b87574527897c3ded1f92e236518c7 (patch) | |
tree | f42ed3f1b9e21f21213b32d0a52504098b55a324 /arch | |
parent | e56059f2d3b8a053c965a51587a4a3328ac00a47 (diff) |
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: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/tile/include/asm/io.h | 6 | ||||
-rw-r--r-- | arch/tile/include/asm/mmzone.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/spinlock_64.h | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h index 73b319e39a3b..9fe434969fab 100644 --- a/arch/tile/include/asm/io.h +++ b/arch/tile/include/asm/io.h | |||
@@ -255,7 +255,7 @@ static inline void writeq(u64 val, unsigned long addr) | |||
255 | 255 | ||
256 | static inline void memset_io(volatile void *dst, int val, size_t len) | 256 | static inline void memset_io(volatile void *dst, int val, size_t len) |
257 | { | 257 | { |
258 | int x; | 258 | size_t x; |
259 | BUG_ON((unsigned long)dst & 0x3); | 259 | BUG_ON((unsigned long)dst & 0x3); |
260 | val = (val & 0xff) * 0x01010101; | 260 | val = (val & 0xff) * 0x01010101; |
261 | for (x = 0; x < len; x += 4) | 261 | 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 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, | 265 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, |
266 | size_t len) | 266 | size_t len) |
267 | { | 267 | { |
268 | int x; | 268 | size_t x; |
269 | BUG_ON((unsigned long)src & 0x3); | 269 | BUG_ON((unsigned long)src & 0x3); |
270 | for (x = 0; x < len; x += 4) | 270 | for (x = 0; x < len; x += 4) |
271 | *(u32 *)(dst + x) = readl(src + x); | 271 | *(u32 *)(dst + x) = readl(src + x); |
@@ -274,7 +274,7 @@ static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, | |||
274 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, | 274 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, |
275 | size_t len) | 275 | size_t len) |
276 | { | 276 | { |
277 | int x; | 277 | size_t x; |
278 | BUG_ON((unsigned long)dst & 0x3); | 278 | BUG_ON((unsigned long)dst & 0x3); |
279 | for (x = 0; x < len; x += 4) | 279 | for (x = 0; x < len; x += 4) |
280 | writel(*(u32 *)(src + x), dst + x); | 280 | writel(*(u32 *)(src + x), dst + x); |
diff --git a/arch/tile/include/asm/mmzone.h b/arch/tile/include/asm/mmzone.h index 9d3dbce8f953..804f1098b6cd 100644 --- a/arch/tile/include/asm/mmzone.h +++ b/arch/tile/include/asm/mmzone.h | |||
@@ -42,7 +42,7 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
42 | 42 | ||
43 | #define kern_addr_valid(kaddr) virt_addr_valid((void *)kaddr) | 43 | #define kern_addr_valid(kaddr) virt_addr_valid((void *)kaddr) |
44 | 44 | ||
45 | static inline int pfn_valid(int pfn) | 45 | static inline int pfn_valid(unsigned long pfn) |
46 | { | 46 | { |
47 | int nid = pfn_to_nid(pfn); | 47 | int nid = pfn_to_nid(pfn); |
48 | 48 | ||
diff --git a/arch/tile/include/asm/spinlock_64.h b/arch/tile/include/asm/spinlock_64.h index 5f8b6a095fd8..9a12b9c7e5d3 100644 --- a/arch/tile/include/asm/spinlock_64.h +++ b/arch/tile/include/asm/spinlock_64.h | |||
@@ -27,7 +27,7 @@ | |||
27 | * Return the "current" portion of a ticket lock value, | 27 | * Return the "current" portion of a ticket lock value, |
28 | * i.e. the number that currently owns the lock. | 28 | * i.e. the number that currently owns the lock. |
29 | */ | 29 | */ |
30 | static inline int arch_spin_current(u32 val) | 30 | static inline u32 arch_spin_current(u32 val) |
31 | { | 31 | { |
32 | return val >> __ARCH_SPIN_CURRENT_SHIFT; | 32 | return val >> __ARCH_SPIN_CURRENT_SHIFT; |
33 | } | 33 | } |
@@ -36,7 +36,7 @@ static inline int arch_spin_current(u32 val) | |||
36 | * Return the "next" portion of a ticket lock value, | 36 | * Return the "next" portion of a ticket lock value, |
37 | * i.e. the number that the next task to try to acquire the lock will get. | 37 | * i.e. the number that the next task to try to acquire the lock will get. |
38 | */ | 38 | */ |
39 | static inline int arch_spin_next(u32 val) | 39 | static inline u32 arch_spin_next(u32 val) |
40 | { | 40 | { |
41 | return val & __ARCH_SPIN_NEXT_MASK; | 41 | return val & __ARCH_SPIN_NEXT_MASK; |
42 | } | 42 | } |