Commit ca8118bc authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds

[PATCH] alpha: fix sparse warnings

- add missing "__user" annotations in csum_partial_copy.c;
- make io_remap_page_range more readable and fix a warning.
parent 2cc7138f
...@@ -251,7 +251,8 @@ csum_partial_cfu_src_aligned(const unsigned long __user *src, ...@@ -251,7 +251,8 @@ csum_partial_cfu_src_aligned(const unsigned long __user *src,
* look at this too closely, you'll go blind. * look at this too closely, you'll go blind.
*/ */
static inline unsigned long static inline unsigned long
csum_partial_cfu_unaligned(const unsigned long * src, unsigned long * dst, csum_partial_cfu_unaligned(const unsigned long __user * src,
unsigned long * dst,
unsigned long soff, unsigned long doff, unsigned long soff, unsigned long doff,
long len, unsigned long checksum, long len, unsigned long checksum,
unsigned long partial_dest, unsigned long partial_dest,
...@@ -383,7 +384,8 @@ csum_partial_copy_from_user(const char __user *src, char *dst, int len, ...@@ -383,7 +384,8 @@ csum_partial_copy_from_user(const char __user *src, char *dst, int len,
} }
unsigned int unsigned int
csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum) csum_partial_copy_nocheck(const char __user *src, char *dst, int len,
unsigned int sum)
{ {
return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); return do_csum_partial_copy_from_user(src, dst, len, sum, NULL);
} }
...@@ -328,7 +328,11 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) ...@@ -328,7 +328,11 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
#endif #endif
#define io_remap_page_range(vma, start, busaddr, size, prot) \ #define io_remap_page_range(vma, start, busaddr, size, prot) \
remap_pfn_range(vma, start, virt_to_phys(ioremap(busaddr, size)) >> PAGE_SHIFT, size, prot) ({ \
void *va = (void __force *)ioremap(busaddr, size); \
unsigned long pfn = virt_to_phys(va) >> PAGE_SHIFT; \
remap_pfn_range(vma, start, pfn, size, prot); \
})
#define pte_ERROR(e) \ #define pte_ERROR(e) \
printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
......
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