Skip to content

Commit

Permalink
ASoC: sh/fsi: Make one-bit bitfields unsigned
Browse files Browse the repository at this point in the history
One-bit signed bitfields have two possible values: 0 and -1. This sometimes
leads to unexpected results (e.g. foo.bar = 1; foo.bar == 1 => false) which is
why it is recommended to make one-bit bitfields unsigned.

This fixes the following sparse warnings:
	sound/soc/sh/fsi.c:267:25: error: dubious one-bit signed bitfield
	sound/soc/sh/fsi.c:268:22: error: dubious one-bit signed bitfield
	sound/soc/sh/fsi.c:269:20: error: dubious one-bit signed bitfield
	sound/soc/sh/fsi.c:270:28: error: dubious one-bit signed bitfield
	sound/soc/sh/fsi.c:271:26: error: dubious one-bit signed bitfield
	sound/soc/sh/fsi.c:272:25: error: dubious one-bit signed bitfield

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Jun 21, 2014
1 parent 7171511 commit 9f98cd6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ struct fsi_priv {
u32 fmt;

int chan_num:16;
int clk_master:1;
int clk_cpg:1;
int spdif:1;
int enable_stream:1;
int bit_clk_inv:1;
int lr_clk_inv:1;
unsigned int clk_master:1;
unsigned int clk_cpg:1;
unsigned int spdif:1;
unsigned int enable_stream:1;
unsigned int bit_clk_inv:1;
unsigned int lr_clk_inv:1;
};

struct fsi_stream_handler {
Expand Down

0 comments on commit 9f98cd6

Please sign in to comment.