public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ubifs: don't self assign values
@ 2014-06-10 21:27 Jeroen Hofstee
  2014-06-11  4:28 ` Heiko Schocher
  0 siblings, 1 reply; 3+ messages in thread
From: Jeroen Hofstee @ 2014-06-10 21:27 UTC (permalink / raw)
  To: u-boot

It seems the code tries to trick the compiler the argument
is actually used. However compilers became too smart too
fool them so easily an now warn. Checking gcc and clang
does not seem to emit a warning. If so it should be decorated
with unused / (void).

cc: Stefan Roese <sr@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 fs/ubifs/recovery.c | 1 -
 fs/ubifs/scan.c     | 1 -
 2 files changed, 2 deletions(-)

diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 7444650..b91a8cc 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -392,7 +392,6 @@ static void clean_buf(const struct ubifs_info *c, void **buf, int lnum,
 {
 	int empty_offs, pad_len;
 
-	lnum = lnum;
 	dbg_rcvry("cleaning corruption at %d:%d", lnum, *offs);
 
 	if (c->min_io_size == 1) {
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c
index 0ed8247..633a56f 100644
--- a/fs/ubifs/scan.c
+++ b/fs/ubifs/scan.c
@@ -175,7 +175,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
 		    int lnum, int offs)
 {
-	lnum = lnum;
 	dbg_scan("stop scanning LEB %d at offset %d", lnum, offs);
 	ubifs_assert(offs % c->min_io_size == 0);
 
-- 
1.8.3.2

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

* [U-Boot] [PATCH] ubifs: don't self assign values
  2014-06-10 21:27 [U-Boot] [PATCH] ubifs: don't self assign values Jeroen Hofstee
@ 2014-06-11  4:28 ` Heiko Schocher
  2014-06-11 18:38   ` Jeroen Hofstee
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2014-06-11  4:28 UTC (permalink / raw)
  To: u-boot

Hello Jeroen,

Am 10.06.2014 23:27, schrieb Jeroen Hofstee:
> It seems the code tries to trick the compiler the argument
> is actually used. However compilers became too smart too
> fool them so easily an now warn. Checking gcc and clang
> does not seem to emit a warning. If so it should be decorated
> with unused / (void).
>
> cc: Stefan Roese<sr@denx.de>
> Signed-off-by: Jeroen Hofstee<jeroen@myspectrum.nl>
> ---
>   fs/ubifs/recovery.c | 1 -
>   fs/ubifs/scan.c     | 1 -
>   2 files changed, 2 deletions(-)

I posted an update for MTD/UBI/UBIFS with Linux 3.14 here:

[U-Boot] [RFC, PATCH v2 0/4] mtd, ubi, ubifs: resync with Linux-3.14
http://lists.denx.de/pipermail/u-boot/2014-May/180001.html

Could you try this series? There only your change in "fs/ubifs/recovery.c"
is needed ... and as this code comes from Linux, maybe it is worth
to post this change also for Linux?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [PATCH] ubifs: don't self assign values
  2014-06-11  4:28 ` Heiko Schocher
@ 2014-06-11 18:38   ` Jeroen Hofstee
  0 siblings, 0 replies; 3+ messages in thread
From: Jeroen Hofstee @ 2014-06-11 18:38 UTC (permalink / raw)
  To: u-boot

Hello Heiko,

On wo, 2014-06-11 at 06:28 +0200, Heiko Schocher wrote:
> Hello Jeroen,
> 
> Am 10.06.2014 23:27, schrieb Jeroen Hofstee:
> > It seems the code tries to trick the compiler the argument
> > is actually used. However compilers became too smart too
> > fool them so easily an now warn. Checking gcc and clang
> > does not seem to emit a warning. If so it should be decorated
> > with unused / (void).
> >
> > cc: Stefan Roese<sr@denx.de>
> > Signed-off-by: Jeroen Hofstee<jeroen@myspectrum.nl>
> > ---
> >   fs/ubifs/recovery.c | 1 -
> >   fs/ubifs/scan.c     | 1 -
> >   2 files changed, 2 deletions(-)
> 
> I posted an update for MTD/UBI/UBIFS with Linux 3.14 here:
> 
> [U-Boot] [RFC, PATCH v2 0/4] mtd, ubi, ubifs: resync with Linux-3.14
> http://lists.denx.de/pipermail/u-boot/2014-May/180001.html
> 
> Could you try this series? There only your change in "fs/ubifs/recovery.c"
> is needed ... 
I tried your v3, warnings below. Especially the first one is a bit noisy
since it is in a common header file. The other warnings seem harmless.

> and as this code comes from Linux, maybe it is worth
> to post this change also for Linux?
> 
perhaps, first trying to silence MAKEALL a bit, so real issues aren't
buried in noise. I will see how it lands and send an updated patch.

Regards,
Jeroen

include/linux/compat.h:77:18: warning: redefinition of typedef 'gfp_t'
is a C11 feature [-Wtypedef-redefinition]
typedef unsigned gfp_t;
                 ^
include/linux/types.h:142:30: note: previous definition is here
typedef unsigned __bitwise__    gfp_t;
                                ^

common/cmd_ubi.c:310:11: warning: comparison of unsigned expression < 0
is always false [-Wtautological-compare]
        if (size < 0 || size > rsvd_bytes) {
            ~~~~ ^ ~


drivers/mtd/ubi/vmt.c:797:26: warning: comparison of unsigned expression
< 0 is always false [-Wtautological-compare]
                if (vol->last_eb_bytes < 0 ||
                    ~~~~~~~~~~~~~~~~~~ ^ ~


fs/ubifs/recovery.c:441:7: warning: explicitly assigning value of
variable of type 'int' to itself [-Wself-assign]
        lnum = lnum;
        ~~~~ ^ ~~~~


fs/ubifs/scan.c:171:7: warning: explicitly assigning value of variable
of type 'int' to itself [-Wself-assign]
        lnum = lnum;
        ~~~~ ^ ~~~~

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

end of thread, other threads:[~2014-06-11 18:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 21:27 [U-Boot] [PATCH] ubifs: don't self assign values Jeroen Hofstee
2014-06-11  4:28 ` Heiko Schocher
2014-06-11 18:38   ` Jeroen Hofstee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox