summaryrefslogtreecommitdiff
path: root/sound/ppc/daca.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-06-08 16:05:38 +0200
committerTakashi Iwai <tiwai@suse.de>2021-06-09 17:30:36 +0200
commite73ad38871cb20bbe1a74306f3798828b4c40175 (patch)
tree803b6afe7aa7ca2e6f2ef0720e40a10c8a56d5c0 /sound/ppc/daca.c
parentdd1fc3c585dddf0f8d1baaa941395aa4afdfa724 (diff)
ALSA: poewrmac: Fix assignment in if condition
PPC powermac driver code contains a few assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-65-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/ppc/daca.c')
-rw-r--r--sound/ppc/daca.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c
index 1eb698dafd93..4da9278dd58a 100644
--- a/sound/ppc/daca.c
+++ b/sound/ppc/daca.c
@@ -84,7 +84,8 @@ static int daca_get_deemphasis(struct snd_kcontrol *kcontrol,
{
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
struct pmac_daca *mix;
- if (! (mix = chip->mixer_data))
+ mix = chip->mixer_data;
+ if (!mix)
return -ENODEV;
ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0;
return 0;
@@ -97,7 +98,8 @@ static int daca_put_deemphasis(struct snd_kcontrol *kcontrol,
struct pmac_daca *mix;
int change;
- if (! (mix = chip->mixer_data))
+ mix = chip->mixer_data;
+ if (!mix)
return -ENODEV;
change = mix->deemphasis != ucontrol->value.integer.value[0];
if (change) {
@@ -123,7 +125,8 @@ static int daca_get_volume(struct snd_kcontrol *kcontrol,
{
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
struct pmac_daca *mix;
- if (! (mix = chip->mixer_data))
+ mix = chip->mixer_data;
+ if (!mix)
return -ENODEV;
ucontrol->value.integer.value[0] = mix->left_vol;
ucontrol->value.integer.value[1] = mix->right_vol;
@@ -138,7 +141,8 @@ static int daca_put_volume(struct snd_kcontrol *kcontrol,
unsigned int vol[2];
int change;
- if (! (mix = chip->mixer_data))
+ mix = chip->mixer_data;
+ if (!mix)
return -ENODEV;
vol[0] = ucontrol->value.integer.value[0];
vol[1] = ucontrol->value.integer.value[1];
@@ -162,7 +166,8 @@ static int daca_get_amp(struct snd_kcontrol *kcontrol,
{
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
struct pmac_daca *mix;
- if (! (mix = chip->mixer_data))
+ mix = chip->mixer_data;
+ if (!mix)
return -ENODEV;
ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0;
return 0;
@@ -175,7 +180,8 @@ static int daca_put_amp(struct snd_kcontrol *kcontrol,
struct pmac_daca *mix;
int change;
- if (! (mix = chip->mixer_data))
+ mix = chip->mixer_data;
+ if (!mix)
return -ENODEV;
change = mix->amp_on != ucontrol->value.integer.value[0];
if (change) {
@@ -248,7 +254,8 @@ int snd_pmac_daca_init(struct snd_pmac *chip)
mix->i2c.addr = DACA_I2C_ADDR;
mix->i2c.init_client = daca_init_client;
mix->i2c.name = "DACA";
- if ((err = snd_pmac_keywest_init(&mix->i2c)) < 0)
+ err = snd_pmac_keywest_init(&mix->i2c);
+ if (err < 0)
return err;
/*
@@ -257,7 +264,8 @@ int snd_pmac_daca_init(struct snd_pmac *chip)
strcpy(chip->card->mixername, "PowerMac DACA");
for (i = 0; i < ARRAY_SIZE(daca_mixers); i++) {
- if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&daca_mixers[i], chip))) < 0)
+ err = snd_ctl_add(chip->card, snd_ctl_new1(&daca_mixers[i], chip));
+ if (err < 0)
return err;
}