Skip to content

Commit eb7ebfa

Browse files
Philipp Klocketiwai
authored andcommitted
ALSA: i2c/cs8427: Fix int to char conversion
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>
1 parent f90afe7 commit eb7ebfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/i2c/cs8427.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
118118
struct cs8427 *chip = device->private_data;
119119
char *hw_data = udata ?
120120
chip->playback.hw_udata : chip->playback.hw_status;
121-
char data[32];
121+
unsigned char data[32];
122122
int err, idx;
123123

124124
if (!memcmp(hw_data, ndata, count))

0 commit comments

Comments
 (0)