Message ID | 20201128224114.1033617-6-sam@ravnborg.org (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | drivers/video: W=1 warning fixes | expand |
Am 28.11.20 um 23:40 schrieb Sam Ravnborg: > Fix W=1 warnings about variables assigned but never used. > > - Drop variables that was set but never used s/that was/that were > - Make variable definition conditional om ATARI s/om/on > > v2: > - Fix m68k build error (kernel test robot) > - Improve subject (Lee Jones) > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > Reported-by: kernel test robot <lkp@intel.com> # m68k build fix > Cc: Lee Jones <lee.jones@linaro.org> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Sam Ravnborg <sam@ravnborg.org> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Joe Perches <joe@perches.com> > Cc: Vaibhav Gupta <vaibhavgupta40@gmail.com> > Cc: Jason Yan <yanaijie@huawei.com> > Cc: Randy Dunlap <rdunlap@infradead.org> > Cc: Jani Nikula <jani.nikula@intel.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> > --- > drivers/video/fbdev/aty/atyfb_base.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c > index c8feff0ee8da..83c8e809955a 100644 > --- a/drivers/video/fbdev/aty/atyfb_base.c > +++ b/drivers/video/fbdev/aty/atyfb_base.c > @@ -2353,6 +2353,9 @@ static int aty_init(struct fb_info *info) > int gtb_memsize, has_var = 0; > struct fb_var_screeninfo var; > int ret; > +#ifdef CONFIG_ATARI > + u8 dac_type; > +#endif > > init_waitqueue_head(&par->vblank.wait); > spin_lock_init(&par->int_lock); > @@ -2360,13 +2363,12 @@ static int aty_init(struct fb_info *info) > #ifdef CONFIG_FB_ATY_GX > if (!M64_HAS(INTEGRATED)) { > u32 stat0; > - u8 dac_type, dac_subtype, clk_type; > + u8 dac_subtype, clk_type; > stat0 = aty_ld_le32(CNFG_STAT0, par); > par->bus_type = (stat0 >> 0) & 0x07; > par->ram_type = (stat0 >> 3) & 0x07; > ramname = aty_gx_ram[par->ram_type]; > /* FIXME: clockchip/RAMDAC probing? */ > - dac_type = (aty_ld_le32(DAC_CNTL, par) >> 16) & 0x07; > #ifdef CONFIG_ATARI > clk_type = CLK_ATI18818_1; > dac_type = (stat0 >> 9) & 0x07; > @@ -2375,7 +2377,6 @@ static int aty_init(struct fb_info *info) > else > dac_subtype = (aty_ld_8(SCRATCH_REG1 + 1, par) & 0xF0) | dac_type; > #else > - dac_type = DAC_IBMRGB514; > dac_subtype = DAC_IBMRGB514; > clk_type = CLK_IBMRGB514; > #endif > @@ -3062,7 +3063,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; > @@ -3078,9 +3078,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. > */ >
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index c8feff0ee8da..83c8e809955a 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -2353,6 +2353,9 @@ static int aty_init(struct fb_info *info) int gtb_memsize, has_var = 0; struct fb_var_screeninfo var; int ret; +#ifdef CONFIG_ATARI + u8 dac_type; +#endif init_waitqueue_head(&par->vblank.wait); spin_lock_init(&par->int_lock); @@ -2360,13 +2363,12 @@ static int aty_init(struct fb_info *info) #ifdef CONFIG_FB_ATY_GX if (!M64_HAS(INTEGRATED)) { u32 stat0; - u8 dac_type, dac_subtype, clk_type; + u8 dac_subtype, clk_type; stat0 = aty_ld_le32(CNFG_STAT0, par); par->bus_type = (stat0 >> 0) & 0x07; par->ram_type = (stat0 >> 3) & 0x07; ramname = aty_gx_ram[par->ram_type]; /* FIXME: clockchip/RAMDAC probing? */ - dac_type = (aty_ld_le32(DAC_CNTL, par) >> 16) & 0x07; #ifdef CONFIG_ATARI clk_type = CLK_ATI18818_1; dac_type = (stat0 >> 9) & 0x07; @@ -2375,7 +2377,6 @@ static int aty_init(struct fb_info *info) else dac_subtype = (aty_ld_8(SCRATCH_REG1 + 1, par) & 0xF0) | dac_type; #else - dac_type = DAC_IBMRGB514; dac_subtype = DAC_IBMRGB514; clk_type = CLK_IBMRGB514; #endif @@ -3062,7 +3063,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; @@ -3078,9 +3078,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. */
Fix W=1 warnings about variables assigned but never used. - Drop variables that was set but never used - Make variable definition conditional om ATARI v2: - Fix m68k build error (kernel test robot) - Improve subject (Lee Jones) Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reported-by: kernel test robot <lkp@intel.com> # m68k build fix Cc: Lee Jones <lee.jones@linaro.org> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Joe Perches <joe@perches.com> Cc: Vaibhav Gupta <vaibhavgupta40@gmail.com> Cc: Jason Yan <yanaijie@huawei.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Jani Nikula <jani.nikula@intel.com> --- drivers/video/fbdev/aty/atyfb_base.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)