summaryrefslogtreecommitdiff
path: root/sound/pci/ad1889.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-06-08 16:04:49 +0200
committerTakashi Iwai <tiwai@suse.de>2021-06-09 17:29:49 +0200
commite2e30a32f34a08507125fbbc82d2589446cf8fe9 (patch)
tree79a5272a5ad957d5c04c28a6d226db1d5f7ecf02 /sound/pci/ad1889.c
parenteb767949f709aeca0b21232ecc456d2f4bd9a419 (diff)
ALSA: ad1889: Fix assignment in if condition
PCI AD1889 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-16-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ad1889.c')
-rw-r--r--sound/pci/ad1889.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index 4520022801d9..5c78951dd596 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -852,7 +852,8 @@ snd_ad1889_create(struct snd_card *card,
*rchip = NULL;
- if ((err = pci_enable_device(pci)) < 0)
+ err = pci_enable_device(pci);
+ if (err < 0)
return err;
/* check PCI availability (32bit DMA) */
@@ -863,7 +864,8 @@ snd_ad1889_create(struct snd_card *card,
}
/* allocate chip specific data with zero-filled memory */
- if ((chip = kzalloc(sizeof(*chip), GFP_KERNEL)) == NULL) {
+ chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+ if (!chip) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -874,7 +876,8 @@ snd_ad1889_create(struct snd_card *card,
chip->irq = -1;
/* (1) PCI resource allocation */
- if ((err = pci_request_regions(pci, card->driver)) < 0)
+ err = pci_request_regions(pci, card->driver);
+ if (err < 0)
goto free_and_ret;
chip->bar = pci_resource_start(pci, 0);
@@ -900,12 +903,14 @@ snd_ad1889_create(struct snd_card *card,
card->sync_irq = chip->irq;
/* (2) initialization of the chip hardware */
- if ((err = snd_ad1889_init(chip)) < 0) {
+ err = snd_ad1889_init(chip);
+ if (err < 0) {
snd_ad1889_free(chip);
return err;
}
- if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
+ if (err < 0) {
snd_ad1889_free(chip);
return err;
}