lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKwvOdkrzOVoZxPcdGHa-dkKBwVBCqiYqDh9Sc+htT=7YOL2RA@mail.gmail.com>
Date:   Fri, 8 Feb 2019 16:59:26 -0800
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Nathan Chancellor <natechancellor@...il.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, alsa-devel@...a-project.org,
        LKML <linux-kernel@...r.kernel.org>,
        Paul Cercueil <paul@...pouillou.net>
Subject: Re: [PATCH] ASoC: codecs: jz4725b: Remove unnecessary const qualifier

On Thu, Feb 7, 2019 at 9:00 PM Nathan Chancellor
<natechancellor@...il.com> wrote:
>
> Clang warns:
>
> sound/soc/codecs/jz4725b.c:177:14: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
> static const SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
>              ^
> include/sound/soc.h:356:2: note: expanded from macro 'SOC_VALUE_ENUM_SINGLE_DECL'
>         SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
>         ^
> include/sound/soc.h:353:2: note: expanded from macro 'SOC_VALUE_ENUM_DOUBLE_DECL'
>         const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
>         ^
>
> As it points out, SOC_VALUE_ENUM_DOUBLE_DECL has the const attribute in
> its definition so remove it here.
>
> Fixes: e9d97b05a80f ("ASoC: codecs: Add jz4725b-codec driver")
> Link: https://github.com/ClangBuiltLinux/linux/issues/354
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>

Thanks for the fix.  Looks like the struct instance declaration
already contains a const.  That's a curious (not bad, per se) pattern
that probably results in a few other instances of this warning, I'll
bet.
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>

> ---
>  sound/soc/codecs/jz4725b.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
> index e3dba92f30bd..5cc8c7ca24c6 100644
> --- a/sound/soc/codecs/jz4725b.c
> +++ b/sound/soc/codecs/jz4725b.c
> @@ -174,12 +174,12 @@ static const char * const jz4725b_codec_adc_src_texts[] = {
>         "Mic 1", "Mic 2", "Line In", "Mixer",
>  };
>  static const unsigned int jz4725b_codec_adc_src_values[] = { 0, 1, 2, 3, };
> -static const SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
> -                                       JZ4725B_CODEC_REG_CR3,
> -                                       REG_CR3_INSEL_OFFSET,
> -                                       REG_CR3_INSEL_MASK,
> -                                       jz4725b_codec_adc_src_texts,
> -                                       jz4725b_codec_adc_src_values);
> +static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
> +                                 JZ4725B_CODEC_REG_CR3,
> +                                 REG_CR3_INSEL_OFFSET,
> +                                 REG_CR3_INSEL_MASK,
> +                                 jz4725b_codec_adc_src_texts,
> +                                 jz4725b_codec_adc_src_values);
>  static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl =
>                         SOC_DAPM_ENUM("Route", jz4725b_codec_adc_src_enum);
>
> --
> 2.20.1
>


-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ