2022-04-21 22:05:24

by kernel test robot

[permalink] [raw]
Subject: [PATCH] drm: bridge: dw_hdmi: Audio: fix returnvar.cocci warnings

From: kernel test robot <[email protected]>

drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:80:5-8: Unneeded variable: "ret". Return "0" on line 94
drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:105:5-8: Unneeded variable: "ret". Return "0" on line 112


Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Sandor Yu <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 65eb92e4c9f0a962656f131521f4fbc0d24c9d4c
commit: d970ce303ff80ae57bbd3e784f2772dbf3056e0c [4441/5346] drm: bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver
:::::: branch date: 8 hours ago
:::::: commit date: 2 days ago

drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c
@@ -77,7 +77,6 @@ static int audio_hw_params(struct device
struct hdmi_codec_params *params)
{
struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
- int ret = 0;
u8 ca;

dw_hdmi_set_sample_rate(dw->data.hdmi, params->sample_rate);
@@ -91,7 +90,7 @@ static int audio_hw_params(struct device
params->iec.status[0] & IEC958_AES0_NONAUDIO);
dw_hdmi_set_sample_width(dw->data.hdmi, params->sample_width);

- return ret;
+ return 0;
}

static void audio_shutdown(struct device *dev, void *data)
@@ -102,14 +101,13 @@ static int audio_mute_stream(struct devi
bool enable, int direction)
{
struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
- int ret = 0;

if (!enable)
dw_hdmi_audio_enable(dw->data.hdmi);
else
dw_hdmi_audio_disable(dw->data.hdmi);

- return ret;
+ return 0;
}

static int audio_get_eld(struct device *dev, void *data,


2022-04-22 18:21:41

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH] drm: bridge: dw_hdmi: Audio: fix returnvar.cocci warnings

On 21/04/2022 17:09, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:80:5-8: Unneeded variable: "ret". Return "0" on line 94
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:105:5-8: Unneeded variable: "ret". Return "0" on line 112
>
>
> Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> CC: Sandor Yu <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 65eb92e4c9f0a962656f131521f4fbc0d24c9d4c
> commit: d970ce303ff80ae57bbd3e784f2772dbf3056e0c [4441/5346] drm: bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver
> :::::: branch date: 8 hours ago
> :::::: commit date: 2 days ago
>
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c
> @@ -77,7 +77,6 @@ static int audio_hw_params(struct device
> struct hdmi_codec_params *params)
> {
> struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
> - int ret = 0;
> u8 ca;
>
> dw_hdmi_set_sample_rate(dw->data.hdmi, params->sample_rate);
> @@ -91,7 +90,7 @@ static int audio_hw_params(struct device
> params->iec.status[0] & IEC958_AES0_NONAUDIO);
> dw_hdmi_set_sample_width(dw->data.hdmi, params->sample_width);
>
> - return ret;
> + return 0;
> }
>
> static void audio_shutdown(struct device *dev, void *data)
> @@ -102,14 +101,13 @@ static int audio_mute_stream(struct devi
> bool enable, int direction)
> {
> struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
> - int ret = 0;
>
> if (!enable)
> dw_hdmi_audio_enable(dw->data.hdmi);
> else
> dw_hdmi_audio_disable(dw->data.hdmi);
>
> - return ret;
> + return 0;
> }
>
> static int audio_get_eld(struct device *dev, void *data,

Reviewed-by: Neil Armstrong <[email protected]>

2022-04-22 19:19:06

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH] drm: bridge: dw_hdmi: Audio: fix returnvar.cocci warnings

Hi,

On Thu, 21 Apr 2022 23:09:46 +0800, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:80:5-8: Unneeded variable: "ret". Return "0" on line 94
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:105:5-8: Unneeded variable: "ret". Return "0" on line 112
>
>
> Remove unneeded variable used to store return value.
>
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/1] drm: bridge: dw_hdmi: Audio: fix returnvar.cocci warnings
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=0e48711f602064705bf81eebe6f627ee1bc11d3b

--
Neil

2022-04-22 22:39:41

by Sandor Yu

[permalink] [raw]
Subject: RE: [EXT] [PATCH] drm: bridge: dw_hdmi: Audio: fix returnvar.cocci warnings



> -----Original Message-----
> From: kernel test robot <[email protected]>
> Sent: 2022??4??21?? 23:10
> To: Sandor Yu <[email protected]>
> Cc: [email protected]; Linux Memory Management List
> <[email protected]>; Robert Foss <[email protected]>; S.J. Wang
> <[email protected]>; Neil Armstrong <[email protected]>;
> Andrzej Hajda <[email protected]>; Laurent Pinchart
> <[email protected]>; Jonas Karlman <[email protected]>;
> Jernej Skrabec <[email protected]>; David Airlie <[email protected]>;
> Daniel Vetter <[email protected]>; [email protected];
> [email protected]
> Subject: [EXT] [PATCH] drm: bridge: dw_hdmi: Audio: fix returnvar.cocci
> warnings
>
> Caution: EXT Email
>
> From: kernel test robot <[email protected]>
>
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:80:5-8: Unneeded
> variable: "ret". Return "0" on line 94
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:105:5-8: Unneeded
> variable: "ret". Return "0" on line 112
>
>
> Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> CC: Sandor Yu <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---
>
> tree:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.ker
> nel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fnext%2Flinux-next.git&a
> mp;data=05%7C01%7CSandor.yu%40nxp.com%7C7028c89ce23940ff081408d
> a23a911c8%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637861
> 506299960569%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJ
> QIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&am
> p;sdata=P1pum2Ur3I8occ5f1WAnVhnIIGB0Q1HXc2GsRbUx8p0%3D&amp;res
> erved=0 master
> head: 65eb92e4c9f0a962656f131521f4fbc0d24c9d4c
> commit: d970ce303ff80ae57bbd3e784f2772dbf3056e0c [4441/5346] drm:
> bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver
> :::::: branch date: 8 hours ago
> :::::: commit date: 2 days ago
>
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c
> @@ -77,7 +77,6 @@ static int audio_hw_params(struct device
> struct hdmi_codec_params *params) {
> struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
> - int ret = 0;
> u8 ca;
>
> dw_hdmi_set_sample_rate(dw->data.hdmi, params->sample_rate);
> @@ -91,7 +90,7 @@ static int audio_hw_params(struct device
> params->iec.status[0] &
> IEC958_AES0_NONAUDIO);
> dw_hdmi_set_sample_width(dw->data.hdmi,
> params->sample_width);
>
> - return ret;
> + return 0;
> }
>
> static void audio_shutdown(struct device *dev, void *data) @@ -102,14
> +101,13 @@ static int audio_mute_stream(struct devi
> bool enable, int direction) {
> struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
> - int ret = 0;
>
> if (!enable)
> dw_hdmi_audio_enable(dw->data.hdmi);
> else
> dw_hdmi_audio_disable(dw->data.hdmi);
>
> - return ret;
> + return 0;
> }
>
> static int audio_get_eld(struct device *dev, void *data,

Reviewed-by: Sandor Yu <[email protected]>