lkml.org 
[lkml]   [2018]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [sound/i2c/cs8427] Fix int to char conversion
On Thu, 18 Oct 2018 12:33:02 +0200,
Philipp Klocke wrote:
>
> 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>

Applied, thanks.

But at the next time, please put the relevant subsystem MLs to Cc,
and use the proper subject prefix (depending on the subsystem).


Takashi

\
 
 \ /
  Last update: 2018-10-18 15:47    [W:0.892 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site