Skip to contentSkip to conversation

sound/core/oss/pcm_plugin.c: kill dead code

PATCH In review Adrian Bunk 2 participants 3 messages Mar 23, 2005 – Mar 24, 2005 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/core/oss/pcm_plugin.c: kill dead code

The Coverity checker found this obviously dead code.

I'mnot sure which of the if (plugin == NULL) is correct - this patch removes the one that couldn't be true.

sound/core/oss/pcm_plugin.c renamed from sound/core/oss/pcm_plugin.c.old +1 -4
@@ -657,22 +657,19 @@ static int snd_pcm_plug_playback_channel
 	if (plugin == NULL) {
 		return 0;
 	} else {
 		int schannels = plugin->dst_format.channels;
 		bitset_t bs[bitset_size(schannels)];
 		bitset_t *srcmask;
 		bitset_t *dstmask = bs;
 		int err;
 		bitset_one(dstmask, schannels);
-		if (plugin == NULL) {
-			bitset_and(client_vmask, dstmask, schannels);
-			return 0;
-		}
+
 		while (1) {
 			err = plugin->src_channels_mask(plugin, dstmask, &srcmask);
 			if (err < 0)
 				return err;
 			dstmask = srcmask;
 			if (plugin->prev == NULL)
 				break;
 			plugin = plugin->prev;
 		}

-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click

#1 lore raw

At Thu, 24 Mar 2005 00:41:28 +0100,

Quoted 7 lines · Adrian Bunk

The Coverity checker found this obviously dead code.

I'mnot sure which of the if (plugin == NULL) is correct - this patch removes the one that couldn't be true.

Thanks, I applied it to ALSA tree.

Takashi

#2 lore raw
In reply to Adrian Bunk

At Thu, 24 Mar 2005 00:41:28 +0100,

Quoted 7 lines · Adrian Bunk

The Coverity checker found this obviously dead code.

I'mnot sure which of the if (plugin == NULL) is correct - this patch removes the one that couldn't be true.

Thanks, I applied it to ALSA tree.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click