Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

video: fbdev: aty: Fix set but not used warnings in mach64_ct

Fix W=1 warnings about variables assigned but never used.
- One variable is only used when CONFIG_FB_ATY_GENERIC_LCD is defined
Fix so variable is only defined with CONFIG_FB_ATY_GENERIC_LCD
- Several variables was only assigned by a call to aty_ld_le32().
Drop the variables but keep the call to aty_ld_le32() as it may
have unexpected side-effects.

v2:
- Updated subject (Lee)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Lee Jones <lee.jones@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201128224114.1033617-7-sam@ravnborg.org

+9 -6
+9 -6
drivers/video/fbdev/aty/mach64_ct.c
··· 281 281 void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll) 282 282 { 283 283 struct atyfb_par *par = (struct atyfb_par *) info->par; 284 - u32 crtc_gen_cntl, lcd_gen_cntrl; 284 + u32 crtc_gen_cntl; 285 285 u8 tmp, tmp2; 286 286 287 - lcd_gen_cntrl = 0; 287 + #ifdef CONFIG_FB_ATY_GENERIC_LCD 288 + u32 lcd_gen_cntrl = 0; 289 + #endif 290 + 288 291 #ifdef DEBUG 289 292 printk("atyfb(%s): about to program:\n" 290 293 "pll_ext_cntl=0x%02x pll_gen_cntl=0x%02x pll_vclk_cntl=0x%02x\n", ··· 405 402 struct atyfb_par *par = (struct atyfb_par *) info->par; 406 403 u8 mpost_div, xpost_div, sclk_post_div_real; 407 404 u32 q, memcntl, trp; 408 - u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off; 405 + u32 dsp_config; 409 406 #ifdef DEBUG 410 407 int pllmclk, pllsclk; 411 408 #endif ··· 491 488 492 489 /* Allow BIOS to override */ 493 490 dsp_config = aty_ld_le32(DSP_CONFIG, par); 494 - dsp_on_off = aty_ld_le32(DSP_ON_OFF, par); 495 - vga_dsp_config = aty_ld_le32(VGA_DSP_CONFIG, par); 496 - vga_dsp_on_off = aty_ld_le32(VGA_DSP_ON_OFF, par); 491 + aty_ld_le32(DSP_ON_OFF, par); 492 + aty_ld_le32(VGA_DSP_CONFIG, par); 493 + aty_ld_le32(VGA_DSP_ON_OFF, par); 497 494 498 495 if (dsp_config) 499 496 pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 16;