Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb7ebfa3 authored by Philipp Klocke's avatar Philipp Klocke Committed by Takashi Iwai
Browse files

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: default avatarPhilipp Klocke <philipp97kl@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f90afe79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
	struct cs8427 *chip = device->private_data;
	char *hw_data = udata ?
		chip->playback.hw_udata : chip->playback.hw_status;
	char data[32];
	unsigned char data[32];
	int err, idx;

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