Skip to content

Commit

Permalink
sound: Deparenthesize negative error returns
Browse files Browse the repository at this point in the history
Make the returns a bit more kernel standard style.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Joe Perches authored and Takashi Iwai committed Mar 24, 2015
1 parent 77008b7 commit 9a303dc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions sound/isa/wavefront/wavefront_fx.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ wavefront_fx_memset (snd_wavefront_t *dev,
if (page < 0 || page > 7) {
snd_printk ("FX memset: "
"page must be >= 0 and <= 7\n");
return -(EINVAL);
return -EINVAL;
}

if (addr < 0 || addr > 0x7f) {
snd_printk ("FX memset: "
"addr must be >= 0 and <= 7f\n");
return -(EINVAL);
return -EINVAL;
}

if (cnt == 1) {
Expand Down Expand Up @@ -118,7 +118,7 @@ wavefront_fx_memset (snd_wavefront_t *dev,
snd_printk ("FX memset "
"(0x%x, 0x%x, 0x%lx, %d) incomplete\n",
page, addr, (unsigned long) data, cnt);
return -(EIO);
return -EIO;
}
}

Expand Down
26 changes: 13 additions & 13 deletions sound/isa/wavefront/wavefront_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ wavefront_send_patch (snd_wavefront_t *dev, wavefront_patch_info *header)

if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PATCH, NULL, buf)) {
snd_printk ("download patch failed\n");
return -(EIO);
return -EIO;
}

return (0);
Expand Down Expand Up @@ -831,7 +831,7 @@ wavefront_send_program (snd_wavefront_t *dev, wavefront_patch_info *header)

if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PROGRAM, NULL, buf)) {
snd_printk ("download patch failed\n");
return -(EIO);
return -EIO;
}

return (0);
Expand Down Expand Up @@ -952,7 +952,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
if (skip > 0 && header->hdr.s.SampleResolution != LINEAR_16BIT) {
snd_printk ("channel selection only "
"possible on 16-bit samples");
return -(EINVAL);
return -EINVAL;
}

switch (skip) {
Expand Down Expand Up @@ -1049,7 +1049,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
NULL, sample_hdr)) {
snd_printk ("sample %sdownload refused.\n",
header->size ? "" : "header ");
return -(EIO);
return -EIO;
}

if (header->size == 0) {
Expand All @@ -1075,7 +1075,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) {
snd_printk ("download block "
"request refused.\n");
return -(EIO);
return -EIO;
}

for (i = 0; i < blocksize; i++) {
Expand Down Expand Up @@ -1135,12 +1135,12 @@ wavefront_send_sample (snd_wavefront_t *dev,
if (dma_ack == -1) {
snd_printk ("upload sample "
"DMA ack timeout\n");
return -(EIO);
return -EIO;
} else {
snd_printk ("upload sample "
"DMA ack error 0x%x\n",
dma_ack);
return -(EIO);
return -EIO;
}
}
}
Expand Down Expand Up @@ -1181,7 +1181,7 @@ wavefront_send_alias (snd_wavefront_t *dev, wavefront_patch_info *header)

if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_SAMPLE_ALIAS, NULL, alias_hdr)) {
snd_printk ("download alias failed.\n");
return -(EIO);
return -EIO;
}

dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_ALIAS);
Expand Down Expand Up @@ -1232,7 +1232,7 @@ wavefront_send_multisample (snd_wavefront_t *dev, wavefront_patch_info *header)
msample_hdr)) {
snd_printk ("download of multisample failed.\n");
kfree(msample_hdr);
return -(EIO);
return -EIO;
}

dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_MULTISAMPLE);
Expand All @@ -1254,7 +1254,7 @@ wavefront_fetch_multisample (snd_wavefront_t *dev,

if (snd_wavefront_cmd (dev, WFC_UPLOAD_MULTISAMPLE, log_ns, number)) {
snd_printk ("upload multisample failed.\n");
return -(EIO);
return -EIO;
}

DPRINT (WF_DEBUG_DATA, "msample %d has %d samples\n",
Expand All @@ -1273,14 +1273,14 @@ wavefront_fetch_multisample (snd_wavefront_t *dev,
if ((val = wavefront_read (dev)) == -1) {
snd_printk ("upload multisample failed "
"during sample loop.\n");
return -(EIO);
return -EIO;
}
d[0] = val;

if ((val = wavefront_read (dev)) == -1) {
snd_printk ("upload multisample failed "
"during sample loop.\n");
return -(EIO);
return -EIO;
}
d[1] = val;

Expand Down Expand Up @@ -1315,7 +1315,7 @@ wavefront_send_drum (snd_wavefront_t *dev, wavefront_patch_info *header)

if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_EDRUM_PROGRAM, NULL, drumbuf)) {
snd_printk ("download drum failed.\n");
return -(EIO);
return -EIO;
}

return (0);
Expand Down
6 changes: 3 additions & 3 deletions sound/oss/dev_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,

if (vers != AUDIO_DRIVER_VERSION || driver_size > sizeof(struct audio_driver)) {
printk(KERN_ERR "Sound: Incompatible audio driver for %s\n", name);
return -(EINVAL);
return -EINVAL;
}
num = sound_alloc_audiodev();

if (num == -1) {
printk(KERN_ERR "sound: Too many audio drivers\n");
return -(EBUSY);
return -EBUSY;
}
d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver)));
sound_nblocks++;
Expand All @@ -79,7 +79,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
if (d == NULL || op == NULL) {
printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name);
sound_unload_audiodev(num);
return -(ENOMEM);
return -ENOMEM;
}
init_waitqueue_head(&op->in_sleeper);
init_waitqueue_head(&op->out_sleeper);
Expand Down
4 changes: 2 additions & 2 deletions sound/oss/v_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ static int v_midi_open (int dev, int mode,
unsigned long flags;

if (devc == NULL)
return -(ENXIO);
return -ENXIO;

spin_lock_irqsave(&devc->lock,flags);
if (devc->opened)
{
spin_unlock_irqrestore(&devc->lock,flags);
return -(EBUSY);
return -EBUSY;
}
devc->opened = 1;
spin_unlock_irqrestore(&devc->lock,flags);
Expand Down

0 comments on commit 9a303dc

Please sign in to comment.