Skip to contentSkip to conversation

ALSA: oss: Remove redundant assignment to src_access

PATCH In review Jiapeng Chong 2 participants 2 messages Jun 15, 2021 – Jun 16, 2021 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: oss: Remove redundant assignment to src_access

Variable src_access is set to 'dst_access', but this value is never read as it is not used later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

sound/core/oss/pcm_plugin.c:472:4: warning: Value stored to 'src_access' is never read [clang-analyzer-deadcode.DeadStores].

---
 sound/core/oss/pcm_plugin.c | 1 -
 1 file changed, 1 deletion(-)
sound/core/oss/pcm_plugin.c +0 -1
index 061ba06..a7c0e50 100644
@@ -469,7 +469,6 @@ int snd_pcm_plug_format_plugins(struct snd_pcm_substream *plug,
 				return err;
 			}
 			srcformat = tmpformat;
-			src_access = dst_access;
 		}
 		tmpformat.rate = dstformat.rate;
         	err = snd_pcm_plugin_build_rate(plug,
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 9 lines · Jiapeng Chong

Variable src_access is set to 'dst_access', but this value is never read as it is not used later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

sound/core/oss/pcm_plugin.c:472:4: warning: Value stored to 'src_access' is never read [clang-analyzer-deadcode.DeadStores].

That's true, but OTOH, this is better to kept for synchronization with other parts where all set the same src_access. So I'd keep it as is. The compiler will optimize out, after all.

thanks,

Takashi

Quoted 22 lines
---
 sound/core/oss/pcm_plugin.c | 1 -
 1 file changed, 1 deletion(-)
sound/core/oss/pcm_plugin.c +0 -1
index 061ba06..a7c0e50 100644
@@ -469,7 +469,6 @@ int snd_pcm_plug_format_plugins(struct snd_pcm_substream *plug,
 				return err;
 			}
 			srcformat = tmpformat;
-			src_access = dst_access;
 		}
 		tmpformat.rate = dstformat.rate;
         	err = snd_pcm_plugin_build_rate(plug,
Signature · 1 line
1.8.3.1