+ make-sure-the-value-in-abs-does-not-get-truncated-if-it-is-greater-than-232.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Make sure the value in abs() does not get truncated if it is greater than 2^32
has been added to the -mm tree.  Its filename is
     make-sure-the-value-in-abs-does-not-get-truncated-if-it-is-greater-than-232.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: Make sure the value in abs() does not get truncated if it is greater than 2^32
From: Rolf Eike Beer <eike-kernel@xxxxxxxxx>

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: Rolf Eike Beer <eike-kernel@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/kernel.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN include/linux/kernel.h~make-sure-the-value-in-abs-does-not-get-truncated-if-it-is-greater-than-232 include/linux/kernel.h
--- a/include/linux/kernel.h~make-sure-the-value-in-abs-does-not-get-truncated-if-it-is-greater-than-232
+++ a/include/linux/kernel.h
@@ -145,7 +145,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;		\
 	})
 
_

Patches currently in -mm which might be from eike-kernel@xxxxxxxxx are

make-sure-the-value-in-abs-does-not-get-truncated-if-it-is-greater-than-232.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux