aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorPeter Senna Tschudin <peter.senna@gmail.com>2013-09-22 14:44:12 -0400
committerTakashi Iwai <tiwai@suse.de>2013-09-26 03:57:24 -0400
commite0f17c75d9352c38926da1b4d8dbefc2d9942006 (patch)
tree3c489acb0c51ec645c9535a844617547df946097 /sound/pci
parent43cdd088b1b10306d4eb6d9208b62c7f60abffeb (diff)
ALSA: Fix assignment of 0/1 to bool variables
Convert 0 to false and 1 to true when assigning values to bool variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2. The simplified semantic patch that find this problem is as follows (http://coccinelle.lip6.fr/): @@ bool b; @@ ( -b = 0 +b = false | -b = 1 +b = true ) Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/azt3328.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index c8e121611593..1aef7128f7ca 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -715,14 +715,14 @@ snd_azf3328_mixer_ac97_read(struct snd_ac97 *ac97, unsigned short reg_ac97)
715 const struct snd_azf3328 *chip = ac97->private_data; 715 const struct snd_azf3328 *chip = ac97->private_data;
716 unsigned short reg_azf = snd_azf3328_mixer_ac97_map_reg_idx(reg_ac97); 716 unsigned short reg_azf = snd_azf3328_mixer_ac97_map_reg_idx(reg_ac97);
717 unsigned short reg_val = 0; 717 unsigned short reg_val = 0;
718 bool unsupported = 0; 718 bool unsupported = false;
719 719
720 snd_azf3328_dbgmixer( 720 snd_azf3328_dbgmixer(
721 "snd_azf3328_mixer_ac97_read reg_ac97 %u\n", 721 "snd_azf3328_mixer_ac97_read reg_ac97 %u\n",
722 reg_ac97 722 reg_ac97
723 ); 723 );
724 if (reg_azf & AZF_AC97_REG_UNSUPPORTED) 724 if (reg_azf & AZF_AC97_REG_UNSUPPORTED)
725 unsupported = 1; 725 unsupported = true;
726 else { 726 else {
727 if (reg_azf & AZF_AC97_REG_REAL_IO_READ) 727 if (reg_azf & AZF_AC97_REG_REAL_IO_READ)
728 reg_val = snd_azf3328_mixer_inw(chip, 728 reg_val = snd_azf3328_mixer_inw(chip,
@@ -759,7 +759,7 @@ snd_azf3328_mixer_ac97_read(struct snd_ac97 *ac97, unsigned short reg_ac97)
759 reg_val = azf_emulated_ac97_vendor_id & 0xffff; 759 reg_val = azf_emulated_ac97_vendor_id & 0xffff;
760 break; 760 break;
761 default: 761 default:
762 unsupported = 1; 762 unsupported = true;
763 break; 763 break;
764 } 764 }
765 } 765 }
@@ -776,14 +776,14 @@ snd_azf3328_mixer_ac97_write(struct snd_ac97 *ac97,
776{ 776{
777 const struct snd_azf3328 *chip = ac97->private_data; 777 const struct snd_azf3328 *chip = ac97->private_data;
778 unsigned short reg_azf = snd_azf3328_mixer_ac97_map_reg_idx(reg_ac97); 778 unsigned short reg_azf = snd_azf3328_mixer_ac97_map_reg_idx(reg_ac97);
779 bool unsupported = 0; 779 bool unsupported = false;
780 780
781 snd_azf3328_dbgmixer( 781 snd_azf3328_dbgmixer(
782 "snd_azf3328_mixer_ac97_write reg_ac97 %u val %u\n", 782 "snd_azf3328_mixer_ac97_write reg_ac97 %u val %u\n",
783 reg_ac97, val 783 reg_ac97, val
784 ); 784 );
785 if (reg_azf & AZF_AC97_REG_UNSUPPORTED) 785 if (reg_azf & AZF_AC97_REG_UNSUPPORTED)
786 unsupported = 1; 786 unsupported = true;
787 else { 787 else {
788 if (reg_azf & AZF_AC97_REG_REAL_IO_WRITE) 788 if (reg_azf & AZF_AC97_REG_REAL_IO_WRITE)
789 snd_azf3328_mixer_outw( 789 snd_azf3328_mixer_outw(
@@ -808,7 +808,7 @@ snd_azf3328_mixer_ac97_write(struct snd_ac97 *ac97,
808 */ 808 */
809 break; 809 break;
810 default: 810 default:
811 unsupported = 1; 811 unsupported = true;
812 break; 812 break;
813 } 813 }
814 } 814 }
@@ -1559,7 +1559,7 @@ snd_azf3328_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1559 struct snd_azf3328_codec_data *codec = runtime->private_data; 1559 struct snd_azf3328_codec_data *codec = runtime->private_data;
1560 int result = 0; 1560 int result = 0;
1561 u16 flags1; 1561 u16 flags1;
1562 bool previously_muted = 0; 1562 bool previously_muted = false;
1563 bool is_main_mixer_playback_codec = (AZF_CODEC_PLAYBACK == codec->type); 1563 bool is_main_mixer_playback_codec = (AZF_CODEC_PLAYBACK == codec->type);
1564 1564
1565 snd_azf3328_dbgcalls("snd_azf3328_pcm_trigger cmd %d\n", cmd); 1565 snd_azf3328_dbgcalls("snd_azf3328_pcm_trigger cmd %d\n", cmd);