Linux-fbdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1 0/28] drivers/video: W=1 warning fixes
@ 2020-11-27 19:57 Sam Ravnborg
  2020-11-27 19:57 ` [PATCH v1 01/28] video: Fix W=1 warnings in of_videomode + of_display_timing Sam Ravnborg
                   ` (26 more replies)
  0 siblings, 27 replies; 33+ messages in thread
From: Sam Ravnborg @ 2020-11-27 19:57 UTC (permalink / raw)
  To: linux-fbdev, dri-devel, Lee Jones
  Cc: Aditya Pakki, Alexander Klimov, Alex Dewar, Antonino Daplas,
	Arnd Bergmann, Bartlomiej Zolnierkiewicz, Benjamin Herrenschmidt,
	Daniel Vetter, Evgeny Novikov, Ferenc Bakonyi,
	Florian Tobias Schandinat, George Kennedy, Greg Kroah-Hartman,
	Gustavo Silva, Jani Nikula, Jason Yan, Jingoo Han, Jiri Slaby,
	Joe Perches, Kristoffer Ericson, Laurent Pinchart, linux-nvidia,
	Michal Januszewski, Mike Rapoport, Nathan Chancellor, Peilin Ye,
	Peter Rosin, Qilong Zhang, Randy Dunlap, Saeed Mirzamohammadi,
	Sam Ravnborg, Tetsuo Handa, Thomas Winischhofer,
	Thomas Zimemrmann, Vaibhav Gupta, Xiaofei Tan

Following the great work of Lee Jones in other subsystems
here is a set of patches that address all remaining W=1
warnings in drivers/video/.
Lee Jones already fixed all warnings in video/backlight/ so
this is mostly fbdev related fixes.

The general approach used were:
- Fix kernel-doc, this is often very trivial
- Drop unused local variables
- Use no_printk for local logging support

Build tested on a set of architectures with various configs.

The patches do not depends on each other and in most cases all
fixes for one driver is kept in a single patch.

The individual changes are trivial so this is a great
starter task to try to review these patches.

A timely Reviewed-by: or Acked-by: would be very nice so we can
get the warnings fixes before we cut for the merge window.

	Sam


Sam Ravnborg (28):
      video: Fix W=1 warnings in of_videomode + of_display_timing
      video: fbcon: Use pr_debug() in fbcon
      video: fbdev: core: Fix W=1 warnings in fbmon + fb_notify
      video: fbdev: aty: Delete unused variable in radeon_monitor
      video: fbdev: aty: Fix W=1 warnings in atyfb_base
      video: fbdev: aty: Fix W=1 warnings in mach64_ct
      video: fbdev: sis: Fix W=1 warnings about static symbols
      video: fbdev: sis: Fix W=1 warning about SiS_TVDelay
      video: fbdev: sis: Fix W=1 warnings in init.c
      video: fbdev: sis: Fix W=1 warnings in sis_main
      video: fbdev: via: Fix W=1 warnings
      video: fbdev: tdfx: Fix W=1 warnings
      video: fbdev: riva: Fix W=1 warnings
      video: fbdev: pm2fb: Fix W=1 warnings
      video: fbdev: neofb: Fix W=1 warnings
      video: fbdev: hgafb: Fix W=1 warnings
      video: fbdev: tgafb: Fix W=1 warnings
      video: fbdev: mx3fb: Fix W=1 warnings
      video: fbdev: sstfb: Fix W=1 warnings
      video: fbdev: nvidia: Fix W=1 warnings
      video: fbdev: tmiofb: Fix W=1 warnings
      video: fbdev: omapfb: Fix W=1 warnings in dsi
      video: fbdev: omapfb: Fix W=1 warnings in hdmi*_core
      video: fbdev: s3c-fb: Fix W=1 warnings
      video: fbdev: uvesafb: Fix W=1 warning
      video: fbdev: uvesafb: Fix W=1 string related warnings
      video: fbdev: cirrusfb: Fix W=1 warnings
      video: fbdev: s1d13xxxfb: Fix W=1 warnings

 drivers/video/fbdev/aty/atyfb_base.c              | 12 ++------
 drivers/video/fbdev/aty/mach64_ct.c               | 15 ++++++----
 drivers/video/fbdev/aty/radeon_monitor.c          |  4 +--
 drivers/video/fbdev/cirrusfb.c                    | 20 ++++++-------
 drivers/video/fbdev/core/fb_notify.c              |  3 +-
 drivers/video/fbdev/core/fbcon.c                  | 20 ++++---------
 drivers/video/fbdev/core/fbmon.c                  |  2 +-
 drivers/video/fbdev/hgafb.c                       |  4 +--
 drivers/video/fbdev/mx3fb.c                       | 13 +++++----
 drivers/video/fbdev/neofb.c                       |  4 ---
 drivers/video/fbdev/nvidia/nv_setup.c             |  7 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c        | 12 ++------
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c |  4 +--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c |  4 +--
 drivers/video/fbdev/pm2fb.c                       |  8 +++---
 drivers/video/fbdev/riva/fbdev.c                  |  9 +++---
 drivers/video/fbdev/riva/riva_hw.c                | 28 ++++++-------------
 drivers/video/fbdev/s1d13xxxfb.c                  |  3 +-
 drivers/video/fbdev/s3c-fb.c                      | 11 ++++----
 drivers/video/fbdev/sis/init.c                    | 34 ++++-------------------
 drivers/video/fbdev/sis/oem310.h                  |  2 ++
 drivers/video/fbdev/sis/sis.h                     |  1 -
 drivers/video/fbdev/sis/sis_main.c                |  9 +++---
 drivers/video/fbdev/sstfb.c                       |  2 +-
 drivers/video/fbdev/tdfxfb.c                      |  4 +--
 drivers/video/fbdev/tgafb.c                       |  7 ++---
 drivers/video/fbdev/tmiofb.c                      |  6 ++--
 drivers/video/fbdev/uvesafb.c                     |  8 +++---
 drivers/video/fbdev/via/lcd.c                     |  4 +--
 drivers/video/of_display_timing.c                 |  1 +
 drivers/video/of_videomode.c                      |  8 +++---
 include/video/sstfb.h                             |  4 +--
 32 files changed, 104 insertions(+), 169 deletions(-)



^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCH v1 05/28] video: fbdev: aty: Fix W=1 warnings in atyfb_base
  2020-11-27 19:57 [PATCH v1 0/28] drivers/video: W=1 warning fixes Sam Ravnborg
@ 2020-11-27 19:58 Sam Ravnborg
  2020-11-27 23:29 ` kernel test robot
  26 siblings, 1 reply; 33+ messages in thread
From: Sam Ravnborg @ 2020-11-27 19:58 UTC (permalink / raw)
  To: linux-fbdev, dri-devel, Lee Jones
  Cc: Aditya Pakki, Alexander Klimov, Alex Dewar, Antonino Daplas,
	Arnd Bergmann, Bartlomiej Zolnierkiewicz, Benjamin Herrenschmidt,
	Daniel Vetter, Evgeny Novikov, Ferenc Bakonyi,
	Florian Tobias Schandinat, George Kennedy, Greg Kroah-Hartman,
	Gustavo Silva, Jani Nikula, Jason Yan, Jingoo Han, Jiri Slaby,
	Joe Perches, Kristoffer Ericson, Laurent Pinchart, linux-nvidia,
	Michal Januszewski, Mike Rapoport, Nathan Chancellor, Peilin Ye,
	Peter Rosin, Qilong Zhang, Randy Dunlap, Saeed Mirzamohammadi,
	Sam Ravnborg, Tetsuo Handa, Thomas Winischhofer,
	Thomas Zimemrmann, Vaibhav Gupta, Xiaofei Tan

Fix W=1 warnings about variables assigned but never used.

- Drop variables that was never used
- Avoid using a local variable by moving the expression to an if
  condition

Signed-off-by: Sam Ravnborg <sam@ravnborg.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 | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index c8feff0ee8da..d1eb9218debb 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -2360,22 +2360,20 @@ 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;
+		aty_ld_le32(DAC_CNTL, par);
 #ifdef CONFIG_ATARI
 		clk_type = CLK_ATI18818_1;
-		dac_type = (stat0 >> 9) & 0x07;
-		if (dac_type == 0x07)
+		if (((stat0 >> 9) & 0x07) == 0x07)
 			dac_subtype = DAC_ATT20C408;
 		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 +3060,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 +3075,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.
 		 */
-- 
2.27.0


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, back to index

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 19:57 [PATCH v1 0/28] drivers/video: W=1 warning fixes Sam Ravnborg
2020-11-27 19:57 ` [PATCH v1 01/28] video: Fix W=1 warnings in of_videomode + of_display_timing Sam Ravnborg
2020-11-28  8:28   ` Lee Jones
2020-11-28 15:15     ` Sam Ravnborg
2020-11-27 19:57 ` [PATCH v1 02/28] video: fbcon: Use pr_debug() in fbcon Sam Ravnborg
2020-11-27 21:16   ` Joe Perches
2020-11-27 22:36     ` Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 03/28] video: fbdev: core: Fix W=1 warnings in fbmon + fb_notify Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 04/28] video: fbdev: aty: Delete unused variable in radeon_monitor Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 06/28] video: fbdev: aty: Fix W=1 warnings in mach64_ct Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 07/28] video: fbdev: sis: Fix W=1 warnings about static symbols Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 08/28] video: fbdev: sis: Fix W=1 warning about SiS_TVDelay Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 09/28] video: fbdev: sis: Fix W=1 warnings in init.c Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 10/28] video: fbdev: sis: Fix W=1 warnings in sis_main Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 11/28] video: fbdev: via: Fix W=1 warnings Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 12/28] video: fbdev: tdfx: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 13/28] video: fbdev: riva: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 14/28] video: fbdev: pm2fb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 15/28] video: fbdev: neofb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 16/28] video: fbdev: hgafb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 17/28] video: fbdev: tgafb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 18/28] video: fbdev: mx3fb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 19/28] video: fbdev: sstfb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 20/28] video: fbdev: nvidia: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 21/28] video: fbdev: tmiofb: " Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 22/28] video: fbdev: omapfb: Fix W=1 warnings in dsi Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 23/28] video: fbdev: omapfb: Fix W=1 warnings in hdmi*_core Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 24/28] video: fbdev: s3c-fb: Fix W=1 warnings Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 25/28] video: fbdev: uvesafb: Fix W=1 warning Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 26/28] video: fbdev: uvesafb: Fix W=1 string related warnings Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 27/28] video: fbdev: cirrusfb: Fix W=1 warnings Sam Ravnborg
2020-11-27 19:58 ` [PATCH v1 28/28] video: fbdev: s1d13xxxfb: " Sam Ravnborg
2020-11-27 19:58 [PATCH v1 05/28] video: fbdev: aty: Fix W=1 warnings in atyfb_base Sam Ravnborg
2020-11-27 23:29 ` kernel test robot

Linux-fbdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fbdev/0 linux-fbdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fbdev linux-fbdev/ https://lore.kernel.org/linux-fbdev \
		linux-fbdev@vger.kernel.org
	public-inbox-index linux-fbdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fbdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git