* Re: [PATCH] video: backlight: jornada720_lcd.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-07 20:00 UTC (permalink / raw)
To: Lee Jones
Cc: Jingoo Han, Bryan Wu, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, Linux Fbdev development list,
linux-kernel@vger.kernel.org
In-Reply-To: <20140707104635.GA6407@lee--X1>
2014-07-07 12:46 GMT+02:00 Lee Jones <lee.jones@linaro.org>:
>> 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(-)
>
> Solve it the other way around.
>
> Add a check and return the value if an error is returned.
Hi
Ok, I take the opportunity to make a bigger change to clarify the
similarities in function.
Hope you like it, otherwise I can make the minor change instead.
Kind regards
Rickard Strandqvist
^ permalink raw reply
* Re: [PATCH] video: fbdev: aty: atyfb_base.c: Cleaning up variable that is never used
From: Mikulas Patocka @ 2014-07-07 14:04 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
Daniel Vetter, Randy Dunlap, Dan Carpenter, Sachin Kamat,
linux-fbdev, linux-kernel
In-Reply-To: <1404671093-17590-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sun, 6 Jul 2014, Rickard Strandqvist wrote:
> 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: Mikulas Patocka <mpatocka@redhat.com>
> ---
> 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
* Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console
From: Daniel Vetter @ 2014-07-07 12:26 UTC (permalink / raw)
To: Ed Tomlinson
Cc: linux-fbdev, Intel Graphics Development, LKML, DRI Development,
Tomi Valkeinen, Jean-Christophe Plagniol-Villard
In-Reply-To: <1974170.pJAPFfvtjC@grover>
On Mon, Jul 07, 2014 at 06:45:49AM -0400, Ed Tomlinson wrote:
> Daniel,
>
> I am not quite sure I understand what you want me to test?
> Do you want me to try it without:
>
> > > + if (ret = 0) {
> > > + ret = do_unregister_con_driver(&vga_con);
Below the diff of what I mean.
-Daniel
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 5e583a1838f8..bd8517151479 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1466,12 +1466,13 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
#else
static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
{
- int ret;
+ int ret = 0;
DRM_INFO("Replacing VGA console driver\n");
console_lock();
- ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+ if (con_is_bound(&vga_con))
+ ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
if (ret = 0) {
ret = do_unregister_con_driver(&vga_con);
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply related
* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
From: Tony Lindgren @ 2014-07-07 11:46 UTC (permalink / raw)
To: Jyri Sarha
Cc: alsa-devel, linux-fbdev, linux-omap, peter.ujfalusi, broonie,
liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha
In-Reply-To: <b0764a3af8181db55db046d6139119def363e8eb.1403807781.git.jsarha@ti.com>
* Jyri Sarha <jsarha@ti.com> [140626 12:26]:
> This code is not working currently and it can be removed. There is a
> conflict in sharing resources with the actual HDMI driver and with
> the ASoC HDMI audio DAI driver.
Is this OK to queue for v3.17 or do we need this for v3.16-rc series?
Regards,
Tony
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> arch/arm/mach-omap2/devices.c | 28 ----------------------------
> 1 file changed, 28 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 592ba0a..b6f8f34 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -297,33 +297,6 @@ static void omap_init_audio(void)
> static inline void omap_init_audio(void) {}
> #endif
>
> -#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
> - defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
> -
> -static struct platform_device omap_hdmi_audio = {
> - .name = "omap-hdmi-audio",
> - .id = -1,
> -};
> -
> -static void __init omap_init_hdmi_audio(void)
> -{
> - struct omap_hwmod *oh;
> - struct platform_device *pdev;
> -
> - oh = omap_hwmod_lookup("dss_hdmi");
> - if (!oh)
> - return;
> -
> - pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
> - WARN(IS_ERR(pdev),
> - "Can't build omap_device for omap-hdmi-audio-dai.\n");
> -
> - platform_device_register(&omap_hdmi_audio);
> -}
> -#else
> -static inline void omap_init_hdmi_audio(void) {}
> -#endif
> -
> #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
>
> #include <linux/platform_data/spi-omap2-mcspi.h>
> @@ -459,7 +432,6 @@ static int __init omap2_init_devices(void)
> */
> omap_init_audio();
> omap_init_camera();
> - omap_init_hdmi_audio();
> omap_init_mbox();
> /* If dtb is there, the devices will be created dynamically */
> if (!of_have_populated_dt()) {
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console
From: Ed Tomlinson @ 2014-07-07 10:59 UTC (permalink / raw)
To: Chris Wilson, Intel Graphics Development, DRI Development, LKML,
David Herrmann, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
linux-fbdev, Jani Nikula, Dave Airlie
In-Reply-To: <20140707084826.GH5821@phenom.ffwll.local>
Daniel,
Just to be sure. The intel card here should not be claiming the real console. It does
not have an output device and the bios set set so the radeon is the primary device.
Ed
On Monday 07 July 2014 10:48:26 Daniel Vetter wrote:
> On Mon, Jun 30, 2014 at 07:59:55AM +0100, Chris Wilson wrote:
> > On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
> > > On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:
> > >
> > > Resend without html krud which causes list to bounce the message.
> > >
> > > > Hi
> > > >
> > > > This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git. Reverting it lets the boot proceed.
> > > >
> > > > I have an i7 with a built-in i915 and an pcie r7 260x. The R7 is the primary console. The i915 is initialized
> > > > but does not have a physical display attached.
> > > >
> > > > With the patch applied the boot stops at the messages:
> > > >
> > > > [drm] Memory usable by graphics device = 2048M
> > > > [drm] Replacing VGA console driver
> >
> > The issue looks like that we are ripping out the radeon fb_con whilst it
> > is active and that upsets everyone. In which case, I think the
> > compromise is:
> >
> >
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index 5f44581..4915f1d 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
> > #else
> > static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
> > {
> > - int ret;
> > + int ret = 0;
> >
> > DRM_INFO("Replacing VGA console driver\n");
> >
> > console_lock();
> > - ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
> > - if (ret = 0) {
> > - ret = do_unregister_con_driver(&vga_con);
> > -
> > - /* Ignore "already unregistered". */
> > - if (ret = -ENODEV)
> > - ret = 0;
> > + if (con_is_bound(&vga_con)) {
> > + ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
> > + if (ret = 0) {
> > + ret = do_unregister_con_driver(&vga_con);
>
> Hm, we should only conditionalize the take_over_console - unregistering
> vga_con is kinda the point to make sure it's gone for real. Ed, can you
> please retest with the if (con_is_bound) check just for the
> do_take_over_console call?
>
> Still puzzled wtf is going on here since as David says this should be a
> no-op.
>
> Thanks, Daniel
> > +
> > + /* Ignore "already unregistered". */
> > + if (ret = -ENODEV)
> > + ret = 0;
> > + }
> > }
> > console_unlock();
> >
> > -Chris
> >
>
>
^ permalink raw reply
* Re: [PATCH] video: backlight: ili922x.c: Cleaning up variable that is never used
From: Lee Jones @ 2014-07-07 10:50 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jingoo Han, Bryan Wu, Rickard Strandqvist,
Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev,
linux-kernel
In-Reply-To: <1404562270-18387-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sat, 05 Jul 2014, Rickard Strandqvist 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>
> ---
> drivers/video/backlight/ili922x.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Is this different from the patch I just applied?
> 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);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH] video: backlight: jornada720_lcd.c: Cleaning up variable that is never used
From: Lee Jones @ 2014-07-07 10:50 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jingoo Han, Bryan Wu, Rickard Strandqvist,
Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev,
linux-kernel
In-Reply-To: <1404562325-18471-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sat, 05 Jul 2014, Rickard Strandqvist 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>
> ---
> drivers/video/backlight/jornada720_lcd.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
Is this different from the patch I just NACKed?
> 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) {
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH] video: backlight: ili922x.c: Cleaning up variable that is never used
From: Lee Jones @ 2014-07-07 10:48 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jingoo Han, Bryan Wu, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, linux-fbdev, linux-kernel
In-Reply-To: <1404670847-17249-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sun, 06 Jul 2014, Rickard Strandqvist wrote:
> 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(-)
Applied, thanks.
> 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);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH] video: backlight: jornada720_lcd.c: Cleaning up variable that is never used
From: Lee Jones @ 2014-07-07 10:46 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jingoo Han, Bryan Wu, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, linux-fbdev, linux-kernel
In-Reply-To: <1404670906-17335-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(-)
Solve it the other way around.
Add a check and return the value if an error is returned.
> 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) {
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console
From: Ed Tomlinson @ 2014-07-07 10:45 UTC (permalink / raw)
To: Chris Wilson, Intel Graphics Development, DRI Development, LKML,
David Herrmann, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
linux-fbdev, Jani Nikula, Dave Airlie
In-Reply-To: <20140707084826.GH5821@phenom.ffwll.local>
Daniel,
I am not quite sure I understand what you want me to test?
Do you want me to try it without:
> > + if (ret = 0) {
> > + ret = do_unregister_con_driver(&vga_con);
Thanks
Ed
On Monday 07 July 2014 10:48:26 Daniel Vetter wrote:
> On Mon, Jun 30, 2014 at 07:59:55AM +0100, Chris Wilson wrote:
> > On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
> > > On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:
> > >
> > > Resend without html krud which causes list to bounce the message.
> > >
> > > > Hi
> > > >
> > > > This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git. Reverting it lets the boot proceed.
> > > >
> > > > I have an i7 with a built-in i915 and an pcie r7 260x. The R7 is the primary console. The i915 is initialized
> > > > but does not have a physical display attached.
> > > >
> > > > With the patch applied the boot stops at the messages:
> > > >
> > > > [drm] Memory usable by graphics device = 2048M
> > > > [drm] Replacing VGA console driver
> >
> > The issue looks like that we are ripping out the radeon fb_con whilst it
> > is active and that upsets everyone. In which case, I think the
> > compromise is:
> >
> >
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index 5f44581..4915f1d 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
> > #else
> > static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
> > {
> > - int ret;
> > + int ret = 0;
> >
> > DRM_INFO("Replacing VGA console driver\n");
> >
> > console_lock();
> > - ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
> > - if (ret = 0) {
> > - ret = do_unregister_con_driver(&vga_con);
> > -
> > - /* Ignore "already unregistered". */
> > - if (ret = -ENODEV)
> > - ret = 0;
> > + if (con_is_bound(&vga_con)) {
> > + ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
> > + if (ret = 0) {
> > + ret = do_unregister_con_driver(&vga_con);
>
> Hm, we should only conditionalize the take_over_console - unregistering
> vga_con is kinda the point to make sure it's gone for real. Ed, can you
> please retest with the if (con_is_bound) check just for the
> do_take_over_console call?
>
> Still puzzled wtf is going on here since as David says this should be a
> no-op.
>
> Thanks, Daniel
> > +
> > + /* Ignore "already unregistered". */
> > + if (ret = -ENODEV)
> > + ret = 0;
> > + }
> > }
> > console_unlock();
> >
> > -Chris
> >
>
>
^ permalink raw reply
* Re: [PATCH] video: fbdev: xen-fbfront.c: Cleaning up useless assignment of function parameter
From: Stefano Stabellini @ 2014-07-07 10:20 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Stefano Stabellini, Konrad Rzeszutek Wilk, Jingoo Han,
Daniel Vetter, linux-fbdev, linux-kernel
In-Reply-To: <1404667640-14855-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sun, 6 Jul 2014, Rickard Strandqvist wrote:
> 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>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 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
* Re: [PATCH] video: fbdev: sis: init.c: Cleaning up redundant condition is always true
From: Noralf Tronnes @ 2014-07-07 9:23 UTC (permalink / raw)
To: Dan Carpenter, Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
Daniel Vetter, Mauro Carvalho Chehab, Chen, Gong, linux-fbdev,
linux-kernel
In-Reply-To: <20140707075709.GI25934@mwanda>
Den 07.07.2014 09:57, skrev Dan Carpenter:
> On Thu, Jul 03, 2014 at 11:15:21PM +0200, Rickard Strandqvist wrote:
>> diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
>> index bd40f5e..9e2dd96 100644
>> --- a/drivers/video/fbdev/sis/init.c
>> +++ b/drivers/video/fbdev/sis/init.c
>> @@ -355,12 +355,12 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
>> }
>> break;
>> case 400:
>> - if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) {
>> + if ((!(VBFlags & CRT1_LCDA)) || (LCDwidth >= 600)) {
>
> It might be that this was supposed to be:
>
> if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth <= 800) && (LCDwidth >= 600))) {
>
> But why would people write a range from high to low? That's crazy
> people who write backwards code...
The numbers 800x600 (1024x768) indicate that LCDheight is meant to be used:
if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) &&
(LCDheight >= 600))) {
regards,
Noralf Tronnes
^ permalink raw reply
* Re: [Intel-gfx] [PATCH 5/5] drm/i915: Kick out vga console
From: Daniel Vetter @ 2014-07-07 8:48 UTC (permalink / raw)
To: Chris Wilson, Ed Tomlinson, Daniel Vetter,
Intel Graphics Development, DRI Development, LKML, David Herrmann,
Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev,
Jani Nikula, Dave Airlie
In-Reply-To: <20140630065955.GD7687@nuc-i3427.alporthouse.com>
On Mon, Jun 30, 2014 at 07:59:55AM +0100, Chris Wilson wrote:
> On Sat, Jun 28, 2014 at 11:55:19PM -0400, Ed Tomlinson wrote:
> > On Saturday 28 June 2014 15:28:22 Ed Tomlinson wrote:
> >
> > Resend without html krud which causes list to bounce the message.
> >
> > > Hi
> > >
> > > This commit ( a4de05268e674e8ed31df6348269e22d6c6a1803 ) hangs my boot with 3.16-git. Reverting it lets the boot proceed.
> > >
> > > I have an i7 with a built-in i915 and an pcie r7 260x. The R7 is the primary console. The i915 is initialized
> > > but does not have a physical display attached.
> > >
> > > With the patch applied the boot stops at the messages:
> > >
> > > [drm] Memory usable by graphics device = 2048M
> > > [drm] Replacing VGA console driver
>
> The issue looks like that we are ripping out the radeon fb_con whilst it
> is active and that upsets everyone. In which case, I think the
> compromise is:
>
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 5f44581..4915f1d 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1439,18 +1439,20 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
> #else
> static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
> {
> - int ret;
> + int ret = 0;
>
> DRM_INFO("Replacing VGA console driver\n");
>
> console_lock();
> - ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
> - if (ret = 0) {
> - ret = do_unregister_con_driver(&vga_con);
> -
> - /* Ignore "already unregistered". */
> - if (ret = -ENODEV)
> - ret = 0;
> + if (con_is_bound(&vga_con)) {
> + ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
> + if (ret = 0) {
> + ret = do_unregister_con_driver(&vga_con);
Hm, we should only conditionalize the take_over_console - unregistering
vga_con is kinda the point to make sure it's gone for real. Ed, can you
please retest with the if (con_is_bound) check just for the
do_take_over_console call?
Still puzzled wtf is going on here since as David says this should be a
no-op.
Thanks, Daniel
> +
> + /* Ignore "already unregistered". */
> + if (ret = -ENODEV)
> + ret = 0;
> + }
> }
> console_unlock();
>
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply
* Re: [PATCH] video: fbdev: sis: init.c: Cleaning up redundant condition is always true
From: Dan Carpenter @ 2014-07-07 7:57 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
Daniel Vetter, Mauro Carvalho Chehab, Chen, Gong, linux-fbdev,
linux-kernel
In-Reply-To: <1404422121-11298-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Thu, Jul 03, 2014 at 11:15:21PM +0200, Rickard Strandqvist wrote:
> diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
> index bd40f5e..9e2dd96 100644
> --- a/drivers/video/fbdev/sis/init.c
> +++ b/drivers/video/fbdev/sis/init.c
> @@ -355,12 +355,12 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
> }
> break;
> case 400:
> - if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) {
> + if ((!(VBFlags & CRT1_LCDA)) || (LCDwidth >= 600)) {
It might be that this was supposed to be:
if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth <= 800) && (LCDwidth >= 600))) {
But why would people write a range from high to low? That's crazy
people who write backwards code...
The second condition was supposed to do *something* although it's
unclear what. I would normally say that we should leave the static
checker warning here instead of guessing. Perhaps add a comment like
/* fixme: huh? What's with this nonsense condition? */ But in this
case it's all dead code because LCDwidth is always zero and the code
hasn't changed since 2.6.12 so I don't care.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] video: fbdev: mxsfb.c: Cleaning up variable that is never used
From: Marek Vasut @ 2014-07-06 21:06 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Grant Likely,
Rob Herring, Maxime Ripard, Lothar Waßmann, Jingoo Han,
Fabio Estevam, Julia Lawall, linux-fbdev, linux-kernel,
devicetree
In-Reply-To: <1404672272-19231-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sunday, July 06, 2014 at 08:44:32 PM, Rickard Strandqvist wrote:
> 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>
Makes perfect sense.
Acked-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply
* [PATCH] video: fbdev: via: lcd.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 19:03 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: <1404564798-22148-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/via/lcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/via/lcd.c b/drivers/video/fbdev/via/lcd.c
index 5d21ff4..c15ed30 100644
--- a/drivers/video/fbdev/via/lcd.c
+++ b/drivers/video/fbdev/via/lcd.c
@@ -551,11 +551,11 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
u32 clock;
struct via_display_timing timing;
struct fb_var_screeninfo panel_var;
- const struct fb_videomode *mode_crt_table, *panel_crt_table;
+ const struct fb_videomode, *panel_crt_table;
DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n");
/* Get mode table */
- mode_crt_table = viafb_get_best_mode(set_hres, set_vres, 60);
+ viafb_get_best_mode(set_hres, set_vres, 60);
/* Get panel table Pointer */
panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);
viafb_fill_var_timing_info(&panel_var, panel_crt_table);
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: valkyriefb.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 19:02 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Geert Uytterhoeven, Jingoo Han,
Daniel Vetter, Joe Perches, linux-fbdev, linux-kernel
In-Reply-To: <1404564740-22066-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/valkyriefb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c
index 97cb9bd..af708fe 100644
--- a/drivers/video/fbdev/valkyriefb.c
+++ b/drivers/video/fbdev/valkyriefb.c
@@ -416,18 +416,18 @@ static int read_valkyrie_sense(struct fb_info_valkyrie *p)
out_8(&p->valkyrie_regs->msense.r, 0); /* release all lines */
__delay(20000);
- sense = ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x70) << 4;
+ sense = ((in_8(&p->valkyrie_regs->msense.r)) & 0x70) << 4;
/* drive each sense line low in turn and collect the other 2 */
out_8(&p->valkyrie_regs->msense.r, 4); /* drive A low */
__delay(20000);
- sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x30);
+ sense |= ((in_8(&p->valkyrie_regs->msense.r)) & 0x30);
out_8(&p->valkyrie_regs->msense.r, 2); /* drive B low */
__delay(20000);
sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x40) >> 3;
sense |= (in & 0x10) >> 2;
out_8(&p->valkyrie_regs->msense.r, 1); /* drive C low */
__delay(20000);
- sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x60) >> 5;
+ sense |= ((in_8(&p->valkyrie_regs->msense.r)) & 0x60) >> 5;
out_8(&p->valkyrie_regs->msense.r, 7);
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 19:01 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Wang YanQing, Jingoo Han, Evgeniy Polyakov,
Joe Perches, Sachin Kamat, linux-fbdev, linux-kernel
In-Reply-To: <1404564682-21983-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/uvesafb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 509d452..50086b9 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -555,12 +555,12 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
struct uvesafb_par *par)
{
- int i, err;
+ int i;
uvesafb_reset(task);
task->t.regs.eax = 0x4f0a;
task->t.regs.ebx = 0x0;
- err = uvesafb_exec(task);
+ uvesafb_exec(task);
if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: sis: init301.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:59 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: <1402869130-4962-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/sis/init301.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
index a89e3ca..066fd27 100644
--- a/drivers/video/fbdev/sis/init301.c
+++ b/drivers/video/fbdev/sis/init301.c
@@ -926,7 +926,7 @@ SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo)
temp &= 0xFEFF;
if(!(myvbinfo & SetCRT2ToTV)) temp |= 0x0100;
SiS_SetRegShort((acpibase + 0x3a), temp);
- temp = SiS_GetRegShort((acpibase + 0x3a));
+ SiS_GetRegShort((acpibase + 0x3a));
}
#endif
@@ -2151,17 +2151,15 @@ SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned shor
unsigned short RefreshRateTableIndex)
{
unsigned short CRT2Index, VCLKIndex = 0, VCLKIndexGEN = 0, VCLKIndexGENCRT = 0;
- unsigned short modeflag, resinfo, tempbx;
+ unsigned short resinfo, tempbx;
const unsigned char *CHTVVCLKPtr = NULL;
if(ModeNo <= 0x13) {
- modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03;
VCLKIndexGENCRT = VCLKIndexGEN;
} else {
- modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: tdfxfb.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:59 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: <1404564624-21897-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/tdfxfb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c
index f761fe3..4efb2de 100644
--- a/drivers/video/fbdev/tdfxfb.c
+++ b/drivers/video/fbdev/tdfxfb.c
@@ -224,9 +224,7 @@ static inline u8 crt_inb(struct tdfx_par *par, u32 idx)
static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val)
{
- unsigned char tmp;
-
- tmp = vga_inb(par, IS1_R);
+ vga_inb(par, IS1_R);
vga_outb(par, ATT_IW, idx);
vga_outb(par, ATT_IW, val);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: savage: savagefb_driver.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:58 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: <1404564449-21633-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/savage/savagefb_driver.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/video/fbdev/savage/savagefb_driver.c b/drivers/video/fbdev/savage/savagefb_driver.c
index 4dbf45f..5c7620e 100644
--- a/drivers/video/fbdev/savage/savagefb_driver.c
+++ b/drivers/video/fbdev/savage/savagefb_driver.c
@@ -951,8 +951,6 @@ static int savagefb_check_var(struct fb_var_screeninfo *var,
if (memlen > vramlen) {
var->yres_virtual = vramlen * 8 /
(var->xres_virtual * var->bits_per_pixel);
- memlen = var->xres_virtual * var->bits_per_pixel *
- var->yres_virtual / 8;
}
/* we must round yres/xres down, we already rounded y/xres_virtual up
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: savage: savagefb.h: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:57 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: <1404564391-21548-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/savage/savagefb.h | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/video/fbdev/savage/savagefb.h b/drivers/video/fbdev/savage/savagefb.h
index dcaab90..8ff4ab1 100644
--- a/drivers/video/fbdev/savage/savagefb.h
+++ b/drivers/video/fbdev/savage/savagefb.h
@@ -351,32 +351,26 @@ static inline void VGAwSEQ(u8 index, u8 val, struct savagefb_par *par)
static inline void VGAenablePalette(struct savagefb_par *par)
{
- u8 tmp;
-
- tmp = vga_in8(0x3da, par);
+ vga_in8(0x3da, par);
vga_out8(0x3c0, 0x00, par);
par->paletteEnabled = 1;
}
static inline void VGAdisablePalette(struct savagefb_par *par)
{
- u8 tmp;
-
- tmp = vga_in8(0x3da, par);
+ vga_in8(0x3da, par);
vga_out8(0x3c0, 0x20, par);
par->paletteEnabled = 0;
}
static inline void VGAwATTR(u8 index, u8 value, struct savagefb_par *par)
{
- u8 tmp;
-
if (par->paletteEnabled)
index &= ~0x20;
else
index |= 0x20;
- tmp = vga_in8(0x3da, par);
+ vga_in8(0x3da, par);
vga_out8(0x3c0, index, par);
vga_out8 (0x3c0, value, par);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: riva: riva_hw.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:56 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: <1404564332-21450-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/riva/riva_hw.c | 50 ++++++++++--------------------------
1 file changed, 14 insertions(+), 36 deletions(-)
diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 78fdbf5..f760749 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -247,14 +247,13 @@ static int nv3_iterate(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_i
int mburst_size = 32;
int mmisses, gmisses, vmisses;
int misses;
- int vlwm, glwm, mlwm;
+ int vlwm, glwm;
int last, next, cur;
int max_gfsize ;
long ns;
vlwm = 0;
glwm = 0;
- mlwm = 0;
vfsize = 0;
gfsize = 0;
cur = ainfo->cur;
@@ -592,7 +591,7 @@ static void nv3CalcArbitration
ainfo.gr_en = 1;
ainfo.gdrain_rate = (int) state->pclk_khz * (state->pix_bpp/8);
ainfo.vdrain_rate = 0;
- res_gr = nv3_get_param(res_info, state, &ainfo);
+ nv3_get_param(res_info, state, &ainfo);
res_gr = ainfo.converged;
res_info->video_lwm = save_info.video_lwm;
res_info->video_burst_size = save_info.video_burst_size;
@@ -602,7 +601,7 @@ static void nv3CalcArbitration
{
if (!ainfo.gr_en) ainfo.gdrain_rate = 0;
if (!ainfo.vid_en) ainfo.vdrain_rate = 0;
- res_gr = nv3_get_param(res_info, state, &ainfo);
+ nv3_get_param(res_info, state, &ainfo);
res_info->valid = ainfo.converged;
}
}
@@ -657,13 +656,12 @@ static void nv4CalcArbitration
nv4_sim_state *arb
)
{
- int data, pagemiss, cas,width, video_enable, color_key_enable, bpp, align;
- int nvclks, mclks, pclks, vpagemiss, crtpagemiss, vbs;
+ int data, pagemiss, cas, width, video_enable, bpp;
+ int nvclks, mclks, vpagemiss, crtpagemiss, vbs;
int found, mclk_extra, mclk_loop, cbs, m1, p1;
int mclk_freq, pclk_freq, nvclk_freq, mp_enable;
int us_m, us_n, us_p, video_drain_rate, crtc_drain_rate;
int vpm_us, us_video, vlwm, video_fill_us, cpm_us, us_crt,clwm;
- int craw, vraw;
fifo->valid = 1;
pclk_freq = arb->pclk_khz;
@@ -673,14 +671,11 @@ static void nv4CalcArbitration
cas = arb->mem_latency;
width = arb->memory_width >> 6;
video_enable = arb->enable_video;
- color_key_enable = arb->gr_during_vid;
bpp = arb->pix_bpp;
- align = arb->mem_aligned;
mp_enable = arb->enable_mp;
clwm = 0;
vlwm = 0;
cbs = 128;
- pclks = 2;
nvclks = 2;
nvclks += 2;
nvclks += 1;
@@ -700,7 +695,6 @@ static void nv4CalcArbitration
if (mp_enable)
mclks+=4;
nvclks += 0;
- pclks += 0;
found = 0;
vbs = 0;
while (found != 1)
@@ -783,8 +777,6 @@ static void nv4CalcArbitration
mclk_extra--;
}
}
- craw = clwm;
- vraw = vlwm;
if (clwm < 384) clwm = 384;
if (vlwm < 128) vlwm = 128;
data = (int)(clwm);
@@ -843,17 +835,17 @@ static void nv10CalcArbitration
nv10_sim_state *arb
)
{
- int data, pagemiss, cas,width, video_enable, color_key_enable, bpp, align;
- int nvclks, mclks, pclks, vpagemiss, crtpagemiss, vbs;
- int nvclk_fill, us_extra;
+ int data, pagemiss, width, video_enable, bpp;
+ int nvclks, mclks, pclks, vpagemiss, crtpagemiss;
+ int nvclk_fill;
int found, mclk_extra, mclk_loop, cbs, m1;
int mclk_freq, pclk_freq, nvclk_freq, mp_enable;
- int us_m, us_m_min, us_n, us_p, video_drain_rate, crtc_drain_rate;
- int vus_m, vus_n, vus_p;
- int vpm_us, us_video, vlwm, cpm_us, us_crt,clwm;
+ int us_m, us_m_min, us_n, us_p, crtc_drain_rate;
+ int vus_m;
+ int vpm_us, us_video, cpm_us, us_crt, clwm;
int clwm_rnd_down;
- int craw, m2us, us_pipe, us_pipe_min, vus_pipe, p1clk, p2;
- int pclks_2_top_fifo, min_mclk_extra;
+ int m2us, us_pipe_min, p1clk, p2;
+ int min_mclk_extra;
int us_min_mclk_extra;
fifo->valid = 1;
@@ -861,18 +853,13 @@ static void nv10CalcArbitration
mclk_freq = arb->mclk_khz;
nvclk_freq = arb->nvclk_khz;
pagemiss = arb->mem_page_miss;
- cas = arb->mem_latency;
width = arb->memory_width/64;
video_enable = arb->enable_video;
- color_key_enable = arb->gr_during_vid;
bpp = arb->pix_bpp;
- align = arb->mem_aligned;
mp_enable = arb->enable_mp;
clwm = 0;
- vlwm = 1024;
cbs = 512;
- vbs = 512;
pclks = 4; /* lwm detect. */
@@ -933,17 +920,11 @@ static void nv10CalcArbitration
us_min_mclk_extra = min_mclk_extra *1000*1000 / mclk_freq;
us_n = nvclks*1000*1000 / nvclk_freq;/* nvclk latency in us */
us_p = pclks*1000*1000 / pclk_freq;/* nvclk latency in us */
- us_pipe = us_m + us_n + us_p;
us_pipe_min = us_m_min + us_n + us_p;
- us_extra = 0;
vus_m = mclk_loop *1000*1000 / mclk_freq; /* Mclk latency in us */
- vus_n = (4)*1000*1000 / nvclk_freq;/* nvclk latency in us */
- vus_p = 0*1000*1000 / pclk_freq;/* pclk latency in us */
- vus_pipe = vus_m + vus_n + vus_p;
if(video_enable) {
- video_drain_rate = pclk_freq * 4; /* MB/s */
crtc_drain_rate = pclk_freq * bpp/8; /* MB/s */
vpagemiss = 1; /* self generating page miss */
@@ -1002,7 +983,6 @@ static void nv10CalcArbitration
else if(crtc_drain_rate * 100 >= nvclk_fill * 98) {
clwm = 1024;
cbs = 512;
- us_extra = (cbs * 1000 * 1000)/ (8*width)/mclk_freq ;
}
}
}
@@ -1019,7 +999,6 @@ static void nv10CalcArbitration
m1 = clwm + cbs - 1024; /* Amount of overfill */
m2us = us_pipe_min + us_min_mclk_extra;
- pclks_2_top_fifo = (1024-clwm)/(8*width);
/* pclk cycles to drain */
p1clk = m2us * pclk_freq/(1000*1000);
@@ -1047,7 +1026,6 @@ static void nv10CalcArbitration
min_mclk_extra--;
}
}
- craw = clwm;
if(clwm < (1024-cbs+8)) clwm = 1024-cbs+8;
data = (int)(clwm);
@@ -1863,7 +1841,7 @@ static void SetStartAddress3
/*
* 4 pixel pan register.
*/
- offset = VGA_RD08(chip->PCIO, chip->IO + 0x0A);
+ VGA_RD08(chip->PCIO, chip->IO + 0x0A);
VGA_WR08(chip->PCIO, 0x3C0, 0x13);
VGA_WR08(chip->PCIO, 0x3C0, pan);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: pxa168fb.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:55 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: <1404564274-21364-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/pxa168fb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c
index c95b9e4..fd6c56b 100644
--- a/drivers/video/fbdev/pxa168fb.c
+++ b/drivers/video/fbdev/pxa168fb.c
@@ -405,9 +405,8 @@ static int pxa168fb_set_par(struct fb_info *info)
struct fb_var_screeninfo *var = &info->var;
struct fb_videomode mode;
u32 x;
- struct pxa168fb_mach_info *mi;
- mi = dev_get_platdata(fbi->dev);
+ dev_get_platdata(fbi->dev);
/*
* Set additional mode info.
@@ -787,7 +786,6 @@ static int pxa168fb_remove(struct platform_device *pdev)
{
struct pxa168fb_info *fbi = platform_get_drvdata(pdev);
struct fb_info *info;
- int irq;
unsigned int data;
if (!fbi)
@@ -807,7 +805,7 @@ static int pxa168fb_remove(struct platform_device *pdev)
if (info->cmap.len)
fb_dealloc_cmap(&info->cmap);
- irq = platform_get_irq(pdev, 0);
+ platform_get_irq(pdev, 0);
dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
info->screen_base, info->fix.smem_start);
--
1.7.10.4
^ permalink raw reply related
* [PATCH] video: fbdev: pvr2fb.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-06 18:54 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: <1404564207-21282-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/pvr2fb.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c
index 167cfff..da06b16 100644
--- a/drivers/video/fbdev/pvr2fb.c
+++ b/drivers/video/fbdev/pvr2fb.c
@@ -1075,7 +1075,6 @@ static struct pvr2_board {
static int __init pvr2fb_init(void)
{
int i, ret = -ENODEV;
- int size;
#ifndef MODULE
char *option = NULL;
@@ -1084,7 +1083,6 @@ static int __init pvr2fb_init(void)
return -ENODEV;
pvr2fb_setup(option);
#endif
- size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32);
fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL);
--
1.7.10.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox