Re: [PATCH 2/4] ASoC: codecs: msm8916: fix invalid cast to bool type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 15, 2017 at 10:14:28AM +0200, Takashi Iwai wrote:
> Mark Brown wrote:

> > On Tue, May 02, 2017 at 10:33:01PM +0900, Takashi Sakamoto wrote:

> > > This commit fixes this bug by using unsigned int type, instead of bool.
> > > This bug is detected by sparse:
> > 
> > > smsm8916-wcd-analog.c:809:43: warning: odd constant _Bool cast (40 becomes 1)
> > > smsm8916-wcd-analog.c:814:43: warning: odd constant _Bool cast (40 becomes 1)

> > This looks like a bug in sparse - the use of integers in a boolean
> > context is totally valid and especially the fact that it is claiming
> > there is a cast when clearly there is no cast is an obvious red flag, at
> > the very least the message it reports is bogus.

> Well, the function pm8916_wcd_analog_parse_dt() assigns a non-boolean
> value (BIT(6)) to a boolean field, and the value is supposed to be
> kept and passed to snd_soc_update_bits(), instead of dealing as a
> boolean.  It looks rather like a buggy code to me.

The code is buggy (which is why I applied the patch) but the error
message is talking about casts that simply aren't there which is also
buggy.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux