]> git.baikalelectronics.ru Git - kernel.git/commit
[ATM] ambassador,firestream: "-1 >>" is implementation defined
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 14 Nov 2006 00:12:08 +0000 (16:12 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:22:25 +0000 (21:22 -0800)
commitb3bd7d248112ebee32d108c8b12775303a18c421
tree81a8bf76d9165d3f0798f2cbd6cb967d35b54d3c
parent66c91235f5c559e6188bb34e131d650c74f09927
[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: David S. Miller <davem@davemloft.net>
drivers/atm/ambassador.c
drivers/atm/firestream.c