summaryrefslogtreecommitdiffstats
path: root/drivers/atm/firestream.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-11-13 16:12:08 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:22:25 -0800
commit5f3f24faf322e54752d1df00cdb768a013de5d1f (patch)
tree81a8bf76d9165d3f0798f2cbd6cb967d35b54d3c /drivers/atm/firestream.c
parent2ee92d46c6cabedd50edf6f273fa8cf84f707618 (diff)
downloadop-kernel-dev-5f3f24faf322e54752d1df00cdb768a013de5d1f.zip
op-kernel-dev-5f3f24faf322e54752d1df00cdb768a013de5d1f.tar.gz
[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>
Diffstat (limited to 'drivers/atm/firestream.c')
-rw-r--r--drivers/atm/firestream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 697ad82..9c67df5 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -512,7 +512,7 @@ static unsigned int make_rate (unsigned int rate, int r,
}
case ROUND_UP: {
/* check all bits that we are discarding */
- if (man & (-1>>9)) {
+ if (man & (~0U>>9)) {
man = (man>>(32-9)) + 1;
if (man == (1<<9)) {
/* no need to check for round up outside of range */
OpenPOWER on IntegriCloud