Unverified Commit e0e0c87c authored by Palmer Dabbelt's avatar Palmer Dabbelt
Browse files

RISC-V: Make our port sparse-clean



This patch set contains a handful of fixes that clean up the sparse
results for the RISC-V port.  These patches shouldn't have any
functional difference.  The patches:

* Use NULL instead of 0.
* Clean up __user annotations.
* Split __copy_user into two functions, to make the __user annotations
  valid.

Signed-off-by: default avatarPalmer Dabbelt <palmer@dabbelt.com>
parents 41611ed2 86406d51
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ static inline void flush_dcache_page(struct page *page)

#else /* CONFIG_SMP */

#define flush_icache_all() sbi_remote_fence_i(0)
#define flush_icache_all() sbi_remote_fence_i(NULL)
void flush_icache_mm(struct mm_struct *mm, bool local);

#endif /* CONFIG_SMP */
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,

#include <asm/sbi.h>

#define flush_tlb_all() sbi_remote_sfence_vma(0, 0, -1)
#define flush_tlb_all() sbi_remote_sfence_vma(NULL, 0, -1)
#define flush_tlb_page(vma, addr) flush_tlb_range(vma, addr, 0)
#define flush_tlb_range(vma, start, end) \
	sbi_remote_sfence_vma(mm_cpumask((vma)->vm_mm)->bits, \
+5 −3
Original line number Diff line number Diff line
@@ -392,19 +392,21 @@ do { \
})


extern unsigned long __must_check __copy_user(void __user *to,
extern unsigned long __must_check __asm_copy_to_user(void __user *to,
	const void *from, unsigned long n);
extern unsigned long __must_check __asm_copy_from_user(void *to,
	const void __user *from, unsigned long n);

static inline unsigned long
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
{
	return __copy_user(to, from, n);
	return __asm_copy_to_user(to, from, n);
}

static inline unsigned long
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
{
	return __copy_user(to, from, n);
	return __asm_copy_from_user(to, from, n);
}

extern long strncpy_from_user(char *dest, const char __user *src, long count);
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
 * Assembly functions that may be used (directly or indirectly) by modules
 */
EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(__copy_user);
EXPORT_SYMBOL(__asm_copy_to_user);
EXPORT_SYMBOL(__asm_copy_from_user);
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memcpy);
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ int is_valid_bugaddr(unsigned long pc)

	if (pc < PAGE_OFFSET)
		return 0;
	if (probe_kernel_address((bug_insn_t __user *)pc, insn))
	if (probe_kernel_address((bug_insn_t *)pc, insn))
		return 0;
	return (insn == __BUG_INSN);
}
Loading