“ae3cd7ab71cc8f2452134002859bb75ae71e622c”上不存在“git@gitcode.net:yhw52066/gpt-vue.git”
提交 f14bf199 编写于 作者: P Philipp Klocke 提交者: Xie XiuQi

ALSA: i2c/cs8427: Fix int to char conversion

[ Upstream commit eb7ebfa3 ]

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: NPhilipp Klocke <philipp97kl@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 c06d02e5
...@@ -118,7 +118,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device, ...@@ -118,7 +118,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
struct cs8427 *chip = device->private_data; struct cs8427 *chip = device->private_data;
char *hw_data = udata ? char *hw_data = udata ?
chip->playback.hw_udata : chip->playback.hw_status; chip->playback.hw_udata : chip->playback.hw_status;
char data[32]; unsigned char data[32];
int err, idx; int err, idx;
if (!memcmp(hw_data, ndata, count)) if (!memcmp(hw_data, ndata, count))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册