From: Eric Sandeen Date: Tue, 18 Aug 2015 07:53:17 +0000 (+1000) Subject: xfs_fsr: Fix parentheses around truth value X-Git-Tag: v4.2.0-rc2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98166c91f092fe8a0c41244583e84a080e1f1858;p=thirdparty%2Fxfsprogs-dev.git xfs_fsr: Fix parentheses around truth value Someone in the distant past must have responded to gcc's warning about parentheses around assignment used as a truth value by changing: while (ret = func() == 0) to: while ((ret = func() == 0)) While this shuts up gcc, it doesn't yield the proper result. If func () returns 0, func == 0 is true, and ret is assigned a value of 1. This does keep the while loop going, but it's a very strange way to go about it, and may someday yield confusing results. Fix this as: while ((ret = func()) == 0) so that ret gets the function return value as expected. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index b4ff136bf..a1bc24593 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -724,7 +724,7 @@ fsrfs(char *mntdir, xfs_ino_t startino, int targetrange) tmp_init(mntdir); while ((ret = xfs_bulkstat(fsfd, - &lastino, GRABSZ, &buf[0], &buflenout) == 0)) { + &lastino, GRABSZ, &buf[0], &buflenout)) == 0) { xfs_bstat_t *p; xfs_bstat_t *endp;