Skip to content

Commit

Permalink
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
Browse files Browse the repository at this point in the history
Pull microblaze fixes from Michal Simek:
 "One is fixing warning reported by sparse and the second warning was
  reported by Geert in his build regressions/improvements status update
  for -rc4."

* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Use static inline functions in cacheflush.h
  microblaze: Fix sparse warnings
  • Loading branch information
Linus Torvalds committed Jun 5, 2013
2 parents 042dd60 + 62bc82a commit 1dc735b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions arch/microblaze/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,23 @@ do { \

#define flush_cache_range(vma, start, len) do { } while (0)

#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \
u32 addr = virt_to_phys(dst); \
memcpy((dst), (src), (len)); \
if (vma->vm_flags & VM_EXEC) { \
invalidate_icache_range((unsigned) (addr), \
(unsigned) (addr) + PAGE_SIZE); \
flush_dcache_range((unsigned) (addr), \
(unsigned) (addr) + PAGE_SIZE); \
} \
} while (0)

#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
do { \
memcpy((dst), (src), (len)); \
} while (0)
static inline void copy_to_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr,
void *dst, void *src, int len)
{
u32 addr = virt_to_phys(dst);
memcpy(dst, src, len);
if (vma->vm_flags & VM_EXEC) {
invalidate_icache_range(addr, addr + PAGE_SIZE);
flush_dcache_range(addr, addr + PAGE_SIZE);
}
}

static inline void copy_from_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr,
void *dst, void *src, int len)
{
memcpy(dst, src, len);
}

#endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */
4 changes: 2 additions & 2 deletions arch/microblaze/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ static inline int access_ok(int type, const void __user *addr,
if ((get_fs().seg < ((unsigned long)addr)) ||
(get_fs().seg < ((unsigned long)addr + size - 1))) {
pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
type ? "WRITE" : "READ ", (u32)addr, (u32)size,
type ? "WRITE" : "READ ", (__force u32)addr, (u32)size,
(u32)get_fs().seg);
return 0;
}
ok:
pr_debug("ACCESS OK: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
type ? "WRITE" : "READ ", (u32)addr, (u32)size,
type ? "WRITE" : "READ ", (__force u32)addr, (u32)size,
(u32)get_fs().seg);
return 1;
}
Expand Down

0 comments on commit 1dc735b

Please sign in to comment.