]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[ATM] ambassador, firestream: "-1 >>" is implementation defined
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 21 Feb 2007 00:43:24 +0000 (01:43 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 21 Feb 2007 00:43:24 +0000 (01:43 +0100)
commitc21af7af790184233f34077985ff160fe6b07d64
treedf4a83b4ab526f8b7bf736c46c00f3b9420098ba
parent379efed186cb110913caa2014bf6cbc396e1fefb
[ATM] ambassador, firestream: "-1 >>" is implementation defined

6.5.7(5): The result of E1 >> E2 is E1 right-shifted E2 bit positions.
            ...
    If E1 has a signed type and a negative value, the resulting value
    is implementation defined.

So, cast -1 to unsigned type to make result well-defined.

[ Modified to use ~0U based upon recommendation from Al Viro. -DaveM ]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/atm/ambassador.c
drivers/atm/firestream.c