Commit 9a303dc7 authored by Joe Perches's avatar Joe Perches Committed by Takashi Iwai

sound: Deparenthesize negative error returns

Make the returns a bit more kernel standard style.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 77008b70
...@@ -79,13 +79,13 @@ wavefront_fx_memset (snd_wavefront_t *dev, ...@@ -79,13 +79,13 @@ wavefront_fx_memset (snd_wavefront_t *dev,
if (page < 0 || page > 7) { if (page < 0 || page > 7) {
snd_printk ("FX memset: " snd_printk ("FX memset: "
"page must be >= 0 and <= 7\n"); "page must be >= 0 and <= 7\n");
return -(EINVAL); return -EINVAL;
} }
if (addr < 0 || addr > 0x7f) { if (addr < 0 || addr > 0x7f) {
snd_printk ("FX memset: " snd_printk ("FX memset: "
"addr must be >= 0 and <= 7f\n"); "addr must be >= 0 and <= 7f\n");
return -(EINVAL); return -EINVAL;
} }
if (cnt == 1) { if (cnt == 1) {
...@@ -118,7 +118,7 @@ wavefront_fx_memset (snd_wavefront_t *dev, ...@@ -118,7 +118,7 @@ wavefront_fx_memset (snd_wavefront_t *dev,
snd_printk ("FX memset " snd_printk ("FX memset "
"(0x%x, 0x%x, 0x%lx, %d) incomplete\n", "(0x%x, 0x%x, 0x%lx, %d) incomplete\n",
page, addr, (unsigned long) data, cnt); page, addr, (unsigned long) data, cnt);
return -(EIO); return -EIO;
} }
} }
......
...@@ -793,7 +793,7 @@ wavefront_send_patch (snd_wavefront_t *dev, wavefront_patch_info *header) ...@@ -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)) { if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PATCH, NULL, buf)) {
snd_printk ("download patch failed\n"); snd_printk ("download patch failed\n");
return -(EIO); return -EIO;
} }
return (0); return (0);
...@@ -831,7 +831,7 @@ wavefront_send_program (snd_wavefront_t *dev, wavefront_patch_info *header) ...@@ -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)) { if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PROGRAM, NULL, buf)) {
snd_printk ("download patch failed\n"); snd_printk ("download patch failed\n");
return -(EIO); return -EIO;
} }
return (0); return (0);
...@@ -952,7 +952,7 @@ wavefront_send_sample (snd_wavefront_t *dev, ...@@ -952,7 +952,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
if (skip > 0 && header->hdr.s.SampleResolution != LINEAR_16BIT) { if (skip > 0 && header->hdr.s.SampleResolution != LINEAR_16BIT) {
snd_printk ("channel selection only " snd_printk ("channel selection only "
"possible on 16-bit samples"); "possible on 16-bit samples");
return -(EINVAL); return -EINVAL;
} }
switch (skip) { switch (skip) {
...@@ -1049,7 +1049,7 @@ wavefront_send_sample (snd_wavefront_t *dev, ...@@ -1049,7 +1049,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
NULL, sample_hdr)) { NULL, sample_hdr)) {
snd_printk ("sample %sdownload refused.\n", snd_printk ("sample %sdownload refused.\n",
header->size ? "" : "header "); header->size ? "" : "header ");
return -(EIO); return -EIO;
} }
if (header->size == 0) { if (header->size == 0) {
...@@ -1075,7 +1075,7 @@ wavefront_send_sample (snd_wavefront_t *dev, ...@@ -1075,7 +1075,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) { if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) {
snd_printk ("download block " snd_printk ("download block "
"request refused.\n"); "request refused.\n");
return -(EIO); return -EIO;
} }
for (i = 0; i < blocksize; i++) { for (i = 0; i < blocksize; i++) {
...@@ -1135,12 +1135,12 @@ wavefront_send_sample (snd_wavefront_t *dev, ...@@ -1135,12 +1135,12 @@ wavefront_send_sample (snd_wavefront_t *dev,
if (dma_ack == -1) { if (dma_ack == -1) {
snd_printk ("upload sample " snd_printk ("upload sample "
"DMA ack timeout\n"); "DMA ack timeout\n");
return -(EIO); return -EIO;
} else { } else {
snd_printk ("upload sample " snd_printk ("upload sample "
"DMA ack error 0x%x\n", "DMA ack error 0x%x\n",
dma_ack); dma_ack);
return -(EIO); return -EIO;
} }
} }
} }
...@@ -1181,7 +1181,7 @@ wavefront_send_alias (snd_wavefront_t *dev, wavefront_patch_info *header) ...@@ -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)) { if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_SAMPLE_ALIAS, NULL, alias_hdr)) {
snd_printk ("download alias failed.\n"); snd_printk ("download alias failed.\n");
return -(EIO); return -EIO;
} }
dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_ALIAS); dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_ALIAS);
...@@ -1232,7 +1232,7 @@ wavefront_send_multisample (snd_wavefront_t *dev, wavefront_patch_info *header) ...@@ -1232,7 +1232,7 @@ wavefront_send_multisample (snd_wavefront_t *dev, wavefront_patch_info *header)
msample_hdr)) { msample_hdr)) {
snd_printk ("download of multisample failed.\n"); snd_printk ("download of multisample failed.\n");
kfree(msample_hdr); kfree(msample_hdr);
return -(EIO); return -EIO;
} }
dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_MULTISAMPLE); dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_MULTISAMPLE);
...@@ -1254,7 +1254,7 @@ wavefront_fetch_multisample (snd_wavefront_t *dev, ...@@ -1254,7 +1254,7 @@ wavefront_fetch_multisample (snd_wavefront_t *dev,
if (snd_wavefront_cmd (dev, WFC_UPLOAD_MULTISAMPLE, log_ns, number)) { if (snd_wavefront_cmd (dev, WFC_UPLOAD_MULTISAMPLE, log_ns, number)) {
snd_printk ("upload multisample failed.\n"); snd_printk ("upload multisample failed.\n");
return -(EIO); return -EIO;
} }
DPRINT (WF_DEBUG_DATA, "msample %d has %d samples\n", DPRINT (WF_DEBUG_DATA, "msample %d has %d samples\n",
...@@ -1273,14 +1273,14 @@ wavefront_fetch_multisample (snd_wavefront_t *dev, ...@@ -1273,14 +1273,14 @@ wavefront_fetch_multisample (snd_wavefront_t *dev,
if ((val = wavefront_read (dev)) == -1) { if ((val = wavefront_read (dev)) == -1) {
snd_printk ("upload multisample failed " snd_printk ("upload multisample failed "
"during sample loop.\n"); "during sample loop.\n");
return -(EIO); return -EIO;
} }
d[0] = val; d[0] = val;
if ((val = wavefront_read (dev)) == -1) { if ((val = wavefront_read (dev)) == -1) {
snd_printk ("upload multisample failed " snd_printk ("upload multisample failed "
"during sample loop.\n"); "during sample loop.\n");
return -(EIO); return -EIO;
} }
d[1] = val; d[1] = val;
...@@ -1315,7 +1315,7 @@ wavefront_send_drum (snd_wavefront_t *dev, wavefront_patch_info *header) ...@@ -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)) { if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_EDRUM_PROGRAM, NULL, drumbuf)) {
snd_printk ("download drum failed.\n"); snd_printk ("download drum failed.\n");
return -(EIO); return -EIO;
} }
return (0); return (0);
......
...@@ -58,13 +58,13 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver, ...@@ -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)) { if (vers != AUDIO_DRIVER_VERSION || driver_size > sizeof(struct audio_driver)) {
printk(KERN_ERR "Sound: Incompatible audio driver for %s\n", name); printk(KERN_ERR "Sound: Incompatible audio driver for %s\n", name);
return -(EINVAL); return -EINVAL;
} }
num = sound_alloc_audiodev(); num = sound_alloc_audiodev();
if (num == -1) { if (num == -1) {
printk(KERN_ERR "sound: Too many audio drivers\n"); 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))); d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver)));
sound_nblocks++; sound_nblocks++;
...@@ -79,7 +79,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver, ...@@ -79,7 +79,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
if (d == NULL || op == NULL) { if (d == NULL || op == NULL) {
printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name); printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name);
sound_unload_audiodev(num); sound_unload_audiodev(num);
return -(ENOMEM); return -ENOMEM;
} }
init_waitqueue_head(&op->in_sleeper); init_waitqueue_head(&op->in_sleeper);
init_waitqueue_head(&op->out_sleeper); init_waitqueue_head(&op->out_sleeper);
......
...@@ -49,13 +49,13 @@ static int v_midi_open (int dev, int mode, ...@@ -49,13 +49,13 @@ static int v_midi_open (int dev, int mode,
unsigned long flags; unsigned long flags;
if (devc == NULL) if (devc == NULL)
return -(ENXIO); return -ENXIO;
spin_lock_irqsave(&devc->lock,flags); spin_lock_irqsave(&devc->lock,flags);
if (devc->opened) if (devc->opened)
{ {
spin_unlock_irqrestore(&devc->lock,flags); spin_unlock_irqrestore(&devc->lock,flags);
return -(EBUSY); return -EBUSY;
} }
devc->opened = 1; devc->opened = 1;
spin_unlock_irqrestore(&devc->lock,flags); spin_unlock_irqrestore(&devc->lock,flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment