Andreas Schwab dixit:

>Explicitly truncate the second operand of do_div to 32 bits to guard
>against bogus code calling it with a 64bit divisor.
>
>Signed-off-by: Andreas Schwab <sch...@linux-m68k.org>

Tested-by: Thorsten Glaser <t...@debian.org>

>---
> arch/m68k/include/asm/div64.h | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
>diff --git a/arch/m68k/include/asm/div64.h b/arch/m68k/include/asm/div64.h
>index 444ea8a..ef881cf 100644
>--- a/arch/m68k/include/asm/div64.h
>+++ b/arch/m68k/include/asm/div64.h
>@@ -15,16 +15,17 @@
>               unsigned long long n64;                         \
>       } __n;                                                  \
>       unsigned long __rem, __upper;                           \
>+      unsigned long __base = (base);                          \
>                                                               \
>       __n.n64 = (n);                                          \
>       if ((__upper = __n.n32[0])) {                           \
>               asm ("divul.l %2,%1:%0"                         \
>-                      : "=d" (__n.n32[0]), "=d" (__upper)     \
>-                      : "d" (base), "0" (__n.n32[0]));        \
>+                   : "=d" (__n.n32[0]), "=d" (__upper)        \
>+                   : "d" (__base), "0" (__n.n32[0]));         \
>       }                                                       \
>       asm ("divu.l %2,%1:%0"                                  \
>-              : "=d" (__n.n32[1]), "=d" (__rem)               \
>-              : "d" (base), "1" (__upper), "0" (__n.n32[1])); \
>+           : "=d" (__n.n32[1]), "=d" (__rem)                  \
>+           : "d" (__base), "1" (__upper), "0" (__n.n32[1]));  \
>       (n) = __n.n64;                                          \
>       __rem;                                                  \
> })
>-- 
>1.8.3.4
>
>
>-- 
>Andreas Schwab, sch...@linux-m68k.org
>GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
>"And now for something completely different."
>
>
>-- 
>To UNSUBSCRIBE, email to debian-68k-requ...@lists.debian.org
>with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
>Archive: http://lists.debian.org/871u633t27....@igel.home
>
>

//mirabilos
-- 
17:08⎜«Vutral» früher gabs keine packenden smartphones und so
17:08⎜«Vutral» heute gibts frauen die sind facebooksüchtig
17:10⎜«Vutral» aber auch traurig; früher warst du als nerd voll am arsch
17:10⎜«Vutral» heute bist du als nerd der einzige der wirklich damit klarkommt


--
To UNSUBSCRIBE, email to debian-68k-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/pine.bsm.4.64l.1308112157110.5...@herc.mirbsd.org

Reply via email to