All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: oss: Remove redundant assignment to src_access
@ 2021-06-15 10:53 ` Jiapeng Chong
  0 siblings, 0 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-06-15 10:53 UTC (permalink / raw)
  To: perex; +Cc: alsa-devel, linux-kernel, 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].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 sound/core/oss/pcm_plugin.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index 061ba06..a7c0e50 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -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,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ALSA: oss: Remove redundant assignment to src_access
@ 2021-06-15 10:53 ` Jiapeng Chong
  0 siblings, 0 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-06-15 10:53 UTC (permalink / raw)
  To: perex; +Cc: Jiapeng Chong, alsa-devel, linux-kernel

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].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 sound/core/oss/pcm_plugin.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index 061ba06..a7c0e50 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -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,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: oss: Remove redundant assignment to src_access
  2021-06-15 10:53 ` Jiapeng Chong
@ 2021-06-16 11:07   ` Takashi Iwai
  -1 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-06-16 11:07 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: perex, alsa-devel, linux-kernel

On Tue, 15 Jun 2021 12:53:43 +0200,
Jiapeng Chong wrote:
> 
> 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

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  sound/core/oss/pcm_plugin.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
> index 061ba06..a7c0e50 100644
> --- a/sound/core/oss/pcm_plugin.c
> +++ b/sound/core/oss/pcm_plugin.c
> @@ -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,
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: oss: Remove redundant assignment to src_access
@ 2021-06-16 11:07   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-06-16 11:07 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: alsa-devel, linux-kernel

On Tue, 15 Jun 2021 12:53:43 +0200,
Jiapeng Chong wrote:
> 
> 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

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  sound/core/oss/pcm_plugin.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
> index 061ba06..a7c0e50 100644
> --- a/sound/core/oss/pcm_plugin.c
> +++ b/sound/core/oss/pcm_plugin.c
> @@ -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,
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-16 11:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 10:53 [PATCH] ALSA: oss: Remove redundant assignment to src_access Jiapeng Chong
2021-06-15 10:53 ` Jiapeng Chong
2021-06-16 11:07 ` Takashi Iwai
2021-06-16 11:07   ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.