From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Wed, 11 Jun 2014 20:38:48 +0200 Subject: [U-Boot] [PATCH] ubifs: don't self assign values In-Reply-To: <5397DB07.1010506@denx.de> References: <1402435643-11294-1-git-send-email-jeroen@myspectrum.nl> <5397DB07.1010506@denx.de> Message-ID: <1402511928.4361.11.camel@yellow> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > > Signed-off-by: Jeroen Hofstee > > --- > > 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; ~~~~ ^ ~~~~