Commit 072647d7 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by James Toy

abs() will truncate the input if is it outside the 2^32 range. Fix that

by assuming `long' input.

This might generate worse code in the common case.
Signed-off-by: default avatarRolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 44b9650d
......@@ -146,7 +146,7 @@ extern int _cond_resched(void);
#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
#define abs(x) ({ \
int __x = (x); \
long __x = (x); \
(__x < 0) ? -__x : __x; \
})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment