Ignore:
Timestamp:
Sep 26, 2021, 6:18:40 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from next branch.

Location:
GPL/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1.c

    r695 r703  
    122122        else if (max_buffer_size[dev] > 1024)
    123123                max_buffer_size[dev] = 1024;
    124         if ((err = snd_emu10k1_create(card, pci, extin[dev], extout[dev],
    125                                       (long)max_buffer_size[dev] * 1024 * 1024,
    126                                       enable_ir[dev], subsystem[dev],
    127                                       &emu)) < 0)
     124        err = snd_emu10k1_create(card, pci, extin[dev], extout[dev],
     125                                 (long)max_buffer_size[dev] * 1024 * 1024,
     126                                 enable_ir[dev], subsystem[dev],
     127                                 &emu);
     128        if (err < 0)
    128129                goto error;
    129130        card->private_data = emu;
    130131        emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f;
    131         if ((err = snd_emu10k1_pcm(emu, 0)) < 0)
    132                 goto error;
    133         if ((err = snd_emu10k1_pcm_mic(emu, 1)) < 0)
    134                 goto error;
    135         if ((err = snd_emu10k1_pcm_efx(emu, 2)) < 0)
     132        err = snd_emu10k1_pcm(emu, 0);
     133        if (err < 0)
     134                goto error;
     135        err = snd_emu10k1_pcm_mic(emu, 1);
     136        if (err < 0)
     137                goto error;
     138        err = snd_emu10k1_pcm_efx(emu, 2);
     139        if (err < 0)
    136140                goto error;
    137141        /* This stores the periods table. */
     
    143147        }
    144148
    145         if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0)
     149        err = snd_emu10k1_mixer(emu, 0, 3);
     150        if (err < 0)
    146151                goto error;
    147152       
    148         if ((err = snd_emu10k1_timer(emu, 0)) < 0)
    149                 goto error;
    150 
    151         if ((err = snd_emu10k1_pcm_multi(emu, 3)) < 0)
     153        err = snd_emu10k1_timer(emu, 0);
     154        if (err < 0)
     155                goto error;
     156
     157        err = snd_emu10k1_pcm_multi(emu, 3);
     158        if (err < 0)
    152159                goto error;
    153160        if (emu->card_capabilities->ca0151_chip) { /* P16V */
    154                 if ((err = snd_p16v_pcm(emu, 4)) < 0)
     161                err = snd_p16v_pcm(emu, 4);
     162                if (err < 0)
    155163                        goto error;
    156164        }
    157165        if (emu->audigy) {
    158                 if ((err = snd_emu10k1_audigy_midi(emu)) < 0)
     166                err = snd_emu10k1_audigy_midi(emu);
     167                if (err < 0)
    159168                        goto error;
    160169        } else {
    161                 if ((err = snd_emu10k1_midi(emu)) < 0)
    162                         goto error;
    163         }
    164         if ((err = snd_emu10k1_fx8010_new(emu, 0)) < 0)
     170                err = snd_emu10k1_midi(emu);
     171                if (err < 0)
     172                        goto error;
     173        }
     174        err = snd_emu10k1_fx8010_new(emu, 0);
     175        if (err < 0)
    165176                goto error;
    166177#ifdef ENABLE_SYNTH
     
    189200                 card->shortname, emu->revision, emu->serial, emu->port, emu->irq);
    190201
    191         if ((err = snd_card_register(card)) < 0)
     202        err = snd_card_register(card);
     203        if (err < 0)
    192204                goto error;
    193205
  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_callback.c

    r679 r703  
    9191                        int ch;
    9292                        vp = &emu->voices[best[i].voice];
    93                         if ((ch = vp->ch) < 0) {
     93                        ch = vp->ch;
     94                        if (ch < 0) {
    9495                                /*
    9596                                dev_warn(emu->card->dev,
  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1x.c

    r695 r703  
    353353        struct emu10k1x_pcm *epcm;
    354354
    355         if ((epcm = voice->epcm) == NULL)
     355        epcm = voice->epcm;
     356        if (!epcm)
    356357                return;
    357358        if (epcm->substream == NULL)
     
    375376        int err;
    376377
    377         if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) {
    378                 return err;
    379         }
    380         if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
     378        err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
     379        if (err < 0)
     380                return err;
     381        err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
     382        if (err < 0)
    381383                return err;
    382384
     
    554556        int err;
    555557
    556         if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
    557                 return err;
    558         if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
    559                 return err;
     558        err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
     559        if (err < 0)
     560                return err;
     561        err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
     562        if (err < 0)
     563                return err;
    560564
    561565        epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
     
    726730        };
    727731 
    728         if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
     732        err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus);
     733        if (err < 0)
    729734                return err;
    730735        pbus->no_vra = 1; /* we don't need VRA */
     
    842847                capture = 1;
    843848       
    844         if ((err = snd_pcm_new(emu->card, "emu10k1x", device, 1, capture, &pcm)) < 0)
     849        err = snd_pcm_new(emu->card, "emu10k1x", device, 1, capture, &pcm);
     850        if (err < 0)
    845851                return err;
    846852 
     
    895901        *rchip = NULL;
    896902
    897         if ((err = pci_enable_device(pci)) < 0)
     903        err = pci_enable_device(pci);
     904        if (err < 0)
    898905                return err;
    899906
     
    918925 
    919926        chip->port = pci_resource_start(pci, 0);
    920         if ((chip->res_port = request_region(chip->port, 8,
    921                                              "EMU10K1X")) == NULL) {
     927        chip->res_port = request_region(chip->port, 8, "EMU10K1X");
     928        if (!chip->res_port) {
    922929                dev_err(card->dev, "cannot allocate the port 0x%lx\n",
    923930                        chip->port);
     
    9991006        outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
    10001007
    1001         if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
    1002                                   chip, &ops)) < 0) {
     1008        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
     1009        if (err < 0) {
    10031010                snd_emu10k1x_free(chip);
    10041011                return err;
     
    11791186        struct snd_card *card = emu->card;
    11801187
    1181         if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu)) == NULL)
     1188        kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu);
     1189        if (!kctl)
    11821190                return -ENOMEM;
    1183         if ((err = snd_ctl_add(card, kctl)))
    1184                 return err;
    1185         if ((kctl = snd_ctl_new1(&snd_emu10k1x_shared_spdif, emu)) == NULL)
     1191        err = snd_ctl_add(card, kctl);
     1192        if (err)
     1193                return err;
     1194        kctl = snd_ctl_new1(&snd_emu10k1x_shared_spdif, emu);
     1195        if (!kctl)
    11861196                return -ENOMEM;
    1187         if ((err = snd_ctl_add(card, kctl)))
    1188                 return err;
    1189         if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_control, emu)) == NULL)
     1197        err = snd_ctl_add(card, kctl);
     1198        if (err)
     1199                return err;
     1200        kctl = snd_ctl_new1(&snd_emu10k1x_spdif_control, emu);
     1201        if (!kctl)
    11901202                return -ENOMEM;
    1191         if ((err = snd_ctl_add(card, kctl)))
     1203        err = snd_ctl_add(card, kctl);
     1204        if (err)
    11921205                return err;
    11931206
     
    14961509        int err;
    14971510
    1498         if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0)
     1511        err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi);
     1512        if (err < 0)
    14991513                return err;
    15001514        midi->emu = emu;
     
    15191533        int err;
    15201534
    1521         if ((err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)")) < 0)
     1535        err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)");
     1536        if (err < 0)
    15221537                return err;
    15231538
     
    15511566                return err;
    15521567
    1553         if ((err = snd_emu10k1x_create(card, pci, &chip)) < 0) {
     1568        err = snd_emu10k1x_create(card, pci, &chip);
     1569        if (err < 0) {
    15541570                snd_card_free(card);
    15551571                return err;
    15561572        }
    15571573
    1558         if ((err = snd_emu10k1x_pcm(chip, 0)) < 0) {
     1574        err = snd_emu10k1x_pcm(chip, 0);
     1575        if (err < 0) {
    15591576                snd_card_free(card);
    15601577                return err;
    15611578        }
    1562         if ((err = snd_emu10k1x_pcm(chip, 1)) < 0) {
     1579        err = snd_emu10k1x_pcm(chip, 1);
     1580        if (err < 0) {
    15631581                snd_card_free(card);
    15641582                return err;
    15651583        }
    1566         if ((err = snd_emu10k1x_pcm(chip, 2)) < 0) {
     1584        err = snd_emu10k1x_pcm(chip, 2);
     1585        if (err < 0) {
    15671586                snd_card_free(card);
    15681587                return err;
    15691588        }
    15701589
    1571         if ((err = snd_emu10k1x_ac97(chip)) < 0) {
     1590        err = snd_emu10k1x_ac97(chip);
     1591        if (err < 0) {
    15721592                snd_card_free(card);
    15731593                return err;
    15741594        }
    15751595
    1576         if ((err = snd_emu10k1x_mixer(chip)) < 0) {
     1596        err = snd_emu10k1x_mixer(chip);
     1597        if (err < 0) {
    15771598                snd_card_free(card);
    15781599                return err;
    15791600        }
    15801601       
    1581         if ((err = snd_emu10k1x_midi(chip)) < 0) {
     1602        err = snd_emu10k1x_midi(chip);
     1603        if (err < 0) {
    15821604                snd_card_free(card);
    15831605                return err;
     
    15911613                card->shortname, chip->port, chip->irq);
    15921614
    1593         if ((err = snd_card_register(card)) < 0) {
     1615        err = snd_card_register(card);
     1616        if (err < 0) {
    15941617                snd_card_free(card);
    15951618                return err;
  • GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c

    r695 r703  
    438438       
    439439        spin_lock_irqsave(&emu->fx8010.irq_lock, flags);
    440         if ((tmp = emu->fx8010.irq_handlers) == irq) {
     440        tmp = emu->fx8010.irq_handlers;
     441        if (tmp == irq) {
    441442                emu->fx8010.irq_handlers = tmp->next;
    442443                if (emu->fx8010.irq_handlers == NULL) {
     
    873874                        knew.private_value = (unsigned long)ctl;
    874875                        *ctl = *nctl;
    875                         if ((err = snd_ctl_add(emu->card, kctl = snd_ctl_new1(&knew, emu))) < 0) {
     876                        kctl = snd_ctl_new1(&knew, emu);
     877                        err = snd_ctl_add(emu->card, kctl);
     878                        if (err < 0) {
    876879                                kfree(ctl);
    877880                                kfree(knew.tlv.p);
     
    24052408                OP(icode, &ptr, iACC3, C_00000000, C_00000000, C_00000000, C_00000000);
    24062409
    2407         if ((err = snd_emu10k1_fx8010_tram_setup(emu, ipcm->buffer_size)) < 0)
     2410        err = snd_emu10k1_fx8010_tram_setup(emu, ipcm->buffer_size);
     2411        if (err < 0)
    24082412                goto __err;
    24092413        icode->gpr_add_control_count = i;
     
    26832687        int err;
    26842688       
    2685         if ((err = snd_hwdep_new(emu->card, "FX8010", device, &hw)) < 0)
     2689        err = snd_hwdep_new(emu->card, "FX8010", device, &hw);
     2690        if (err < 0)
    26862691                return err;
    26872692        strcpy(hw->name, "EMU10K1 (FX8010)");
  • GPL/trunk/alsa-kernel/pci/emu10k1/emumixer.c

    r679 r703  
    11201120        tmp = reg & ~A_SPDIF_RATE_MASK;
    11211121        tmp |= val;
    1122         if ((change = (tmp != reg)))
     1122        change = (tmp != reg);
     1123        if (change)
    11231124                snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, 0, tmp);
    11241125        spin_unlock_irqrestore(&emu->reg_lock, flags);
     
    19041905                };
    19051906
    1906                 if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0)
     1907                err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus);
     1908                if (err < 0)
    19071909                        return err;
    19081910                pbus->no_vra = 1; /* we don't need VRA */
     
    19121914                ac97.private_free = snd_emu10k1_mixer_free_ac97;
    19131915                ac97.scaps = AC97_SCAP_NO_SPDIF;
    1914                 if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) {
     1916                err = snd_ac97_mixer(pbus, &ac97, &emu->ac97);
     1917                if (err < 0) {
    19151918                        if (emu->card_capabilities->ac97_chip == 1)
    19161919                                return err;
     
    19921995                rename_ctl(card, "Mic Capture Volume", "Unknown1 Capture Volume");
    19931996        }
    1994         if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
     1997        kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu);
     1998        if (!kctl)
    19951999                return -ENOMEM;
    19962000        kctl->id.device = pcm_device;
    1997         if ((err = snd_ctl_add(card, kctl)))
     2001        err = snd_ctl_add(card, kctl);
     2002        if (err)
    19982003                return err;
    1999         if ((kctl = emu->ctl_send_volume = snd_ctl_new1(&snd_emu10k1_send_volume_control, emu)) == NULL)
     2004        kctl = emu->ctl_send_volume = snd_ctl_new1(&snd_emu10k1_send_volume_control, emu);
     2005        if (!kctl)
    20002006                return -ENOMEM;
    20012007        kctl->id.device = pcm_device;
    2002         if ((err = snd_ctl_add(card, kctl)))
     2008        err = snd_ctl_add(card, kctl);
     2009        if (err)
    20032010                return err;
    2004         if ((kctl = emu->ctl_attn = snd_ctl_new1(&snd_emu10k1_attn_control, emu)) == NULL)
     2011        kctl = emu->ctl_attn = snd_ctl_new1(&snd_emu10k1_attn_control, emu);
     2012        if (!kctl)
    20052013                return -ENOMEM;
    20062014        kctl->id.device = pcm_device;
    2007         if ((err = snd_ctl_add(card, kctl)))
     2015        err = snd_ctl_add(card, kctl);
     2016        if (err)
    20082017                return err;
    20092018
    2010         if ((kctl = emu->ctl_efx_send_routing = snd_ctl_new1(&snd_emu10k1_efx_send_routing_control, emu)) == NULL)
     2019        kctl = emu->ctl_efx_send_routing = snd_ctl_new1(&snd_emu10k1_efx_send_routing_control, emu);
     2020        if (!kctl)
    20112021                return -ENOMEM;
    20122022        kctl->id.device = multi_device;
    2013         if ((err = snd_ctl_add(card, kctl)))
     2023        err = snd_ctl_add(card, kctl);
     2024        if (err)
    20142025                return err;
    20152026       
    2016         if ((kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu)) == NULL)
     2027        kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu);
     2028        if (!kctl)
    20172029                return -ENOMEM;
    20182030        kctl->id.device = multi_device;
    2019         if ((err = snd_ctl_add(card, kctl)))
     2031        err = snd_ctl_add(card, kctl);
     2032        if (err)
    20202033                return err;
    20212034       
    2022         if ((kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu)) == NULL)
     2035        kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu);
     2036        if (!kctl)
    20232037                return -ENOMEM;
    20242038        kctl->id.device = multi_device;
    2025         if ((err = snd_ctl_add(card, kctl)))
     2039        err = snd_ctl_add(card, kctl);
     2040        if (err)
    20262041                return err;
    20272042
     
    20702085        if (! emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */
    20712086                /* sb live! and audigy */
    2072                 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
     2087                kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu);
     2088                if (!kctl)
    20732089                        return -ENOMEM;
    20742090                if (!emu->audigy)
    20752091                        kctl->id.device = emu->pcm_efx->device;
    2076                 if ((err = snd_ctl_add(card, kctl)))
     2092                err = snd_ctl_add(card, kctl);
     2093                if (err)
    20772094                        return err;
    2078                 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
     2095                kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu);
     2096                if (!kctl)
    20792097                        return -ENOMEM;
    20802098                if (!emu->audigy)
    20812099                        kctl->id.device = emu->pcm_efx->device;
    2082                 if ((err = snd_ctl_add(card, kctl)))
     2100                err = snd_ctl_add(card, kctl);
     2101                if (err)
    20832102                        return err;
    20842103        }
     
    20872106                ;  /* Disable the snd_audigy_spdif_shared_spdif */
    20882107        } else if (emu->audigy) {
    2089                 if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL)
     2108                kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu);
     2109                if (!kctl)
    20902110                        return -ENOMEM;
    2091                 if ((err = snd_ctl_add(card, kctl)))
     2111                err = snd_ctl_add(card, kctl);
     2112                if (err)
    20922113                        return err;
    20932114#if 0
    2094                 if ((kctl = snd_ctl_new1(&snd_audigy_spdif_output_rate, emu)) == NULL)
     2115                kctl = snd_ctl_new1(&snd_audigy_spdif_output_rate, emu);
     2116                if (!kctl)
    20952117                        return -ENOMEM;
    2096                 if ((err = snd_ctl_add(card, kctl)))
     2118                err = snd_ctl_add(card, kctl);
     2119                if (err)
    20972120                        return err;
    20982121#endif
    20992122        } else if (! emu->card_capabilities->ecard) {
    21002123                /* sb live! */
    2101                 if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL)
     2124                kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu);
     2125                if (!kctl)
    21022126                        return -ENOMEM;
    2103                 if ((err = snd_ctl_add(card, kctl)))
     2127                err = snd_ctl_add(card, kctl);
     2128                if (err)
    21042129                        return err;
    21052130        }
    21062131        if (emu->card_capabilities->ca0151_chip) { /* P16V */
    2107                 if ((err = snd_p16v_mixer(emu)))
     2132                err = snd_p16v_mixer(emu);
     2133                if (err)
    21082134                        return err;
    21092135        }
  • GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c

    r679 r703  
    320320        int err;
    321321
    322         if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0)
     322        err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi);
     323        if (err < 0)
    323324                return err;
    324325        midi->emu = emu;
     
    343344        int err;
    344345
    345         if ((err = emu10k1_midi_init(emu, midi, 0, "EMU10K1 MPU-401 (UART)")) < 0)
     346        err = emu10k1_midi_init(emu, midi, 0, "EMU10K1 MPU-401 (UART)");
     347        if (err < 0)
    346348                return err;
    347349
     
    361363
    362364        midi = &emu->midi;
    363         if ((err = emu10k1_midi_init(emu, midi, 0, "Audigy MPU-401 (UART)")) < 0)
     365        err = emu10k1_midi_init(emu, midi, 0, "Audigy MPU-401 (UART)");
     366        if (err < 0)
    364367                return err;
    365368
     
    372375
    373376        midi = &emu->midi2;
    374         if ((err = emu10k1_midi_init(emu, midi, 1, "Audigy MPU-401 #2")) < 0)
     377        err = emu10k1_midi_init(emu, midi, 1, "Audigy MPU-401 #2");
     378        if (err < 0)
    375379                return err;
    376380
  • GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c

    r679 r703  
    2626        struct snd_emu10k1_pcm *epcm;
    2727
    28         if ((epcm = voice->epcm) == NULL)
     28        epcm = voice->epcm;
     29        if (!epcm)
    2930                return;
    3031        if (epcm->substream == NULL)
     
    400401        int err;
    401402
    402         if ((err = snd_emu10k1_pcm_channel_alloc(epcm, params_channels(hw_params))) < 0)
     403        err = snd_emu10k1_pcm_channel_alloc(epcm, params_channels(hw_params));
     404        if (err < 0)
    403405                return err;
    404406
     
    11251127        runtime->private_free = snd_emu10k1_pcm_free_substream;
    11261128        runtime->hw = snd_emu10k1_playback;
    1127         if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) {
     1129        err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
     1130        if (err < 0) {
    11281131                kfree(epcm);
    11291132                return err;
    11301133        }
    1131         if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0) {
     1134        err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX);
     1135        if (err < 0) {
    11321136                kfree(epcm);
    11331137                return err;
     
    13811385        int err;
    13821386
    1383         if ((err = snd_pcm_new(emu->card, "emu10k1", device, 32, 1, &pcm)) < 0)
     1387        err = snd_pcm_new(emu->card, "emu10k1", device, 32, 1, &pcm);
     1388        if (err < 0)
    13841389                return err;
    13851390
     
    14131418        int err;
    14141419
    1415         if ((err = snd_pcm_new(emu->card, "emu10k1", device, 1, 0, &pcm)) < 0)
     1420        err = snd_pcm_new(emu->card, "emu10k1", device, 1, 0, &pcm);
     1421        if (err < 0)
    14161422                return err;
    14171423
     
    14471453        int err;
    14481454
    1449         if ((err = snd_pcm_new(emu->card, "emu10k1 mic", device, 0, 1, &pcm)) < 0)
     1455        err = snd_pcm_new(emu->card, "emu10k1 mic", device, 0, 1, &pcm);
     1456        if (err < 0)
    14501457                return err;
    14511458
     
    17751782        int err;
    17761783
    1777         if ((err = snd_pcm_new(emu->card, "emu10k1 efx", device, 8, 1, &pcm)) < 0)
     1784        err = snd_pcm_new(emu->card, "emu10k1 efx", device, 8, 1, &pcm);
     1785        if (err < 0)
    17781786                return err;
    17791787
  • GPL/trunk/alsa-kernel/pci/emu10k1/memory.c

    r695 r703  
    170170
    171171        /* calculate the expected size of empty region */
    172         if ((p = blk->mapped_link.prev) != &emu->mapped_link_head) {
     172        p = blk->mapped_link.prev;
     173        if (p != &emu->mapped_link_head) {
    173174                q = get_emu10k1_memblk(p, mapped_link);
    174175                start_page = q->mapped_page + q->pages;
    175         } else
     176        } else {
    176177                start_page = 1;
    177         if ((p = blk->mapped_link.next) != &emu->mapped_link_head) {
     178        }
     179        p = blk->mapped_link.next;
     180        if (p != &emu->mapped_link_head) {
    178181                q = get_emu10k1_memblk(p, mapped_link);
    179182                end_page = q->mapped_page;
    180         } else
     183        } else {
    181184                end_page = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0);
     185        }
    182186
    183187        /* remove links */
     
    268272                return 0;
    269273        }
    270         if ((err = map_memblk(emu, blk)) < 0) {
     274        err = map_memblk(emu, blk);
     275        if (err < 0) {
    271276                /* no enough page - try to unmap some blocks */
    272277                /* starting from the oldest block */
     
    455460        int first_page, last_page;
    456461        first_page = blk->first_page;
    457         if ((p = blk->mem.list.prev) != &hdr->block) {
     462        p = blk->mem.list.prev;
     463        if (p != &hdr->block) {
    458464                q = get_emu10k1_memblk(p, mem.list);
    459465                if (q->last_page == first_page)
     
    461467        }
    462468        last_page = blk->last_page;
    463         if ((p = blk->mem.list.next) != &hdr->block) {
     469        p = blk->mem.list.next;
     470        if (p != &hdr->block) {
    464471                q = get_emu10k1_memblk(p, mem.list);
    465472                if (q->first_page == last_page)
  • GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c

    r679 r703  
    195195        /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
    196196        channel->epcm = epcm;
    197         if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
     197        err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
     198        if (err < 0)
    198199                return err;
    199200
     
    243244        /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
    244245        channel->epcm = epcm;
    245         if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
     246        err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
     247        if (err < 0)
    246248                return err;
    247249
     
    590592        emu->p16v_device_offset = device;
    591593
    592         if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0)
     594        err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm);
     595        if (err < 0)
    593596                return err;
    594597 
     
    809812
    810813        for (i = 0; i < ARRAY_SIZE(p16v_mixer_controls); i++) {
    811                 if ((err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i],
    812                                                           emu))) < 0)
     814                err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i], emu));
     815                if (err < 0)
    813816                        return err;
    814817        }
  • GPL/trunk/alsa-kernel/pci/emu10k1/timer.c

    r679 r703  
    7373        tid.device = device;
    7474        tid.subdevice = 0;
    75         if ((err = snd_timer_new(emu->card, "EMU10K1", &tid, &timer)) >= 0) {
     75        err = snd_timer_new(emu->card, "EMU10K1", &tid, &timer);
     76        if (err >= 0) {
    7677                strcpy(timer->name, "EMU10K1 timer");
    7778                timer->private_data = emu;
Note: See TracChangeset for help on using the changeset viewer.