Skip to contentSkip to conversation

Remove pointless code from ALSA emu10k1 midi driver.

PATCH In review Dave Jones 2 participants 2 messages Sep 1, 2004 Sound

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

PATCH 1/1 Remove pointless code from ALSA emu10k1 midi driver.

Spotted with the source checker from Coverity.com.

sound/oss/emu10k1/midi.c +1 -2
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/sound/oss/emu10k1/midi.c linux-2.6/sound/oss/emu10k1/midi.c
@@ -320,7 +320,6 @@ static ssize_t emu10k1_midi_write(struct
 {
 	struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
 	struct midi_hdr *midihdr;
-	ssize_t ret = 0;
 	unsigned long flags;
 
 	DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count);
@@ -344,7 +343,7 @@ static ssize_t emu10k1_midi_write(struct
 	if (copy_from_user(midihdr->data, buffer, count)) {
 		kfree(midihdr->data);
 		kfree(midihdr);
-		return ret ? ret : -EFAULT;
+		return -EFAULT;
 	}
 
 	spin_lock_irqsave(&midi_spinlock, flags);
#1 lore raw

Well it's not ALSA emu10k1 but OSS ;)

Takashi

At Wed, 1 Sep 2004 16:51:22 +0100,

Quoted 32 lines · Dave Jones

Spotted with the source checker from Coverity.com.

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/sound/oss/emu10k1/midi.c linux-2.6/sound/oss/emu10k1/midi.c

sound/oss/emu10k1/midi.c +1 -3
@@ -320,7 +320,6 @@ static ssize_t emu10k1_midi_write(struct
 {
 	struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
 	struct midi_hdr *midihdr;
-	ssize_t ret = 0;
 	unsigned long flags;
 
 	DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count);
@@ -344,7 +343,7 @@ static ssize_t emu10k1_midi_write(struct
 	if (copy_from_user(midihdr->data, buffer, count)) {
 		kfree(midihdr->data);
 		kfree(midihdr);
-		return ret ? ret : -EFAULT;
+		return -EFAULT;
 	}
 
 	spin_lock_irqsave(&midi_spinlock, flags);
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/