linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] binfmt_flat: Use %u to format u32
@ 2017-07-16 11:57 Geert Uytterhoeven
  2017-07-16 11:57 ` [PATCH 2/3] blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes Geert Uytterhoeven
  2017-07-16 11:57 ` [PATCH 3/3] h8300: Add missing closing parenthesis in flat_get_addr_from_rp() Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-07-16 11:57 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Steven Miao, Yoshinori Sato, Greg Ungerer, adi-buildroot-devel,
	uclinux-h8-devel, linux-m68k, linux-fsdevel, linux-kernel,
	Geert Uytterhoeven

Several variables had their types changed from unsigned long to u32,
but the printk()-style format to print them wasn't updated, leading to:

    fs/binfmt_flat.c: In function ‘load_flat_file’:
    fs/binfmt_flat.c:577: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘u32’

Fixes: 468138d78510688f ("binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 fs/binfmt_flat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 69ec23daa25e003f..a1e6860b6f46a091 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -574,7 +574,7 @@ static int load_flat_file(struct linux_binprm *bprm,
 				MAX_SHARED_LIBS * sizeof(unsigned long),
 				FLAT_DATA_ALIGN);
 
-		pr_debug("Allocated data+bss+stack (%ld bytes): %lx\n",
+		pr_debug("Allocated data+bss+stack (%u bytes): %lx\n",
 			 data_len + bss_len + stack_len, datapos);
 
 		fpos = ntohl(hdr->data_start);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes
  2017-07-16 11:57 [PATCH 1/3] binfmt_flat: Use %u to format u32 Geert Uytterhoeven
@ 2017-07-16 11:57 ` Geert Uytterhoeven
  2017-07-16 11:57 ` [PATCH 3/3] h8300: Add missing closing parenthesis in flat_get_addr_from_rp() Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-07-16 11:57 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Steven Miao, Yoshinori Sato, Greg Ungerer, adi-buildroot-devel,
	uclinux-h8-devel, linux-m68k, linux-fsdevel, linux-kernel,
	Geert Uytterhoeven

Several variables had their types changed from unsigned long to u32, but
the arch-specific implementations of flat_set_persistent() weren't
updated, leading to compiler warnings on blackfin and m68k:

    fs/binfmt_flat.c: In function ‘load_flat_file’:
    fs/binfmt_flat.c:799: warning: passing argument 2 of ‘flat_set_persistent’ from incompatible pointer type

Fixes: 468138d78510688f ("binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/blackfin/include/asm/flat.h | 3 +--
 arch/m68k/include/asm/flat.h     | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/blackfin/include/asm/flat.h b/arch/blackfin/include/asm/flat.h
index 296d7f56fbfd005b..f1d6ba7afbf245a0 100644
--- a/arch/blackfin/include/asm/flat.h
+++ b/arch/blackfin/include/asm/flat.h
@@ -44,8 +44,7 @@ flat_get_relocate_addr (unsigned long relval)
 	return relval & 0x03ffffff; /* Mask out top 6 bits */
 }
 
-static inline int flat_set_persistent(unsigned long relval,
-				      unsigned long *persistent)
+static inline int flat_set_persistent(u32 relval, u32 *persistent)
 {
 	int type = (relval >> 26) & 7;
 	if (type == 3) {
diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h
index 48b62790fe70f1a6..b2a41f5b3890a524 100644
--- a/arch/m68k/include/asm/flat.h
+++ b/arch/m68k/include/asm/flat.h
@@ -30,8 +30,7 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
 }
 #define	flat_get_relocate_addr(rel)		(rel)
 
-static inline int flat_set_persistent(unsigned long relval,
-				      unsigned long *persistent)
+static inline int flat_set_persistent(u32 relval, u32 *persistent)
 {
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] h8300: Add missing closing parenthesis in flat_get_addr_from_rp()
  2017-07-16 11:57 [PATCH 1/3] binfmt_flat: Use %u to format u32 Geert Uytterhoeven
  2017-07-16 11:57 ` [PATCH 2/3] blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes Geert Uytterhoeven
@ 2017-07-16 11:57 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-07-16 11:57 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Steven Miao, Yoshinori Sato, Greg Ungerer, adi-buildroot-devel,
	uclinux-h8-devel, linux-m68k, linux-fsdevel, linux-kernel,
	Geert Uytterhoeven

In file included from include/linux/flat.h:13:0,
                 from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h: In function 'flat_get_addr_from_rp':
arch/h8300/include/asm/flat.h:28:3: error: expected ')' before 'val'
   val &= 0x00ffffff;
   ^
arch/h8300/include/asm/flat.h:31:1: error: expected expression before '}' token
 }
 ^
In file included from include/linux/flat.h:13:0,
                 from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h:26:6: warning: unused variable 'val' [-Wunused-variable]
  u32 val = get_unaligned((__force u32 *)rp);
      ^
In file included from include/linux/flat.h:13:0,
                 from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 468138d78510688f ("binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/h8300/include/asm/flat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h
index 18d024251738dd4e..7e0bd6fa15324495 100644
--- a/arch/h8300/include/asm/flat.h
+++ b/arch/h8300/include/asm/flat.h
@@ -24,7 +24,7 @@ static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
 					u32 *addr, u32 *persistent)
 {
 	u32 val = get_unaligned((__force u32 *)rp);
-	if (!(flags & FLAT_FLAG_GOTPIC)
+	if (!(flags & FLAT_FLAG_GOTPIC))
 		val &= 0x00ffffff;
 	*addr = val;
 	return 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-16 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-16 11:57 [PATCH 1/3] binfmt_flat: Use %u to format u32 Geert Uytterhoeven
2017-07-16 11:57 ` [PATCH 2/3] blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes Geert Uytterhoeven
2017-07-16 11:57 ` [PATCH 3/3] h8300: Add missing closing parenthesis in flat_get_addr_from_rp() Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).