RE: [patch 3/3] V4L/DVB: s5p-fimc: dubious one-bit signed bitfields

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

 



> -----Original Message-----
> From: Dan Carpenter [mailto:error27@xxxxxxxxx]
> Sent: Thursday, October 21, 2010 9:24 PM
> To: Mauro Carvalho Chehab
> Cc: Kyungmin Park; Sylwester Nawrocki; Pawel Osciak; Marek Szyprowski;
> linux-media@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [patch 3/3] V4L/DVB: s5p-fimc: dubious one-bit signed
> bitfields
> 
> 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
> 
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> 
> diff --git a/drivers/media/video/s5p-fimc/fimc-core.h
> b/drivers/media/video/s5p-fimc/fimc-core.h
> index e3a7c6a..7665a3f 100644
> --- a/drivers/media/video/s5p-fimc/fimc-core.h
> +++ b/drivers/media/video/s5p-fimc/fimc-core.h
> @@ -222,10 +223,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	caleup_v:1;
> +	unsigned int	copy_mode:1;
> +	unsigned int	enabled:1;
>  	u32	hfactor;
>  	u32	vfactor;
>  	u32	pre_hratio;

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:

diff --git a/drivers/media/video/s5p-fimc/fimc-core.h
b/drivers/media/video/s5p-fimc/fimc-core.h
index e3a7c6a..3e10785 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -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;


Signed-off-by: Sylwester Nawrocki <s.nawrocki@xxxxxxxxxxx>

--
Sylwester Nawrocki
Linux Platform Group
Samsung Poland R&D Center

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux