[PATCH 3/4] drm/omap: Remove set but not used variable 'err' in hdmi5_audio_config

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Oct 9 21:40:34 UTC 2019


Hi Zhengbin,

Thank you for the patch.

On Tue, Oct 08, 2019 at 03:15:48PM +0800, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/gpu/drm/omapdrm/dss/hdmi5_core.c: In function hdmi5_audio_config:
> drivers/gpu/drm/omapdrm/dss/hdmi5_core.c:812:6: warning: variable err set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit f5bab2229190 ("OMAPDSS:
> HDMI: Add OMAP5 HDMI support")
> 
> Reported-by: Hulk Robot <hulkci at huawei.com>
> Signed-off-by: zhengbin <zhengbin13 at huawei.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c
> index 7400fb9..0b79ff0 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c
> @@ -798,7 +798,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
>  	struct hdmi_audio_format audio_format;
>  	struct hdmi_audio_dma audio_dma;
>  	struct hdmi_core_audio_config core_cfg;
> -	int err, n, cts, channel_count;
> +	int n, cts, channel_count;
>  	unsigned int fs_nr;
>  	bool word_length_16b = false;
> 
> @@ -841,7 +841,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
>  		return -EINVAL;
>  	}
> 
> -	err = hdmi_compute_acr(pclk, fs_nr, &n, &cts);
> +	hdmi_compute_acr(pclk, fs_nr, &n, &cts);

Ideally we should propagate the error back, but we would end up in
hdmi5_bridge_enable() that is a void function, so there's little point
in doing so. Furthemore the errors reported by hdmi_compute_acr() really
can't happen, so this is safe.

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

>  	core_cfg.n = n;
>  	core_cfg.cts = cts;
> 

-- 
Regards,

Laurent Pinchart


More information about the dri-devel mailing list