alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, broonie@kernel.org
Subject: Re: [PATCH 1/5] ASOC: SOF: Intel: hda-codec: move unused label to correct position
Date: Sat, 22 Aug 2020 20:48:29 -0700	[thread overview]
Message-ID: <20200823034829.GA2636427@ubuntu-n2-xlarge-x86> (raw)
In-Reply-To: <20200813175839.59422-2-pierre-louis.bossart@linux.intel.com>

On Thu, Aug 13, 2020 at 12:58:35PM -0500, Pierre-Louis Bossart wrote:
> Cppcheck reports the following warning:
> 
> sound/soc/sof/intel/hda-codec.c:191:1: style: Label 'error' is not
> used. [unusedLabel]
> 
> This label is indeed only used conditionally, move it where it's
> actually used.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/sof/intel/hda-codec.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
> index 2c5c451fa19d..119aa9ffcc66 100644
> --- a/sound/soc/sof/intel/hda-codec.c
> +++ b/sound/soc/sof/intel/hda-codec.c
> @@ -178,6 +178,11 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
>  	}
>  
>  	return ret;
> +
> +error:
> +	snd_hdac_ext_bus_device_exit(hdev);
> +	return -ENOENT;
> +
>  #else
>  	hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);
>  	if (!hdev)
> -- 
> 2.25.1
> 

I don't get this patch because there is no moving of a label, it just
introduces it, where it is actually completely unused in the function as
far as I can tell in both v5.9-rc1 and next-20200821. When building with
clang in certain configurations, this introduces the same type of
warning:

sound/soc/sof/intel/hda-codec.c:182:1: warning: unused label 'error'
[-Wunused-label]
error:
^~~~~~
1 warning generated.

It seems like this should be reverted as it does not actually do
anything.

Cheers,
Nathan

  reply	other threads:[~2020-08-23  3:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 17:58 [PATCH 0/5] ASoC: SOF/Intel: fix cppcheck warnings Pierre-Louis Bossart
2020-08-13 17:58 ` [PATCH 1/5] ASOC: SOF: Intel: hda-codec: move unused label to correct position Pierre-Louis Bossart
2020-08-23  3:48   ` Nathan Chancellor [this message]
2020-08-24 14:17     ` Pierre-Louis Bossart
2020-08-13 17:58 ` [PATCH 2/5] ASoC: SOF: Intel: hda-codec: move variable used conditionally Pierre-Louis Bossart
2020-08-13 17:58 ` [PATCH 3/5] ASoC: Intel: rename shadowed variable for all broadwell boards Pierre-Louis Bossart
2020-08-13 17:58 ` [PATCH 4/5] ASoC: Intel: bytcht_cx2072x: simplify return handling Pierre-Louis Bossart
2020-08-13 17:58 ` [PATCH 5/5] ASoC: Intel: sof_sdw: clarify operator precedence Pierre-Louis Bossart
2020-08-13 18:45   ` Mark Brown
2020-08-13 19:43     ` Pierre-Louis Bossart
2020-08-13 19:49       ` Mark Brown
2020-08-13 19:57         ` Pierre-Louis Bossart
2020-08-18 16:54 ` [PATCH 0/5] ASoC: SOF/Intel: fix cppcheck warnings Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200823034829.GA2636427@ubuntu-n2-xlarge-x86 \
    --to=natechancellor@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).