Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: omap: omapfb_main.c:  Cleaning up removal variable thet is never used
From: Rickard Strandqvist @ 2014-07-05 16:24 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Rickard Strandqvist, Jingoo Han,
	Daniel Vetter, Laurent Pinchart, Rob Clark, Arnd Bergmann,
	linux-fbdev, linux-kernel
In-Reply-To: <1404566552-23096-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>

Removal of union member variable thet is never used

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/omap/omapfb_main.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index d8d028d..557aaa3 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1096,7 +1096,6 @@ static int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd,
 		enum omapfb_update_mode		update_mode;
 		struct omapfb_caps		caps;
 		unsigned int		mirror;
-		int			plane_out;
 		int			enable_plane;
 	} p;
 	int r = 0;
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH] video: fbdev: g364fb.c: Cleaning up variable that is never used
From: Geert Uytterhoeven @ 2014-07-05 17:09 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Rickard Strandqvist, Jingoo Han, Laurent Pinchart, Rob Clark,
	Daniel Vetter, Linux Fbdev development list,
	linux-kernel@vger.kernel.org
In-Reply-To: <1404562874-19440-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sat, Jul 5, 2014 at 2:21 PM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>
>
> Variable ar assigned a value that is never used.
> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH] video: fbdev: sis: init.c:  Cleaning up variable that is never used
From: Dan Carpenter @ 2014-07-05 19:23 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Rickard Strandqvist, Jingoo Han, Daniel Vetter,
	Mauro Carvalho Chehab, Laurent Pinchart, Chen, Gong, linux-fbdev,
	linux-kernel
In-Reply-To: <1404564507-21718-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sat, Jul 05, 2014 at 02:48:27PM +0200, Rickard Strandqvist wrote:
> From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>

These for lines are for when you are sending on someone else's behalf.

> 
> Variable ar assigned a value that is never used.
> I have also removed all the code that thereby serves no purpose.
> 
> This was found using a static code analysis program called cppcheck
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/video/fbdev/sis/init.c |   21 +++++----------------
>  1 file changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
> index bd40f5e..3ba446c 100644
> --- a/drivers/video/fbdev/sis/init.c
> +++ b/drivers/video/fbdev/sis/init.c
> @@ -2649,7 +2649,7 @@ static void
>  SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
>  		unsigned short ModeIdIndex, unsigned short RRTI)
>  {
> -   unsigned short data, infoflag = 0, modeflag, resindex;
> +   unsigned short data, infoflag = 0, modeflag;
>  #ifdef CONFIG_FB_SIS_315
>     unsigned char  *ROMAddr  = SiS_Pr->VirtualRomBase;
>     unsigned short data2, data3;
> @@ -2660,7 +2660,7 @@ SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
>     if(SiS_Pr->UseCustomMode) {
>        infoflag = SiS_Pr->CInfoFlag;
>     } else {
> -      resindex = SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
> +      SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);

Remove this whole line.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH] video: fbdev: sis: init.c: Cleaning up variable that is never used
From: Geert Uytterhoeven @ 2014-07-05 19:44 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rickard Strandqvist, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Rickard Strandqvist, Jingoo Han, Daniel Vetter,
	Mauro Carvalho Chehab, Laurent Pinchart, Chen, Gong,
	Linux Fbdev development list, linux-kernel@vger.kernel.org
In-Reply-To: <20140705192317.GD25934@mwanda>

On Sat, Jul 5, 2014 at 9:23 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Sat, Jul 05, 2014 at 02:48:27PM +0200, Rickard Strandqvist wrote:
>> From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>
>
> These for lines are for when you are sending on someone else's behalf.

Or for when you are sending the patches from a different email address
than the one that should be recorded in git.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH] video: fbdev: sis: init.c: Cleaning up variable that is never used
From: Dan Carpenter @ 2014-07-05 20:04 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rickard Strandqvist, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Rickard Strandqvist, Jingoo Han, Daniel Vetter,
	Mauro Carvalho Chehab, Laurent Pinchart, Chen, Gong,
	Linux Fbdev development list, linux-kernel@vger.kernel.org
In-Reply-To: <CAMuHMdVNgCFZ1Nu77ds62COtqMPRYw4p_fifoZnAQKjq_D+kOQ@mail.gmail.com>

On Sat, Jul 05, 2014 at 09:44:56PM +0200, Geert Uytterhoeven wrote:
> On Sat, Jul 5, 2014 at 9:23 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Sat, Jul 05, 2014 at 02:48:27PM +0200, Rickard Strandqvist wrote:
> >> From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>
> >
> > These for lines are for when you are sending on someone else's behalf.
> 
> Or for when you are sending the patches from a different email address
> than the one that should be recorded in git.
>

Yeah.  But it's better to fix your email client so we can at least
verify that the signed off matches the author tag.

I know a lot of people have trouble configuring email but in the end
everyone pretty much manages when we ask them to.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH] video: fbdev: sis: init.c: Cleaning up variable that is never used
From: Dan Carpenter @ 2014-07-05 20:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rickard Strandqvist, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Rickard Strandqvist, Jingoo Han, Daniel Vetter,
	Mauro Carvalho Chehab, Laurent Pinchart, Chen, Gong,
	Linux Fbdev development list, linux-kernel@vger.kernel.org
In-Reply-To: <20140705200430.GE25934@mwanda>

Verifying the email address is not 100% fool proof so it's not a massive
deal either way.  The only reason I mentioned it here was because this
patch wasn't correct anyway and had to be redone regardless.

regards,
dan carpenter


^ permalink raw reply

* [PATCH] video: fbdev: core: fbmon.c:  Cleaning up useless assignment of function parameter
From: Rickard Strandqvist @ 2014-07-06 17:25 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Laurent Pinchart,
	Rob Clark, David Ung, linux-fbdev, linux-kernel
In-Reply-To: <1404565710-22433-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Remove assignment of function parameter, that has no effect outside the function

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/core/fbmon.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 5b0e313..71ec1ab 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1481,7 +1481,6 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
 }
 void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 {
-	specs = NULL;
 }
 void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 {
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: vga16fb.c:  Cleaning up useless assignment of function parameter
From: Rickard Strandqvist @ 2014-07-06 17:26 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Joe Perches,
	Luis Henriques, linux-fbdev, linux-kernel
In-Reply-To: <1404565771-22515-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Remove assignment of function parameter, that has no effect outside the function

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/vga16fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c
index 283d335..d92e4fd 100644
--- a/drivers/video/fbdev/vga16fb.c
+++ b/drivers/video/fbdev/vga16fb.c
@@ -275,7 +275,6 @@ static void vga16fb_clock_chip(struct vga16fb_par *par,
 	}
 	par->misc |= best->misc;
 	par->clkdiv = best->seq_clock_mode;
-	pixclock = (best->pixclock * div) / mul;		
 }
 			       
 #define FAIL(X) return -EINVAL
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: xen-fbfront.c:  Cleaning up useless assignment of function parameter
From: Rickard Strandqvist @ 2014-07-06 17:27 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Stefano Stabellini, Konrad Rzeszutek Wilk,
	Jingoo Han, Daniel Vetter, linux-fbdev, linux-kernel
In-Reply-To: <1404565829-22602-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Remove assignment of function parameter, that has no effect outside the function

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/xen-fbfront.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
index 901014b..e1207a1 100644
--- a/drivers/video/fbdev/xen-fbfront.c
+++ b/drivers/video/fbdev/xen-fbfront.c
@@ -222,7 +222,6 @@ static int xenfb_setcolreg(unsigned regno, unsigned red, unsigned green,
 	red = CNVT_TOHW(red, info->var.red.length);
 	green = CNVT_TOHW(green, info->var.green.length);
 	blue = CNVT_TOHW(blue, info->var.blue.length);
-	transp = CNVT_TOHW(transp, info->var.transp.length);
 #undef CNVT_TOHW
 
 	v = (red << info->var.red.offset) |
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: omap: omapfb_main.c:  Cleaning up wrong type in format string
From: Rickard Strandqvist @ 2014-07-06 17:34 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Laurent Pinchart,
	Arnd Bergmann, linux-fbdev, linux-kernel
In-Reply-To: <1404566552-23096-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Wrong type in sscanf format string, requires 'int *' but the
argument type is 'unsigned int *'

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/omap/omapfb_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index d8d028d..7df0764 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1371,7 +1371,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
 	if (fbdev->panel->set_bklight_level) {
 		unsigned int level;
 
-		if (sscanf(buf, "%10d", &level) = 1) {
+		if (sscanf(buf, "%10u", &level) = 1) {
 			r = fbdev->panel->set_bklight_level(fbdev->panel,
 							    level);
 		} else
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: omap2: dss: display-sysfs.c:  Cleaning up wrong type in format string
From: Rickard Strandqvist @ 2014-07-06 17:35 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Laurent Pinchart, Rob Clark,
	linux-fbdev, linux-kernel
In-Reply-To: <1404566258-22901-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Wrong type in printf format string, requires 'unsigned int'
but the argument type is 'int'

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/omap2/dss/display-sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/display-sysfs.c b/drivers/video/fbdev/omap2/dss/display-sysfs.c
index 5a2095a..5928bc9 100644
--- a/drivers/video/fbdev/omap2/dss/display-sysfs.c
+++ b/drivers/video/fbdev/omap2/dss/display-sysfs.c
@@ -184,7 +184,7 @@ static ssize_t display_rotate_show(struct device *dev,
 	if (!dssdev->driver->get_rotate)
 		return -ENOENT;
 	rotate = dssdev->driver->get_rotate(dssdev);
-	return snprintf(buf, PAGE_SIZE, "%u\n", rotate);
+	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
 }
 
 static ssize_t display_rotate_store(struct device *dev,
@@ -215,7 +215,7 @@ static ssize_t display_mirror_show(struct device *dev,
 	if (!dssdev->driver->get_mirror)
 		return -ENOENT;
 	mirror = dssdev->driver->get_mirror(dssdev);
-	return snprintf(buf, PAGE_SIZE, "%u\n", mirror);
+	return snprintf(buf, PAGE_SIZE, "%d\n", mirror);
 }
 
 static ssize_t display_mirror_store(struct device *dev,
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: sis: sis_main.c:  Cleaning up wrong type in format string
From: Rickard Strandqvist @ 2014-07-06 17:36 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Joe Perches,
	linux-fbdev, linux-kernel
In-Reply-To: <1404566317-22987-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Wrong type in printf format string, requires 'unsigned int'
but the argument type is 'int'

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/sis/sis_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 22ad028..ab7e5e4 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -237,7 +237,7 @@ static void sisfb_get_vga_mode_from_kernel(void)
 
 		if(mydepth = 24) mydepth = 32;
 
-		sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
+		sprintf(mymode, "%ux%ux%d", screen_info.lfb_width,
 					screen_info.lfb_height,
 					mydepth);
 
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH] video: fbdev: sis: sis_main.c:  Cleaning up wrong type in format string
From: Joe Perches @ 2014-07-06 17:46 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
	Daniel Vetter, linux-fbdev, linux-kernel
In-Reply-To: <1404668190-15199-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sun, 2014-07-06 at 19:36 +0200, Rickard Strandqvist wrote:
> Wrong type in printf format string, requires 'unsigned int'
> but the argument type is 'int'

Perhaps it'd be better to change the type of mydepth
to __u16 as that's the type of lfb_depth

> diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
[]
> @@ -237,7 +237,7 @@ static void sisfb_get_vga_mode_from_kernel(void)
>  
>  		if(mydepth = 24) mydepth = 32;
>  
> -		sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
> +		sprintf(mymode, "%ux%ux%d", screen_info.lfb_width,
>  					screen_info.lfb_height,
>  					mydepth);
>  



^ permalink raw reply

* [PATCH] video: fbdev: omap: omapfb_main.c:  Cleaning up removal variable thet is never used
From: Rickard Strandqvist @ 2014-07-06 17:57 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Laurent Pinchart,
	Arnd Bergmann, linux-fbdev, linux-kernel
In-Reply-To: <1404566552-23096-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Removal of union member variable thet is never used

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/omap/omapfb_main.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index d8d028d..557aaa3 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1096,7 +1096,6 @@ static int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd,
 		enum omapfb_update_mode		update_mode;
 		struct omapfb_caps		caps;
 		unsigned int		mirror;
-		int			plane_out;
 		int			enable_plane;
 	} p;
 	int r = 0;
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: omap2: dss: sdi.c:  Cleaning up removal variable thet is never used
From: Rickard Strandqvist @ 2014-07-06 17:59 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Archit Taneja, Jingoo Han, Daniel Vetter,
	linux-fbdev, linux-kernel
In-Reply-To: <1404577396-25151-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Removal of struct member variable thet is never used

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/omap2/dss/sdi.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c
index 911dcc9..c6491ac 100644
--- a/drivers/video/fbdev/omap2/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/dss/sdi.c
@@ -34,7 +34,6 @@
 static struct {
 	struct platform_device *pdev;
 
-	bool update_enabled;
 	struct regulator *vdds_sdi_reg;
 
 	struct dss_lcd_mgr_config mgr_config;
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH] video: fbdev: omap: omapfb_main.c:  Cleaning up wrong type in format string
From: Joe Perches @ 2014-07-06 18:01 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
	Daniel Vetter, Laurent Pinchart, Arnd Bergmann, linux-fbdev,
	linux-kernel
In-Reply-To: <1404668049-15016-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sun, 2014-07-06 at 19:34 +0200, Rickard Strandqvist wrote:
> Wrong type in sscanf format string, requires 'int *' but the
> argument type is 'unsigned int *'

Maybe use kstrtouint?

> diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c

> @@ -1371,7 +1371,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
>  	if (fbdev->panel->set_bklight_level) {
>  		unsigned int level;
>  
> -		if (sscanf(buf, "%10d", &level) = 1) {
> +		if (sscanf(buf, "%10u", &level) = 1) {
>  			r = fbdev->panel->set_bklight_level(fbdev->panel,
>  							    level);
>  		} else

Something like: (more comments below patch too)

 drivers/video/fbdev/omap/omapfb_main.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index d8d028d..96dd2f0 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1365,20 +1365,16 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
 					  struct device_attribute *attr,
 					  const char *buf, size_t size)
 {
+	unsigned int level;
 	struct omapfb_device *fbdev = dev_get_drvdata(dev);
-	int r;
 
-	if (fbdev->panel->set_bklight_level) {
-		unsigned int level;
+	if (!fbdev->panel->set_bklight_level)
+		return -ENODEV;
 
-		if (sscanf(buf, "%10d", &level) = 1) {
-			r = fbdev->panel->set_bklight_level(fbdev->panel,
-							    level);
-		} else
-			r = -EINVAL;
-	} else
-		r = -ENODEV;
-	return r ? r : size;
+	if (kstrtouint(buf, 10, &level) < 0)
+		return -EINVAL;
+
+	return fbdev->panel->set_bklight_level(fbdev->panel, level) ?: size;
 }
 
 static ssize_t omapfb_show_bklight_max(struct device *dev,

---

The brightness permissions seem odd:

drivers/video/fbdev/omap/omapfb_main.c-static struct device_attribute dev_attr_panel_name drivers/video/fbdev/omap/omapfb_main.c- __ATTR(name, 0444, omapfb_show_panel_name, NULL);
drivers/video/fbdev/omap/omapfb_main.c-static DEVICE_ATTR(backlight_level, 0664,
drivers/video/fbdev/omap/omapfb_main.c:            omapfb_show_bklight_level, omapfb_store_bklight_level);
drivers/video/fbdev/omap/omapfb_main.c-static DEVICE_ATTR(backlight_max, 0444, omapfb_show_bklight_max, NULL);

Why 0644 for backlight_level when backlight_max is 0444?



^ permalink raw reply related

* [PATCH] video: backlight: ili922x.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:20 UTC (permalink / raw)
  To: Jingoo Han, Bryan Wu
  Cc: Rickard Strandqvist, Lee Jones, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel
In-Reply-To: <1404562270-18387-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/backlight/ili922x.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c
index ea67fe1..06936c8 100644
--- a/drivers/video/backlight/ili922x.c
+++ b/drivers/video/backlight/ili922x.c
@@ -251,7 +251,7 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
 	struct spi_transfer xfer_regindex, xfer_regvalue;
 	unsigned char tbuf[CMD_BUFSIZE];
 	unsigned char rbuf[CMD_BUFSIZE];
-	int ret, len = 0;
+	int ret;
 
 	memset(&xfer_regindex, 0, sizeof(struct spi_transfer));
 	memset(&xfer_regvalue, 0, sizeof(struct spi_transfer));
@@ -273,7 +273,6 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
 	ret = spi_sync(spi, &msg);
 
 	spi_message_init(&msg);
-	len = 0;
 	tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,
 					 START_RW_WRITE));
 	tbuf[1] = set_tx_byte((value & 0xFF00) >> 8);
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: backlight: jornada720_lcd.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:21 UTC (permalink / raw)
  To: Jingoo Han, Bryan Wu
  Cc: Rickard Strandqvist, Lee Jones, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel
In-Reply-To: <1404562325-18471-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/backlight/jornada720_lcd.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c
index da3876c..b304319 100644
--- a/drivers/video/backlight/jornada720_lcd.c
+++ b/drivers/video/backlight/jornada720_lcd.c
@@ -56,12 +56,10 @@ static int jornada_lcd_get_contrast(struct lcd_device *ld)
 
 static int jornada_lcd_set_contrast(struct lcd_device *ld, int value)
 {
-	int ret;
-
 	jornada_ssp_start();
 
 	/* start by sending our set contrast cmd to mcu */
-	ret = jornada_ssp_byte(SETCONTRAST);
+	jornada_ssp_byte(SETCONTRAST);
 
 	/* push the new value */
 	if (jornada_ssp_byte(value) != TXDUMMY) {
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: amifb.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:22 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Geert Uytterhoeven, Jingoo Han,
	Daniel Vetter, Joe Perches, Sachin Kamat, linux-fbdev,
	linux-kernel
In-Reply-To: <1404562393-18641-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/amifb.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c
index 518f790..19ed1fa 100644
--- a/drivers/video/fbdev/amifb.c
+++ b/drivers/video/fbdev/amifb.c
@@ -1124,7 +1124,6 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par,
 {
 	u_short clk_shift, line_shift;
 	u_long maxfetchstop, fstrt, fsize, fconst, xres_n, yres_n;
-	u_int htotal, vtotal;
 
 	/*
 	 * Find a matching Pixel Clock
@@ -1270,8 +1269,6 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par,
 				DPRINTK("diwstrt_v too low for pal\n");
 				return -EINVAL;
 			}
-			htotal = PAL_HTOTAL>>clk_shift;
-			vtotal = PAL_VTOTAL>>1;
 			if (!IS_OCS) {
 				par->beamcon0 = BMC0_PAL;
 				par->bplcon3 |= BPC3_BRDRBLNK;
@@ -1300,8 +1297,6 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par,
 				DPRINTK("diwstrt_v too low for ntsc\n");
 				return -EINVAL;
 			}
-			htotal = NTSC_HTOTAL>>clk_shift;
-			vtotal = NTSC_VTOTAL>>1;
 			if (!IS_OCS) {
 				par->beamcon0 = 0;
 				par->bplcon3 |= BPC3_BRDRBLNK;
@@ -1360,8 +1355,6 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par,
 			par->beamcon0 |= BMC0_VSYTRUE;
 		if (var->sync & FB_SYNC_COMP_HIGH_ACT)
 			par->beamcon0 |= BMC0_CSYTRUE;
-		htotal = par->htotal>>clk_shift;
-		vtotal = par->vtotal>>1;
 	} else {
 		DPRINTK("only broadcast modes possible for ocs\n");
 		return -EINVAL;
@@ -1847,10 +1840,9 @@ static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var,
 	register short delta;
 	register u_char color;
 	short height, width, bits, words;
-	int size, alloc;
+	int size;
 
 	size = par->crsr.height * par->crsr.width;
-	alloc = var->height * var->width;
 	var->height = par->crsr.height;
 	var->width = par->crsr.width;
 	var->xspot = par->crsr.spot_x;
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: atafb.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:23 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Geert Uytterhoeven, Jingoo Han,
	Daniel Vetter, Joe Perches, Michael Schmitz, linux-fbdev,
	linux-kernel
In-Reply-To: <1404562464-18788-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/atafb.c |    8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index 4953b65..1bedbf35 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -2546,7 +2546,6 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 	struct atafb_par *par = (struct atafb_par *)info->par;
 	int x2, y2;
 	u32 dx, dy, sx, sy, width, height;
-	int rev_copy = 0;
 
 #ifdef ATAFB_FALCON
 	if (info->var.bits_per_pixel = 16) {
@@ -2580,7 +2579,6 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 	if (dy > sy || (dy = sy && dx > sx)) {
 		dy += height;
 		sy += height;
-		rev_copy = 1;
 	}
 
 	if (info->var.bits_per_pixel = 1)
@@ -2599,8 +2597,6 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
 	struct atafb_par *par = (struct atafb_par *)info->par;
 	int x2, y2;
-	unsigned long *dst;
-	int dst_idx;
 	const char *src;
 	u32 dx, dy, width, height, pitch;
 
@@ -2627,10 +2623,6 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image)
 
 	if (image->depth = 1) {
 		// used for font data
-		dst = (unsigned long *)
-			((unsigned long)info->screen_base & ~(BYTES_PER_LONG - 1));
-		dst_idx = ((unsigned long)info->screen_base & (BYTES_PER_LONG - 1)) * 8;
-		dst_idx += dy * par->next_line * 8 + dx;
 		src = image->data;
 		pitch = (image->width + 7) / 8;
 		while (height--) {
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: aty: atyfb_base.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:24 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Mikulas Patocka, Jingoo Han, Daniel Vetter,
	Randy Dunlap, Dan Carpenter, Sachin Kamat, linux-fbdev,
	linux-kernel
In-Reply-To: <1404562522-18911-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/aty/atyfb_base.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index c3d0074..46188a4 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -3088,7 +3088,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info,
 	if (dp = of_console_device) {
 		struct fb_var_screeninfo *var = &default_var;
 		unsigned int N, P, Q, M, T, R;
-		u32 v_total, h_total;
 		struct crtc crtc;
 		u8 pll_regs[16];
 		u8 clock_cntl;
@@ -3104,9 +3103,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info,
 		crtc.gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par);
 		aty_crtc_to_var(&crtc, var);
 
-		h_total = var->xres + var->right_margin + var->hsync_len + var->left_margin;
-		v_total = var->yres + var->lower_margin + var->vsync_len + var->upper_margin;
-
 		/*
 		 * Read the PLL to figure actual Refresh Rate.
 		 */
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: aty: mach64_gx.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:25 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Laurent Pinchart, Rob Clark,
	linux-fbdev, linux-kernel
In-Reply-To: <1404562581-18995-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/aty/mach64_gx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/aty/mach64_gx.c b/drivers/video/fbdev/aty/mach64_gx.c
index 10c988a..fcb51b1 100644
--- a/drivers/video/fbdev/aty/mach64_gx.c
+++ b/drivers/video/fbdev/aty/mach64_gx.c
@@ -617,14 +617,13 @@ static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per,
 	u32 mhz100;		/* in 0.01 MHz */
 	u32 program_bits;
 	/* u32 post_divider; */
-	u32 mach64MinFreq, mach64MaxFreq, mach64RefFreq;
+	u32 mach64MinFreq, mach64MaxFreq;
 	u16 m, n, k = 0, save_m, save_n, twoToKth;
 
 	/* Calculate the programming word */
 	mhz100 = 100000000 / vclk_per;
 	mach64MinFreq = MIN_FREQ_2595;
 	mach64MaxFreq = MAX_FREQ_2595;
-	mach64RefFreq = REF_FREQ_2595;	/* 14.32 MHz */
 
 	save_m = 0;
 	save_n = 0;
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: aty: radeon_base.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:26 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Grant Likely, Rob Herring, Jingoo Han,
	Daniel Vetter, Laurent Pinchart, Sachin Kamat, linux-fbdev,
	linux-kernel, devicetree
In-Reply-To: <1404562641-19081-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/aty/radeon_base.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 26d80a4..aee65ba 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -1532,14 +1532,14 @@ static int radeonfb_set_par(struct fb_info *info)
 	struct fb_var_screeninfo *mode = &info->var;
 	struct radeon_regs *newmode;
 	int hTotal, vTotal, hSyncStart, hSyncEnd,
-	    hSyncPol, vSyncStart, vSyncEnd, vSyncPol, cSync;
+	    vSyncStart, vSyncEnd;
 	u8 hsync_adj_tab[] = {0, 0x12, 9, 9, 6, 5};
 	u8 hsync_fudge_fp[] = {2, 2, 0, 0, 5, 5};
 	u32 sync, h_sync_pol, v_sync_pol, dotClock, pixClock;
 	int i, freq;
 	int format = 0;
 	int nopllcalc = 0;
-	int hsync_start, hsync_fudge, bytpp, hsync_wid, vsync_wid;
+	int hsync_start, hsync_fudge, hsync_wid, vsync_wid;
 	int primary_mon = PRIMARY_MONITOR(rinfo);
 	int depth = var_to_depth(mode);
 	int use_rmx = 0;
@@ -1612,13 +1612,7 @@ static int radeonfb_set_par(struct fb_info *info)
 	else if (vsync_wid > 0x1f)	/* max */
 		vsync_wid = 0x1f;
 
-	hSyncPol = mode->sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1;
-	vSyncPol = mode->sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1;
-
-	cSync = mode->sync & FB_SYNC_COMP_HIGH_ACT ? (1 << 4) : 0;
-
 	format = radeon_get_dstbpp(depth);
-	bytpp = mode->bits_per_pixel >> 3;
 
 	if ((primary_mon = MT_DFP) || (primary_mon = MT_LCD))
 		hsync_fudge = hsync_fudge_fp[format-1];
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: au1200fb.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:27 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Laurent Pinchart,
	Hanjun Guo, linux-fbdev, linux-kernel
In-Reply-To: <1404562699-19171-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/au1200fb.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 4cfba78..2249d3d 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -710,7 +710,7 @@ static int fbinfo2index (struct fb_info *fb_info)
 static int au1200_setlocation (struct au1200fb_device *fbdev, int plane,
 	int xpos, int ypos)
 {
-	uint32 winctrl0, winctrl1, winenable, fb_offset = 0;
+	uint32 winctrl0, winctrl1, winenable;
 	int xsz, ysz;
 
 	/* FIX!!! NOT CHECKING FOR COMPLETE OFFSCREEN YET */
@@ -738,7 +738,6 @@ static int au1200_setlocation (struct au1200fb_device *fbdev, int plane,
 	if (xpos < 0) {
 		/* Off-screen to the left */
 		xsz = win->w[plane].xres + xpos;
-		fb_offset += (((0 - xpos) * winbpp(lcd->window[plane].winctrl1))/8);
 		xpos = 0;
 		/*printk("off screen left\n");*/
 	}
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] video: fbdev: exynos: exynos_mipi_dsi_common.c:  Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1404562757-19274-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
index 85edabf..9e4f9bd 100644
--- a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
+++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
@@ -219,11 +219,9 @@ int exynos_mipi_dsi_wr_data(struct mipi_dsim_device *dsim, unsigned int data_id,
 	case MIPI_DSI_GENERIC_LONG_WRITE:
 	case MIPI_DSI_DCS_LONG_WRITE:
 	{
-		unsigned int size, payload = 0;
+		unsigned int payload = 0;
 		reinit_completion(&dsim_wr_comp);
 
-		size = data_size * 4;
-
 		/* if data count is less then 4, then send 3bytes data.  */
 		if (data_size < 4) {
 			payload = data0[0] |
-- 
1.7.10.4


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox