linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] debugfs: use labs() for absolute value of a long
@ 2016-08-09 20:44 Andreas Dilger
  2016-08-10 21:52 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Dilger @ 2016-08-09 20:44 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, Andreas Dilger

Use labs() instead of abs() for calculated value of a long int
to quiet warning from LLVM.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
---
 debugfs/lsdel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debugfs/lsdel.c b/debugfs/lsdel.c
index e5b2d20..0d74590 100644
--- a/debugfs/lsdel.c
+++ b/debugfs/lsdel.c
@@ -133,7 +133,7 @@ void do_lsdel(int argc, char **argv)
 
 	while (ino) {
 		if ((inode.i_dtime == 0) ||
-		    (secs && ((unsigned) abs(now - secs) > inode.i_dtime)))
+		    (secs && ((unsigned)labs(now - secs) > inode.i_dtime)))
 			goto next;
 
 		lsd.inode = ino;
-- 
1.8.0


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

* Re: [PATCH] debugfs: use labs() for absolute value of a long
  2016-08-09 20:44 [PATCH] debugfs: use labs() for absolute value of a long Andreas Dilger
@ 2016-08-10 21:52 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-08-10 21:52 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: linux-ext4

On Tue, Aug 09, 2016 at 02:44:11PM -0600, Andreas Dilger wrote:
> Use labs() instead of abs() for calculated value of a long int
> to quiet warning from LLVM.
> 
> Signed-off-by: Andreas Dilger <adilger@dilger.ca>

I'm not sure what version of e2fsprogs you're using for your base, but
this was fixed in commit 82e48fb1637: "Fix various clang and gcc -Wall
warnings" --- and this commit is in 1.43.  Are you using an old
pre-1.43 branch, possibly?

					- Ted

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

end of thread, other threads:[~2016-08-10 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-09 20:44 [PATCH] debugfs: use labs() for absolute value of a long Andreas Dilger
2016-08-10 21:52 ` Theodore Ts'o

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).