Skip to content

Commit

Permalink
[media] s5p-fimc: dubious one-bit signed bitfields
Browse files Browse the repository at this point in the history
> From: Dan Carpenter [mailto:error27@gmail.com]
>
> These are signed so instead of being 1 and 0 as intended they are -1 and
> 0.  It doesn't cause a bug in the current code but Sparse warns about
> it:
>
> drivers/media/video/s5p-fimc/fimc-core.h:226:28:
> 	error: dubious one-bit signed bitfield
>  struct fimc_scaler {
> -	int	scaleup_h:1;
> -	int	scaleup_v:1;
> -	int	copy_mode:1;
> -	int	enabled:1;
> +	unsigned int	scaleup_h:1;
> +	unsigned int	caleup_v:1;
> +	unsigned int	copy_mode:1;
> +	unsigned int	enabled:1;

In general I agree, however this patch would change scaleup_v:1
to caleup_v, so it cannot be applied in current form.
Here is the corrected patch:

Reported-by: Dan Carpenter <error27@gmail.com<
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Oct 23, 2010
1 parent 29adc2c commit dda7ae7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/video/s5p-fimc/fimc-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ struct fimc_effect {
* @real_height: source pixel (height - offset)
*/
struct fimc_scaler {
int scaleup_h:1;
int scaleup_v:1;
int copy_mode:1;
int enabled:1;
unsigned int scaleup_h:1;
unsigned int scaleup_v:1;
unsigned int copy_mode:1;
unsigned int enabled:1;
u32 hfactor;
u32 vfactor;
u32 pre_hratio;
Expand Down

0 comments on commit dda7ae7

Please sign in to comment.