]> git.alsa-project.org Git - alsa-lib.git/commitdiff
topology: ctl: Fix access type checks
authorTakashi Iwai <tiwai@suse.de>
Tue, 8 Sep 2015 20:09:44 +0000 (22:09 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 8 Sep 2015 20:09:44 +0000 (22:09 +0200)
Fix the wrong bit-and check by adding parentheses properly:
  ctl.c: In function ‘tplg_add_bytes’:
  ctl.c:868:22: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
     if (be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE
                        ^

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/topology/ctl.c

index 68c4ce5803d1f5a1be1ca8e72806fd035f75392f..7d8787f347b858d2141f50714e2d5e047a204272 100644 (file)
@@ -865,7 +865,7 @@ int tplg_add_bytes(snd_tplg_t *tplg, struct snd_tplg_bytes_template *bytes_ctl,
 
        /* check on TLV bytes control */
        if (be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
-               if (be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE
+               if ((be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)
                        != SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE) {
                        SNDERR("error: Invalid TLV bytes control access 0x%x\n",
                                be->hdr.access);