Skip to content

Commit

Permalink
binfmt_flat: fix arch/m32r and arch/microblaze flat_put_addr_at_rp()
Browse files Browse the repository at this point in the history
Change the m32r flat_put_addr_at_rp() function to return int and
always return 0.

The microblaze function already returned 0 so just change its
function return type from void to int.

Seven (7) other arch-es already have this function as returning
an int type result.

Fixes: 468138d (binfmt_flat: flat_{get,put}_addr_from_rp()
	should be able to fail)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Randy Dunlap authored and Al Viro committed Aug 31, 2017
1 parent 8363dae commit b38e51c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arch/m32r/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static inline unsigned long m32r_flat_get_addr_from_rp (u32 *rp,
return ~0; /* bogus value */
}

static inline void flat_put_addr_at_rp(u32 *rp, u32 addr, u32 relval)
static inline int flat_put_addr_at_rp(u32 *rp, u32 addr, u32 relval)
{
unsigned int reloc = flat_m32r_get_reloc_type (relval);
if (reloc & 0xf0) {
Expand Down Expand Up @@ -133,6 +133,7 @@ static inline void flat_put_addr_at_rp(u32 *rp, u32 addr, u32 relval)
break;
}
}
return 0;
}

// kludge - text_len is a local variable in the only user.
Expand Down
2 changes: 1 addition & 1 deletion arch/microblaze/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
* unaligned.
*/

static inline void
static inline int
flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 relval)
{
u32 *p = (__force u32 *)rp;
Expand Down

0 comments on commit b38e51c

Please sign in to comment.