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] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM5PR1001MB09949C252D9A09501FEE516280890@AM5PR1001MB0994.EURPRD10.PROD.OUTLOOK.COM>
Date:   Mon, 7 Jan 2019 13:27:00 +0000
From:   Adam Thomson <Adam.Thomson.Opensource@...semi.com>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>
CC:     "tiwai@...e.de" <tiwai@...e.de>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "liam.r.girdwood@...ux.intel.com" <liam.r.girdwood@...ux.intel.com>,
        Adam Thomson <Adam.Thomson.Opensource@...semi.com>,
        Support Opensource <Support.Opensource@...semi.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 18/21] ASoC: da7219: fix endianness issues

On 05 January 2019 02:03, Pierre-Louis Bossart wrote:

> Reported by Sparse.
> 
> da7219.c:440:44: warning: cast to restricted __le16
> da7219.c:461:13: warning: incorrect type in assignment (different base types)
> da7219.c:461:13:    expected unsigned short [unsigned] [usertype] val
> da7219.c:461:13:    got restricted __le16 [usertype] <noident>
> da7219.c:1451:16: warning: incorrect type in assignment (different base types)
> da7219.c:1451:16:    expected unsigned short [unsigned] [usertype] offset
> da7219.c:1451:16:    got restricted __le16 [usertype] <noident>
> 
> da7219-aad.c:150:37: warning: incorrect type in assignment (different base types)
> da7219-aad.c:150:37:    expected unsigned short [unsigned] [usertype]
> tonegen_freq_hptest
> da7219-aad.c:150:37:    got restricted __le16 [usertype] <noident>
> da7219-aad.c:157:37: warning: incorrect type in assignment (different base types)
> da7219-aad.c:157:37:    expected unsigned short [unsigned] [usertype]
> tonegen_freq_hptest
> da7219-aad.c:157:37:    got restricted __le16 [usertype] <noident>
> 
> Cc: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>

Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@...semi.com>

> ---
>  sound/soc/codecs/da7219-aad.c | 2 +-
>  sound/soc/codecs/da7219.c     | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c
> index 2c7d5088e6f2..e0964b20a389 100644
> --- a/sound/soc/codecs/da7219-aad.c
> +++ b/sound/soc/codecs/da7219-aad.c
> @@ -117,7 +117,7 @@ static void da7219_aad_hptest_work(struct work_struct
> *work)
>  	struct snd_soc_dapm_context *dapm =
> snd_soc_component_get_dapm(component);
>  	struct da7219_priv *da7219 =
> snd_soc_component_get_drvdata(component);
> 
> -	u16 tonegen_freq_hptest;
> +	__le16 tonegen_freq_hptest;
>  	u8 pll_srm_sts, pll_ctrl, gain_ramp_ctrl, accdet_cfg8;
>  	int report = 0, ret = 0;
> 
> diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index
> e46e9f4bc994..ce165047b9f9 100644
> --- a/sound/soc/codecs/da7219.c
> +++ b/sound/soc/codecs/da7219.c
> @@ -423,7 +423,7 @@ static int da7219_tonegen_freq_get(struct snd_kcontrol
> *kcontrol,
>  	struct soc_mixer_control *mixer_ctrl =
>  		(struct soc_mixer_control *) kcontrol->private_value;
>  	unsigned int reg = mixer_ctrl->reg;
> -	u16 val;
> +	__le16 val;
>  	int ret;
> 
>  	mutex_lock(&da7219->ctrl_lock);
> @@ -450,7 +450,7 @@ static int da7219_tonegen_freq_put(struct snd_kcontrol
> *kcontrol,
>  	struct soc_mixer_control *mixer_ctrl =
>  		(struct soc_mixer_control *) kcontrol->private_value;
>  	unsigned int reg = mixer_ctrl->reg;
> -	u16 val;
> +	__le16 val;
>  	int ret;
> 
>  	/*
> @@ -1396,7 +1396,7 @@ static int da7219_set_dai_tdm_slot(struct snd_soc_dai
> *dai,
>  	struct snd_soc_component *component = dai->component;
>  	struct da7219_priv *da7219 =
> snd_soc_component_get_drvdata(component);
>  	u8 dai_bclks_per_wclk;
> -	u16 offset;
> +	__le16 offset;
>  	u32 frame_size;
> 
>  	/* No channels enabled so disable TDM, revert to 64-bit frames */
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ