linux-brain/sound/i2c
Philipp Klocke e7d7239760 ALSA: i2c/cs8427: Fix int to char conversion
[ Upstream commit eb7ebfa3c1 ]

Compiling with clang yields the following warning:

sound/i2c/cs8427.c:140:31: warning: implicit conversion from 'int'
to 'char' changes value from 160 to -96 [-Wconstant-conversion]
    data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
            ~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

Because CS8427_REG_AUTOINC is defined as 128, it is too big for a
char field.
So change data from char to unsigned char, that it can hold the value.

This patch does not change the generated code.

Signed-off-by: Philipp Klocke <philipp97kl@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:13:39 +01:00
..
other ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls() 2019-10-05 12:47:47 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cs8427.c ALSA: i2c/cs8427: Fix int to char conversion 2019-12-01 09:13:39 +01:00
i2c.c ALSA: i2c: constify snd_i2c_ops structures 2015-11-30 11:40:08 +01:00
tea6330t.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00