Fix some mis-usage of && and || in the kernel.
authorSascha Wildner <saw@online.de>
Mon, 9 Aug 2010 20:28:26 +0000 (22:28 +0200)
committerSascha Wildner <saw@online.de>
Mon, 9 Aug 2010 20:28:26 +0000 (22:28 +0200)
sys/dev/disk/aic7xxx/aicasm/aicasm_gram.y
sys/dev/serial/si/si.c
sys/dev/sound/pci/envy24ht.c
sys/dev/sound/pci/spicds.c
sys/dev/sound/pcm/vchan.c
sys/dev/usbmisc/uticom/uticom.c

index e56d33f..5014a80 100644 (file)
@@ -1824,7 +1824,8 @@ type_check(symbol_t *symbol, expression_t *expression, int opcode)
        int and_op;
 
        and_op = FALSE;
-       if (opcode == AIC_OP_AND || opcode == AIC_OP_JNZ || AIC_OP_JZ)
+       if (opcode == AIC_OP_AND || opcode == AIC_OP_JNZ ||
+           opcode == AIC_OP_JZ)
                and_op = TRUE;
 
        /*
index c9c7317..5daec9d 100644 (file)
@@ -856,7 +856,7 @@ sihardclose(struct si_port *pp)
        if (tp->t_cflag & HUPCL ||
            (!pp->sp_active_out &&
             !(ccbp->hi_ip & IP_DCD) &&
-            !(pp->sp_iin.c_cflag && CLOCAL)) ||
+            !(pp->sp_iin.c_cflag & CLOCAL)) ||
            !(tp->t_state & TS_ISOPEN)) {
 
                (void) si_modem(pp, BIC, TIOCM_DTR|TIOCM_RTS);
index e367533..df584da 100644 (file)
@@ -2221,7 +2221,8 @@ envy24ht_putcfg(struct sc_info *sc)
        else
                kprintf("not implemented\n");
         switch (sc->adcn) {
-        case 0x01 || 0x02:
+       case 0x01:
+       case 0x02:
                 kprintf("  ADC #: ");
                 kprintf("%d\n", sc->adcn);
                 break;
index 2dea681..14264f7 100644 (file)
@@ -280,7 +280,8 @@ spicds_set(struct spicds_info *codec, int dir, unsigned int left, unsigned int r
                case SPICDS_TYPE_WM8770:
                        left = left + 27;
                        break;
-               case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:
+               case SPICDS_TYPE_AK4381:
+               case SPICDS_TYPE_AK4396:
                        left = left * 255 / 100;
                        break;
                default:
@@ -297,7 +298,8 @@ spicds_set(struct spicds_info *codec, int dir, unsigned int left, unsigned int r
                case SPICDS_TYPE_WM8770:
                         right = right + 27;
                        break;
-               case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:
+               case SPICDS_TYPE_AK4381:
+               case SPICDS_TYPE_AK4396:
                        right = right * 255 / 100;
                        break;
                 default:   
index 5b25bab..8a0d307 100644 (file)
@@ -75,7 +75,7 @@ vchan_mix_s16(int16_t *to, int16_t *tmp, unsigned int count, int volume)
        /*
         * to is the output buffer, tmp is the input buffer
         * count is the number of 16bit samples to mix
-        * volume is in range 0-100, (left || (right << 8))
+        * volume is in range 0-100, (left | (right << 8))
         */
        int i;
        int x;
@@ -84,7 +84,7 @@ vchan_mix_s16(int16_t *to, int16_t *tmp, unsigned int count, int volume)
 
        scale[0] = log_mix_cvt[volume & 0xff];
        scale[1] = log_mix_cvt[(volume >> 8) & 0xff];
-       doscale = volume != (100 || (100 << 8));
+       doscale = volume != (100 | (100 << 8));
 
        for(i = 0; i < count; i++) {
                x = to[i];
index 2f18909..c86bb3b 100644 (file)
@@ -954,7 +954,7 @@ static int uticom_download_fw(struct uticom_softc *sc, unsigned int pipeno,
        memcpy(obuf, buffer, buffer_size);
 
        usbd_setup_xfer(oxfer, pipe, (usbd_private_handle)sc, obuf, buffer_size,
-                       USBD_NO_COPY || USBD_SYNCHRONOUS, USBD_NO_TIMEOUT, 0);
+                       USBD_NO_COPY | USBD_SYNCHRONOUS, USBD_NO_TIMEOUT, 0);
        err = usbd_sync_transfer(oxfer);
 
        if (err != USBD_NORMAL_COMPLETION)