fix ! versus & precedence in various places
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 6 Feb 2008 09:36:06 +0000 (01:36 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:40:59 +0000 (10:40 -0800)
Fix various instances of

if (!expr & mask)

which should probably have been

if (!(expr & mask))

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Peter Osterlund <petero2@telia.com>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/paride/pt.c
drivers/block/pktcdvd.c
drivers/isdn/act2000/module.c
drivers/isdn/i4l/isdn_ttyfax.c
drivers/isdn/icn/icn.c
drivers/isdn/isdnloop/isdnloop.c
drivers/video/i810/i810_main.c
drivers/video/sis/sis_main.c

index 76096cad798f1c54708a498a90d5eb85eb105f83..8b9549ab4a4e6eafd21b2e38b835618448cf31d9 100644 (file)
@@ -660,7 +660,7 @@ static int pt_open(struct inode *inode, struct file *file)
        pt_identify(tape);
 
        err = -ENODEV;
-       if (!tape->flags & PT_MEDIA)
+       if (!(tape->flags & PT_MEDIA))
                goto out;
 
        err = -EROFS;
index e9de1712e5a0b1b98b8cc1ce95d59d8daf0b615e..674cd66dcabaae261ca0e97c5ab61a1f272b2db5 100644 (file)
@@ -2212,11 +2212,11 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed)
                return ret;
        }
 
-       if (!buf[6] & 0x40) {
+       if (!(buf[6] & 0x40)) {
                printk(DRIVER_NAME": Disc type is not CD-RW\n");
                return 1;
        }
-       if (!buf[6] & 0x4) {
+       if (!(buf[6] & 0x4)) {
                printk(DRIVER_NAME": A1 values on media are not valid, maybe not CDRW?\n");
                return 1;
        }
index ee2b0b9f8f46b873822dc20db69f2625b9a8d650..8325022e2bed5951c04e67efc989aabec005bc6a 100644 (file)
@@ -310,7 +310,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
                        }
                        break;
                case ISDN_CMD_DIAL:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if (!(chan = find_channel(card, c->arg & 0x0f)))
                                break;
@@ -339,7 +339,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
                        }
                        return ret;
                case ISDN_CMD_ACCEPTD:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if (!(chan = find_channel(card, c->arg & 0x0f)))
                                break;
@@ -347,11 +347,11 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
                                actcapi_select_b2_protocol_req(card, chan);
                        return 0;
                case ISDN_CMD_ACCEPTB:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        return 0;
                case ISDN_CMD_HANGUP:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if (!(chan = find_channel(card, c->arg & 0x0f)))
                                break;
@@ -366,7 +366,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
                        }
                        return 0;
                case ISDN_CMD_SETEAZ:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if (!(chan = find_channel(card, c->arg & 0x0f)))
                                break;
@@ -386,7 +386,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
                        actcapi_listen_req(card);
                        return 0;
                case ISDN_CMD_CLREAZ:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if (!(chan = find_channel(card, c->arg & 0x0f)))
                                break;
@@ -394,14 +394,14 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
                        actcapi_listen_req(card);
                        return 0;
                case ISDN_CMD_SETL2:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if (!(chan = find_channel(card, c->arg & 0x0f)))
                                break;
                        chan->l2prot = (c->arg >> 8);
                        return 0;
                case ISDN_CMD_SETL3:
-                       if (!card->flags & ACT2000_FLAGS_RUNNING)
+                       if (!(card->flags & ACT2000_FLAGS_RUNNING))
                                return -ENODEV;
                        if ((c->arg >> 8) != ISDN_PROTO_L3_TRANS) {
                                printk(KERN_WARNING "L3 protocol unknown\n");
@@ -524,7 +524,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
         act2000_card *card = act2000_findcard(id);
 
         if (card) {
-                if (!card->flags & ACT2000_FLAGS_RUNNING)
+                if (!(card->flags & ACT2000_FLAGS_RUNNING))
                         return -ENODEV;
                 return (len);
         }
@@ -539,7 +539,7 @@ if_readstatus(u_char __user * buf, int len, int id, int channel)
         act2000_card *card = act2000_findcard(id);
        
         if (card) {
-                if (!card->flags & ACT2000_FLAGS_RUNNING)
+                if (!(card->flags & ACT2000_FLAGS_RUNNING))
                         return -ENODEV;
                 return (act2000_readstatus(buf, len, card));
         }
@@ -554,7 +554,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
         act2000_card *card = act2000_findcard(id);
        
         if (card) {
-                if (!card->flags & ACT2000_FLAGS_RUNNING)
+                if (!(card->flags & ACT2000_FLAGS_RUNNING))
                         return -ENODEV;
                return (act2000_sendbuf(card, channel, ack, skb));
         }
index a943d078bacc2991bdd52e8680b4648c3aafb866..f93de4a303550afa4ea48b3ca6af7f7e4568a446 100644 (file)
@@ -834,7 +834,7 @@ isdn_tty_cmd_FCLASS2(char **p, modem_info * info)
                char *rp = &f->resolution;
 
                p[0] += 2;
-               if (!info->faxonline & 1)       /* not outgoing connection */
+               if (!(info->faxonline & 1))     /* not outgoing connection */
                        PARSE_ERROR1;
 
                for (i = 0; (((*p[0] >= '0') && (*p[0] <= '9')) || (*p[0] == ',')) && (i < 4); i++) {
index 82d957bde299453dcbd0b53173fc4e5efe18e5b2..bf7997abc4ac6da27bf972677ac3283e7e68d49c 100644 (file)
@@ -1302,7 +1302,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_DIAL:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if (card->leased)
                                break;
@@ -1328,7 +1328,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_ACCEPTD:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if (c->arg < ICN_BCH) {
                                a = c->arg + 1;
@@ -1348,7 +1348,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_ACCEPTB:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if (c->arg < ICN_BCH) {
                                a = c->arg + 1;
@@ -1366,7 +1366,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_HANGUP:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if (c->arg < ICN_BCH) {
                                a = c->arg + 1;
@@ -1375,7 +1375,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_SETEAZ:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if (card->leased)
                                break;
@@ -1391,7 +1391,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_CLREAZ:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if (card->leased)
                                break;
@@ -1405,7 +1405,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_SETL2:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        if ((c->arg & 255) < ICN_BCH) {
                                a = c->arg;
@@ -1424,7 +1424,7 @@ icn_command(isdn_ctrl * c, icn_card * card)
                        }
                        break;
                case ISDN_CMD_SETL3:
-                       if (!card->flags & ICN_FLAGS_RUNNING)
+                       if (!(card->flags & ICN_FLAGS_RUNNING))
                                return -ENODEV;
                        return 0;
                default:
@@ -1471,7 +1471,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
        icn_card *card = icn_findcard(id);
 
        if (card) {
-               if (!card->flags & ICN_FLAGS_RUNNING)
+               if (!(card->flags & ICN_FLAGS_RUNNING))
                        return -ENODEV;
                return (icn_writecmd(buf, len, 1, card));
        }
@@ -1486,7 +1486,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel)
        icn_card *card = icn_findcard(id);
 
        if (card) {
-               if (!card->flags & ICN_FLAGS_RUNNING)
+               if (!(card->flags & ICN_FLAGS_RUNNING))
                        return -ENODEV;
                return (icn_readstatus(buf, len, card));
        }
@@ -1501,7 +1501,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
        icn_card *card = icn_findcard(id);
 
        if (card) {
-               if (!card->flags & ICN_FLAGS_RUNNING)
+               if (!(card->flags & ICN_FLAGS_RUNNING))
                        return -ENODEV;
                return (icn_sendbuf(channel, ack, skb, card));
        }
index bb92e3cd9334a0bdf2822d28ef47bf0739ef2303..655ef9a3f4df2a023d319967e9aa99dda93e4dc8 100644 (file)
@@ -1184,7 +1184,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                        }
                        break;
                case ISDN_CMD_DIAL:
-                       if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                       if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                return -ENODEV;
                        if (card->leased)
                                break;
@@ -1210,7 +1210,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                        }
                        break;
                case ISDN_CMD_ACCEPTD:
-                       if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                       if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                return -ENODEV;
                        if (c->arg < ISDNLOOP_BCH) {
                                a = c->arg + 1;
@@ -1238,7 +1238,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                        }
                        break;
                case ISDN_CMD_ACCEPTB:
-                       if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                       if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                return -ENODEV;
                        if (c->arg < ISDNLOOP_BCH) {
                                a = c->arg + 1;
@@ -1264,7 +1264,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                                i = isdnloop_writecmd(cbuf, strlen(cbuf), 0, card);
                                break;
                case ISDN_CMD_HANGUP:
-                               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                        return -ENODEV;
                                if (c->arg < ISDNLOOP_BCH) {
                                        a = c->arg + 1;
@@ -1273,7 +1273,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                                }
                                break;
                case ISDN_CMD_SETEAZ:
-                               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                        return -ENODEV;
                                if (card->leased)
                                        break;
@@ -1303,7 +1303,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                                }
                                break;
                case ISDN_CMD_SETL2:
-                               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                        return -ENODEV;
                                if ((c->arg & 255) < ISDNLOOP_BCH) {
                                        a = c->arg;
@@ -1395,7 +1395,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel)
        isdnloop_card *card = isdnloop_findcard(id);
 
        if (card) {
-               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                        return -ENODEV;
                return (isdnloop_readstatus(buf, len, card));
        }
@@ -1410,7 +1410,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
        isdnloop_card *card = isdnloop_findcard(id);
 
        if (card) {
-               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                        return -ENODEV;
                /* ack request stored in skb scratch area */
                *(skb->head) = ack;
index 1a7d7789d8772f600c6bb3100b86b50b68a45dab..1d13dd099af81236af440329cf65727b9689b6d9 100644 (file)
@@ -1476,7 +1476,7 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
        struct i810fb_par *par = info->par;
        u8 __iomem *mmio = par->mmio_start_virtual;
 
-       if (!par->dev_flags & LOCKUP)
+       if (!(par->dev_flags & LOCKUP))
                return -ENXIO;
 
        if (cursor->image.width > 64 || cursor->image.height > 64)
index 93ae747440cbb97b6f20d87642fbaa901655b90e..5b28fa2038fffa803bbe71d707717dfaed067136 100644 (file)
@@ -427,7 +427,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 
        monitor->feature = buffer[0x18];
 
-       if(!buffer[0x14] & 0x80) {
+       if(!(buffer[0x14] & 0x80)) {
                if(!(buffer[0x14] & 0x08)) {
                        printk(KERN_INFO
                                "sisfb: WARNING: Monitor does not support separate syncs\n");