Skip to contentSkip to conversation

drivers/video: W=1 warning fixes

PATCH Applied Sam Ravnborg 7 participants 78 messages Nov 28, 2020 – Dec 5, 2020

Subsystems (11)

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover drivers/video: W=1 warning fixes

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.

v2:
- Updated subject of the patches to tell what was fixed (Lee)
- Fixed build error in one patch (kernel test robot)
- A few editorials updates to the changelog messages

Sam

Sam Ravnborg (28):
video: Fix kernel-doc warnings in of_display_timing + of_videomode
video: fbcon: Fix warnings by using pr_debug() in fbcon
video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify
video: fbdev: aty: Delete unused variable in radeon_monitor
video: fbdev: aty: Fix set but not used warnings
video: fbdev: aty: Fix set but not used warnings in mach64_ct
video: fbdev: sis: Fix defined but not used warnings
video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay
video: fbdev: sis: Fix set but not used warnings in init.c
video: fbdev: sis: Fix set but not used warnings in sis_main
video: fbdev: via: Fix set but not used warning for mode_crt_table
video: fbdev: tdfx: Fix set but not used warning in att_outb()
video: fbdev: riva: Fix kernel-doc and set but not used warnings
video: fbdev: pm2fb: Fix kernel-doc warnings
video: fbdev: neofb: Fix set but not used warning for CursorMem
video: fbdev: hgafb: Fix kernel-doc warnings
video: fbdev: tgafb: Fix kernel-doc and set but not used warnings
video: fbdev: mx3fb: Fix kernel-doc, set but not used and string warnings
video: fbdev: sstfb: Updated logging to fix set but not used warnings
video: fbdev: nvidia: Fix set but not used warnings
video: fbdev: tmiofb: Fix set but not used warnings
video: fbdev: omapfb: Fix set but not used warnings in dsi
video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core
video: fbdev: s3c-fb: Fix kernel-doc and set but not used warnings
video: fbdev: uvesafb: Fix set but not used warning
video: fbdev: uvesafb: Fix string related warnings
video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings
video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

 drivers/video/fbdev/aty/atyfb_base.c              | 11 +++-----
 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                  | 25 ++++++-----------
 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, 107 insertions(+), 170 deletions(-)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH v2 1/28 video: Fix kernel-doc warnings in of_display_timing + of_videomode

Fix kernel-doc warnings reported when using W=1.

v2:
- Improve subject (Lee)

---
 drivers/video/of_display_timing.c | 1 +
 drivers/video/of_videomode.c      | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/video/of_display_timing.c +1 -0
index abc9ada798ee..f93b6abbe258 100644
@@ -52,6 +52,7 @@ static int parse_timing_property(const struct device_node *np, const char *name,
 /**
  * of_parse_display_timing - parse display_timing entry from device_node
  * @np: device_node with the properties
+ * @dt: display_timing that contains the result. I may be partially written in case of errors
  **/
 static int of_parse_display_timing(const struct device_node *np,
 		struct display_timing *dt)
drivers/video/of_videomode.c +4 -4
index 67aff2421c29..a5bb02f02b44 100644
@@ -13,10 +13,10 @@
 #include <video/videomode.h>
 
 /**
- * of_get_videomode - get the videomode #<index> from devicetree
- * @np - devicenode with the display_timings
- * @vm - set to return value
- * @index - index into list of display_timings
+ * of_get_videomode: get the videomode #<index> from devicetree
+ * @np: devicenode with the display_timings
+ * @vm: set to return value
+ * @index: index into list of display_timings
  *	    (Set this to OF_USE_NATIVE_MODE to use whatever mode is
  *	     specified as native mode in the DT.)
  *
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 1/28
#2 lore raw

Re: [PATCH v2 01/28] video: Fix kernel-doc warnings in of_display_timing + of_videomode

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 30 lines

Fix kernel-doc warnings reported when using W=1.

v2:
- Improve subject (Lee)

---
  drivers/video/of_display_timing.c | 1 +
  drivers/video/of_videomode.c      | 8 ++++----
  2 files changed, 5 insertions(+), 4 deletions(-)
drivers/video/of_display_timing.c +1 -0
index abc9ada798ee..f93b6abbe258 100644
@@ -52,6 +52,7 @@ static int parse_timing_property(const struct device_node *np, const char *name,
  /**
   * of_parse_display_timing - parse display_timing entry from device_node
   * @np: device_node with the properties
+ * @dt: display_timing that contains the result. I may be partially written in case of errors
   **/
  static int of_parse_display_timing(const struct device_node *np,
  		struct display_timing *dt)
drivers/video/of_videomode.c +0 -0
index 67aff2421c29..a5bb02f02b44 100644

drivers/video/of_videomode.c line 16

Quoted 4 lines
drivers/video/of_videomode.c +0 -1
@@ -13,10 +13,10 @@
  #include <video/videomode.h>
 
  /**
- * of_get_videomode - get the videomode #<index> from devicetree

What's wrong with this line? We use the dash in lots of places?

Besides this,

Quoted 11 lines
drivers/video/of_videomode.c +4 -3
- * @np - devicenode with the display_timings
- * @vm - set to return value
- * @index - index into list of display_timings
+ * of_get_videomode: get the videomode #<index> from devicetree
+ * @np: devicenode with the display_timings
+ * @vm: set to return value
+ * @index: index into list of display_timings
   *	    (Set this to OF_USE_NATIVE_MODE to use whatever mode is
   *	     specified as native mode in the DT.)
   *
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH v2 01/28] video: Fix kernel-doc warnings in of_display_timing + of_videomode

Quoted 30 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 27 lines

Fix kernel-doc warnings reported when using W=1.

v2:
- Improve subject (Lee)

---
  drivers/video/of_display_timing.c | 1 +
  drivers/video/of_videomode.c      | 8 ++++----
  2 files changed, 5 insertions(+), 4 deletions(-)
drivers/video/of_display_timing.c +1 -0
index abc9ada798ee..f93b6abbe258 100644
@@ -52,6 +52,7 @@ static int parse_timing_property(const struct device_node *np, const char *name,
  /**
   * of_parse_display_timing - parse display_timing entry from device_node
   * @np: device_node with the properties
+ * @dt: display_timing that contains the result. I may be partially written in case of errors
   **/
  static int of_parse_display_timing(const struct device_node *np,
  		struct display_timing *dt)
drivers/video/of_videomode.c +0 -0
index 67aff2421c29..a5bb02f02b44 100644
Quoted 8 lines

drivers/video/of_videomode.c line 15

Quoted 6 lines
drivers/video/of_videomode.c +0 -1
@@ -13,10 +13,10 @@
  #include <video/videomode.h>
  /**
- * of_get_videomode - get the videomode #<index> from devicetree

What's wrong with this line? We use the dash in lots of places?

I think my OCD kicked in and I made all lines use ':'. I will re-add the dash when I apply.

Quoted 4 lines

Besides this,

Thanks
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author Applied
#4 lore raw

Re: [PATCH v2 01/28] video: Fix kernel-doc warnings in of_display_timing + of_videomode

In reply to Sam Ravnborg
Quoted 8 lines · Sam Ravnborg

Fix kernel-doc warnings reported when using W=1.

v2:
- Improve subject (Lee)

Applied to drm-misc-next after fixing nit that Thomas pointed out.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

PATCH v2 2/28 video: fbcon: Fix warnings by using pr_debug() in fbcon

In reply to Sam Ravnborg

Replacing DPRINTK() statements with pr_debug fixes set but not used warnings. And moves to a more standard logging setup at the same time.

v2:
- Fix indent (Joe)

Cc Joe Perches <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Peilin Ye <[email protected]>
Cc Tetsuo Handa <[email protected]>
Cc George Kennedy <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Peter Rosin <[email protected]>
---
 drivers/video/fbdev/core/fbcon.c | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)
drivers/video/fbdev/core/fbcon.c +8 -17
index bf61598bf1c3..44a5cd2f54cc 100644
@@ -56,8 +56,6 @@
  *  more details.
  */
 
-#undef FBCONDEBUG
-
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/fs.h>
@@ -82,12 +80,6 @@
 
 #include "fbcon.h"
 
-#ifdef FBCONDEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
-#else
-#  define DPRINTK(fmt, args...)
-#endif
-
 /*
  * FIXME: Locking
  *
@@ -1015,11 +1007,11 @@ static const char *fbcon_startup(void)
 	rows /= vc->vc_font.height;
 	vc_resize(vc, cols, rows);
 
-	DPRINTK("mode:   %s\n", info->fix.id);
-	DPRINTK("visual: %d\n", info->fix.visual);
-	DPRINTK("res:    %dx%d-%d\n", info->var.xres,
-		info->var.yres,
-		info->var.bits_per_pixel);
+	pr_debug("mode:   %s\n", info->fix.id);
+	pr_debug("visual: %d\n", info->fix.visual);
+	pr_debug("res:    %dx%d-%d\n", info->var.xres,
+		 info->var.yres,
+		 info->var.bits_per_pixel);
 
 	fbcon_add_cursor_timer(info);
 	return display_desc;
@@ -2013,7 +2005,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
 	    y_diff < 0 || y_diff > virt_fh) {
 		const struct fb_videomode *mode;
 
-		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
+		pr_debug("attempting resize %ix%i\n", var.xres, var.yres);
 		mode = fb_find_best_mode(&var, &info->modelist);
 		if (mode == NULL)
 			return -EINVAL;
@@ -2023,7 +2015,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
 		if (virt_w > var.xres/virt_fw || virt_h > var.yres/virt_fh)
 			return -EINVAL;
 
-		DPRINTK("resize now %ix%i\n", var.xres, var.yres);
+		pr_debug("resize now %ix%i\n", var.xres, var.yres);
 		if (con_is_visible(vc)) {
 			var.activate = FB_ACTIVATE_NOW |
 				FB_ACTIVATE_FORCE;
@@ -3299,8 +3291,7 @@ static void fbcon_exit(void)
 
 		if (info->queue.func)
 			pending = cancel_work_sync(&info->queue);
-		DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
-			"no"));
+		pr_debug("fbcon: %s pending work\n", (pending ? "canceled" : "no"));
 
 		for (j = first_fb_vc; j <= last_fb_vc; j++) {
 			if (con2fb_map[j] == i) {
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 2/28
#6 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 27 lines

Replacing DPRINTK() statements with pr_debug fixes set but not used warnings. And moves to a more standard logging setup at the same time.

v2:
- Fix indent (Joe)

Cc Joe Perches <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Peilin Ye <[email protected]>
Cc Tetsuo Handa <[email protected]>
Cc George Kennedy <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Peter Rosin <[email protected]>
---
  drivers/video/fbdev/core/fbcon.c | 25 ++++++++-----------------
  1 file changed, 8 insertions(+), 17 deletions(-)
drivers/video/fbdev/core/fbcon.c +0 -0
index bf61598bf1c3..44a5cd2f54cc 100644

drivers/video/fbdev/core/fbcon.c line 60

Quoted 5 lines
drivers/video/fbdev/core/fbcon.c +0 -2
@@ -56,8 +56,6 @@
   *  more details.
   */
 
-#undef FBCONDEBUG
-

I guess this was added for quick debugging during development. Anyway, I never liked these kinds of hacks.

Quoted 62 lines
drivers/video/fbdev/core/fbcon.c +8 -15
  #include <linux/module.h>
  #include <linux/types.h>
  #include <linux/fs.h>
@@ -82,12 +80,6 @@
 
  #include "fbcon.h"
 
-#ifdef FBCONDEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
-#else
-#  define DPRINTK(fmt, args...)
-#endif
-
  /*
   * FIXME: Locking
   *
@@ -1015,11 +1007,11 @@ static const char *fbcon_startup(void)
  	rows /= vc->vc_font.height;
  	vc_resize(vc, cols, rows);
 
-	DPRINTK("mode:   %s\n", info->fix.id);
-	DPRINTK("visual: %d\n", info->fix.visual);
-	DPRINTK("res:    %dx%d-%d\n", info->var.xres,
-		info->var.yres,
-		info->var.bits_per_pixel);
+	pr_debug("mode:   %s\n", info->fix.id);
+	pr_debug("visual: %d\n", info->fix.visual);
+	pr_debug("res:    %dx%d-%d\n", info->var.xres,
+		 info->var.yres,
+		 info->var.bits_per_pixel);
 
  	fbcon_add_cursor_timer(info);
  	return display_desc;
@@ -2013,7 +2005,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
  	    y_diff < 0 || y_diff > virt_fh) {
  		const struct fb_videomode *mode;
 
-		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
+		pr_debug("attempting resize %ix%i\n", var.xres, var.yres);
  		mode = fb_find_best_mode(&var, &info->modelist);
  		if (mode == NULL)
  			return -EINVAL;
@@ -2023,7 +2015,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
  		if (virt_w > var.xres/virt_fw || virt_h > var.yres/virt_fh)
  			return -EINVAL;
 
-		DPRINTK("resize now %ix%i\n", var.xres, var.yres);
+		pr_debug("resize now %ix%i\n", var.xres, var.yres);
  		if (con_is_visible(vc)) {
  			var.activate = FB_ACTIVATE_NOW |
  				FB_ACTIVATE_FORCE;
@@ -3299,8 +3291,7 @@ static void fbcon_exit(void)
 
  		if (info->queue.func)
  			pending = cancel_work_sync(&info->queue);
-		DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
-			"no"));
+		pr_debug("fbcon: %s pending work\n", (pending ? "canceled" : "no"));
 
  		for (j = first_fb_vc; j <= last_fb_vc; j++) {
  			if (con2fb_map[j] == i) {
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

Quoted 8 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 2 lines

Replacing DPRINTK() statements with pr_debug fixes set but not used warnings.  And moves to a more standard logging setup at the same time.

I guess this was added for quick debugging during development. Anyway, I never liked these kinds of hacks.

But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being printed when FBCONDEBUG is defined. Is such change what the author of this module expects?

#8 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

Hi Tetsuo,

Quoted 5 lines · Tetsuo Handa
Quoted 4 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 2 lines

Replacing DPRINTK() statements with pr_debug fixes set but not used warnings.  And moves to a more standard logging setup at the same time.

Quoted 7 lines
Quoted 4 lines

I guess this was added for quick debugging during development. Anyway, I never liked these kinds of hacks.

But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being printed when FBCONDEBUG is defined. Is such change what the author of this module expects?

When someone goes and enable DEBUG for fbcon they are also able to recognize the logging, so the printing of the function name is redundant in this case.

There is likely limited to no use for these few logging entries, but if they should be dropped then I expect Peilin Ye to do so as he is the only one doing active maintenance of fbcon lately.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

Hi Sam,

Quoted 11 lines · Sam Ravnborg
Quoted 2 lines · Tetsuo Handa

But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being printed when FBCONDEBUG is defined. Is such change what the author of this module expects?

When someone goes and enable DEBUG for fbcon they are also able to recognize the logging, so the printing of the function name is redundant in this case.

There is likely limited to no use for these few logging entries, but if they should be dropped then I expect Peilin Ye to do so as he is the only one doing active maintenance of fbcon lately.

Sure, I will take another look at them. Also sorry for the delay in that printk() -> dev_*() patch you suggested, overwhelmed by some other things this week. Sometimes fbcon.c accesses dev structs in a pretty weird way (e.g. registered_fb[con2fb_map[vc->vc_num]]->dev), I will get back to it when I understand this better.

Thanks,
Peilin Ye

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

Hi Peilin,

Quoted 15 lines · Peilin Ye

Hi Sam,

Quoted 11 lines · Sam Ravnborg
Quoted 2 lines · Tetsuo Handa

But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being printed when FBCONDEBUG is defined. Is such change what the author of this module expects?

When someone goes and enable DEBUG for fbcon they are also able to recognize the logging, so the printing of the function name is redundant in this case.

There is likely limited to no use for these few logging entries, but if they should be dropped then I expect Peilin Ye to do so as he is the only one doing active maintenance of fbcon lately.

Quoted 5 lines

Sure, I will take another look at them. Also sorry for the delay in that printk() -> dev_*() patch you suggested, overwhelmed by some other things this week. Sometimes fbcon.c accesses dev structs in a pretty weird way (e.g. registered_fb[con2fb_map[vc->vc_num]]->dev), I will get back to it when I understand this better.

Please just keep up the good work cleaning up fbcon and related stuff. This is an area that needs some love and care and there is work for many long nights yet to do.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

Quoted 3 lines · Sam Ravnborg

Please just keep up the good work cleaning up fbcon and related stuff. This is an area that needs some love and care and there is work for many long nights yet to do.

Thanks! I will see what I can do,

Peilin Ye

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author Applied
#12 lore raw

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

In reply to Thomas Zimmermann
Quoted 38 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 27 lines

Replacing DPRINTK() statements with pr_debug fixes set but not used warnings. And moves to a more standard logging setup at the same time.

v2:
- Fix indent (Joe)

Cc Joe Perches <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Peilin Ye <[email protected]>
Cc Tetsuo Handa <[email protected]>
Cc George Kennedy <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Peter Rosin <[email protected]>
---
  drivers/video/fbdev/core/fbcon.c | 25 ++++++++-----------------
  1 file changed, 8 insertions(+), 17 deletions(-)
drivers/video/fbdev/core/fbcon.c +0 -0
index bf61598bf1c3..44a5cd2f54cc 100644

drivers/video/fbdev/core/fbcon.c line 59

Quoted 4 lines
drivers/video/fbdev/core/fbcon.c +0 -2
@@ -56,8 +56,6 @@
   *  more details.
   */
-#undef FBCONDEBUG
-

I guess this was added for quick debugging during development. Anyway, I never liked these kinds of hacks.

Quoted 1 line

Thanks, applied to drm-misc-next.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw

PATCH v2 3/28 video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify

In reply to Sam Ravnborg

Fix kernel-doc warnings reported when using W=1

v2:
- Improve subject (Lee)

Cc Lee Jones <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc "Alexander A. Klimov" <[email protected]>
---
 drivers/video/fbdev/core/fb_notify.c | 3 ++-
 drivers/video/fbdev/core/fbmon.c     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fb_notify.c +2 -1
index 74c2da528884..d85717b6e14a 100644
@@ -38,7 +38,8 @@ EXPORT_SYMBOL(fb_unregister_client);
 
 /**
  * fb_notifier_call_chain - notify clients of fb_events
- *
+ * @val: value passed to callback
+ * @v: pointer passed to callback
  */
 int fb_notifier_call_chain(unsigned long val, void *v)
 {
drivers/video/fbdev/core/fbmon.c +1 -1
index 1bf82dbc9e3c..b0e690f41025 100644
@@ -605,6 +605,7 @@ static void get_detailed_timing(unsigned char *block,
  * fb_create_modedb - create video mode database
  * @edid: EDID data
  * @dbsize: database size
+ * @specs: monitor specifications, may be NULL
  *
  * RETURNS: struct fb_videomode, @dbsize contains length of database
  *
@@ -1100,7 +1101,6 @@ static u32 fb_get_hblank_by_hfreq(u32 hfreq, u32 xres)
  *                                    2 * M
  *        M = 300;
  *        C = 30;
-
  */
 static u32 fb_get_hblank_by_dclk(u32 dclk, u32 xres)
 {
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#14 lore raw

Re: [PATCH v2 03/28] video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 22 lines

Fix kernel-doc warnings reported when using W=1

v2:
- Improve subject (Lee)

Cc Lee Jones <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc "Alexander A. Klimov" <[email protected]>
---
  drivers/video/fbdev/core/fb_notify.c | 3 ++-
  drivers/video/fbdev/core/fbmon.c     | 2 +-
  2 files changed, 3 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fb_notify.c +0 -0
index 74c2da528884..d85717b6e14a 100644

drivers/video/fbdev/core/fb_notify.c EXPORT_SYMBOL(fb_unregister_client); · line 42

Quoted 6 lines
drivers/video/fbdev/core/fb_notify.c +2 -1
@@ -38,7 +38,8 @@ EXPORT_SYMBOL(fb_unregister_client);
 
  /**
   * fb_notifier_call_chain - notify clients of fb_events
- *
+ * @val: value passed to callback
+ * @v: pointer passed to callback

Since you're at it, maybe add Returns.

Quoted 24 lines
drivers/video/fbdev/core/fb_notify.c +0 -0
   */
  int fb_notifier_call_chain(unsigned long val, void *v)
  {
drivers/video/fbdev/core/fbmon.c +1 -1
index 1bf82dbc9e3c..b0e690f41025 100644
@@ -605,6 +605,7 @@ static void get_detailed_timing(unsigned char *block,
   * fb_create_modedb - create video mode database
   * @edid: EDID data
   * @dbsize: database size
+ * @specs: monitor specifications, may be NULL
   *
   * RETURNS: struct fb_videomode, @dbsize contains length of database
   *
@@ -1100,7 +1101,6 @@ static u32 fb_get_hblank_by_hfreq(u32 hfreq, u32 xres)
   *                                    2 * M
   *        M = 300;
   *        C = 30;
-
   */
  static u32 fb_get_hblank_by_dclk(u32 dclk, u32 xres)
  {
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw

PATCH v2 4/28 video: fbdev: aty: Delete unused variable in radeon_monitor

In reply to Sam Ravnborg

Fix warning about variable that is asssigned a value but never used. The variable was indeed never used so delete it.

Keep the call to radeon_probe_i2c_connector() as it may have side-effects. It is unlikely but I could not verify that is was safe to drop the call.

---
 drivers/video/fbdev/aty/radeon_monitor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/aty/radeon_monitor.c +1 -3
index 9966c58aa26c..df55e23b7a5a 100644
@@ -488,12 +488,10 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
 #if defined(DEBUG) && defined(CONFIG_FB_RADEON_I2C)
 		{
 			u8 *EDIDs[4] = { NULL, NULL, NULL, NULL };
-			int mon_types[4] = {MT_NONE, MT_NONE, MT_NONE, MT_NONE};
 			int i;
 
 			for (i = 0; i < 4; i++)
-				mon_types[i] = radeon_probe_i2c_connector(rinfo,
-									  i+1, &EDIDs[i]);
+				radeon_probe_i2c_connector(rinfo, i + 1, &EDIDs[i]);
 		}
 #endif /* DEBUG */
 		/*
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 4/28
#16 lore raw

Re: [PATCH v2 04/28] video: fbdev: aty: Delete unused variable in radeon_monitor

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 10 lines

Fix warning about variable that is asssigned a value but never used. The variable was indeed never used so delete it.

Keep the call to radeon_probe_i2c_connector() as it may have side-effects. It is unlikely but I could not verify that is was safe to drop the call.

Quoted 23 lines
---
  drivers/video/fbdev/aty/radeon_monitor.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/aty/radeon_monitor.c +1 -3
index 9966c58aa26c..df55e23b7a5a 100644
@@ -488,12 +488,10 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
  #if defined(DEBUG) && defined(CONFIG_FB_RADEON_I2C)
  		{
  			u8 *EDIDs[4] = { NULL, NULL, NULL, NULL };
-			int mon_types[4] = {MT_NONE, MT_NONE, MT_NONE, MT_NONE};
  			int i;
 
  			for (i = 0; i < 4; i++)
-				mon_types[i] = radeon_probe_i2c_connector(rinfo,
-									  i+1, &EDIDs[i]);
+				radeon_probe_i2c_connector(rinfo, i + 1, &EDIDs[i]);
  		}
  #endif /* DEBUG */
  		/*
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#17 lore raw

PATCH v2 5/28 video: fbdev: aty: Fix set but not used warnings

In reply to Sam Ravnborg

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)

Cc Lee Jones <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Joe Perches <[email protected]>
Cc Vaibhav Gupta <[email protected]>
Cc Jason Yan <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/video/fbdev/aty/atyfb_base.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/video/fbdev/aty/atyfb_base.c +4 -7
index c8feff0ee8da..83c8e809955a 100644
@@ -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.
 		 */
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 5/28
#18 lore raw

Re: [PATCH v2 05/28] video: fbdev: aty: Fix set but not used warnings

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 3 lines

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

- Drop variables that was set but never used

s/that was/that were

Quoted 1 line

- Make variable definition conditional om ATARI

s/om/on

Quoted 5 lines

v2:
- Fix m68k build error (kernel test robot)
- Improve subject (Lee Jones)

Quoted 11 lines
Cc Lee Jones <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Joe Perches <[email protected]>
Cc Vaibhav Gupta <[email protected]>
Cc Jason Yan <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Jani Nikula <[email protected]>
Quoted 60 lines
---
  drivers/video/fbdev/aty/atyfb_base.c | 11 ++++-------
  1 file changed, 4 insertions(+), 7 deletions(-)
drivers/video/fbdev/aty/atyfb_base.c +4 -7
index c8feff0ee8da..83c8e809955a 100644
@@ -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.
  		 */
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#19 lore raw

PATCH v2 6/28 video: fbdev: aty: Fix set but not used warnings in mach64_ct

In reply to Sam Ravnborg

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)

---
 drivers/video/fbdev/aty/mach64_ct.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/video/fbdev/aty/mach64_ct.c +9 -6
index f87cc81f4fa2..011b07e44e0d 100644
@@ -281,10 +281,13 @@ static u32 aty_pll_to_var_ct(const struct fb_info *info, const union aty_pll *pl
 void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
-	u32 crtc_gen_cntl, lcd_gen_cntrl;
+	u32 crtc_gen_cntl;
 	u8 tmp, tmp2;
 
-	lcd_gen_cntrl = 0;
+#ifdef CONFIG_FB_ATY_GENERIC_LCD
+	u32 lcd_gen_cntrl = 0;
+#endif
+
 #ifdef DEBUG
 	printk("atyfb(%s): about to program:\n"
 		"pll_ext_cntl=0x%02x pll_gen_cntl=0x%02x pll_vclk_cntl=0x%02x\n",
@@ -402,7 +405,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
 	u8 mpost_div, xpost_div, sclk_post_div_real;
 	u32 q, memcntl, trp;
-	u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off;
+	u32 dsp_config;
 #ifdef DEBUG
 	int pllmclk, pllsclk;
 #endif
@@ -488,9 +491,9 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
 
 	/* Allow BIOS to override */
 	dsp_config = aty_ld_le32(DSP_CONFIG, par);
-	dsp_on_off = aty_ld_le32(DSP_ON_OFF, par);
-	vga_dsp_config = aty_ld_le32(VGA_DSP_CONFIG, par);
-	vga_dsp_on_off = aty_ld_le32(VGA_DSP_ON_OFF, par);
+	aty_ld_le32(DSP_ON_OFF, par);
+	aty_ld_le32(VGA_DSP_CONFIG, par);
+	aty_ld_le32(VGA_DSP_ON_OFF, par);
 
 	if (dsp_config)
 		pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 16;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 6/28
#20 lore raw

Re: [PATCH v2 06/28] video: fbdev: aty: Fix set but not used warnings in mach64_ct

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 7 lines

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.

Quoted 5 lines

v2:
- Updated subject (Lee)

Quoted 47 lines
---
  drivers/video/fbdev/aty/mach64_ct.c | 15 +++++++++------
  1 file changed, 9 insertions(+), 6 deletions(-)
drivers/video/fbdev/aty/mach64_ct.c +9 -6
index f87cc81f4fa2..011b07e44e0d 100644
@@ -281,10 +281,13 @@ static u32 aty_pll_to_var_ct(const struct fb_info *info, const union aty_pll *pl
  void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
  {
  	struct atyfb_par *par = (struct atyfb_par *) info->par;
-	u32 crtc_gen_cntl, lcd_gen_cntrl;
+	u32 crtc_gen_cntl;
  	u8 tmp, tmp2;
 
-	lcd_gen_cntrl = 0;
+#ifdef CONFIG_FB_ATY_GENERIC_LCD
+	u32 lcd_gen_cntrl = 0;
+#endif
+
  #ifdef DEBUG
  	printk("atyfb(%s): about to program:\n"
  		"pll_ext_cntl=0x%02x pll_gen_cntl=0x%02x pll_vclk_cntl=0x%02x\n",
@@ -402,7 +405,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
  	struct atyfb_par *par = (struct atyfb_par *) info->par;
  	u8 mpost_div, xpost_div, sclk_post_div_real;
  	u32 q, memcntl, trp;
-	u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off;
+	u32 dsp_config;
  #ifdef DEBUG
  	int pllmclk, pllsclk;
  #endif
@@ -488,9 +491,9 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
 
  	/* Allow BIOS to override */
  	dsp_config = aty_ld_le32(DSP_CONFIG, par);
-	dsp_on_off = aty_ld_le32(DSP_ON_OFF, par);
-	vga_dsp_config = aty_ld_le32(VGA_DSP_CONFIG, par);
-	vga_dsp_on_off = aty_ld_le32(VGA_DSP_ON_OFF, par);
+	aty_ld_le32(DSP_ON_OFF, par);
+	aty_ld_le32(VGA_DSP_CONFIG, par);
+	aty_ld_le32(VGA_DSP_ON_OFF, par);
 
  	if (dsp_config)
  		pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 16;
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#21 lore raw

PATCH v2 7/28 video: fbdev: sis: Fix defined but not used warnings

In reply to Sam Ravnborg

init.h define static symbols, so should only be included once. Drop the include from sis.h as it is not needed. This fixes a lot of warnings seen with a W=1 build.

v2:
- Update subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/sis/sis.h | 1 -
 1 file changed, 1 deletion(-)
drivers/video/fbdev/sis/sis.h +0 -1
index 9f4c3093ccb3..d632f096083b 100644
@@ -15,7 +15,6 @@
 
 #include "vgatypes.h"
 #include "vstruct.h"
-#include "init.h"
 
 #define VER_MAJOR		1
 #define VER_MINOR		8
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 7/28
#22 lore raw

Re: [PATCH v2 07/28] video: fbdev: sis: Fix defined but not used warnings

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 1 line

init.h define static symbols, so should only be included

s/define/defines
s/so should/so it should

Quoted 9 lines

once. Drop the include from sis.h as it is not needed. This fixes a lot of warnings seen with a W=1 build.

v2:
- Update subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 17 lines
---
  drivers/video/fbdev/sis/sis.h | 1 -
  1 file changed, 1 deletion(-)
drivers/video/fbdev/sis/sis.h +0 -1
index 9f4c3093ccb3..d632f096083b 100644
@@ -15,7 +15,6 @@
 
  #include "vgatypes.h"
  #include "vstruct.h"
-#include "init.h"
 
  #define VER_MAJOR		1
  #define VER_MINOR		8
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#23 lore raw

PATCH v2 8/28 video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay

In reply to Sam Ravnborg

Fix W=1 warning by commenting unused SiS_TVDelay* variables.

The SiS_TVDelay* variables seem to contain some magic numbers so looks like data worth keeping around but not as code we build.

v2:
- Update subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/sis/oem310.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/video/fbdev/sis/oem310.h +2 -0
index 8fce56e4482c..ed28755715ce 100644
@@ -200,6 +200,7 @@ static const unsigned char SiS310_TVDelayCompensation_651302LV[] =	/* M650, 651,
 	0x33,0x33
 };
 
+#if 0 /* Not used */
 static const unsigned char SiS_TVDelay661_301[] =			/* 661, 301 */
 {
 	0x44,0x44,
@@ -219,6 +220,7 @@ static const unsigned char SiS_TVDelay661_301B[] =			/* 661, 301B et al */
 	0x44,0x44,
 	0x44,0x44
 };
+#endif
 
 static const unsigned char SiS310_TVDelayCompensation_LVDS[] =		/* LVDS */
 {
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 8/28
#24 lore raw

Re: [PATCH v2 08/28] video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 4 lines

Fix W=1 warning by commenting unused SiS_TVDelay* variables.

The SiS_TVDelay* variables seem to contain some magic numbers so looks like data worth keeping around but not as code we build.

I would remove it. sisfb is broken beyond repair and no one's going to try to use it anyway. In any case

Quoted 32 lines

v2:
- Update subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/sis/oem310.h | 2 ++
  1 file changed, 2 insertions(+)
drivers/video/fbdev/sis/oem310.h +2 -0
index 8fce56e4482c..ed28755715ce 100644
@@ -200,6 +200,7 @@ static const unsigned char SiS310_TVDelayCompensation_651302LV[] =	/* M650, 651,
  	0x33,0x33
  };
 
+#if 0 /* Not used */
  static const unsigned char SiS_TVDelay661_301[] =			/* 661, 301 */
  {
  	0x44,0x44,
@@ -219,6 +220,7 @@ static const unsigned char SiS_TVDelay661_301B[] =			/* 661, 301B et al */
  	0x44,0x44,
  	0x44,0x44
  };
+#endif
 
  static const unsigned char SiS310_TVDelayCompensation_LVDS[] =		/* LVDS */
  {
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#25 lore raw

Re: [PATCH v2 08/28] video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay

Hi Thomas.

Quoted 5 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 2 lines

Fix W=1 warning by commenting unused SiS_TVDelay* variables.

Quoted 7 lines
Quoted 2 lines

The SiS_TVDelay* variables seem to contain some magic numbers so looks like data worth keeping around but not as code we build.

I would remove it. sisfb is broken beyond repair and no one's going to try to use it anyway. In any case

Thanks for your patience pointing out all my spelling and grammar errors. I once had codespell set up to catch some of this, will need to do so again.

Ironically I copied the above "Acked-by:" line to most of the commits and just noticed it had a spelling error :-)

I have applied everything that you acked and will push when I have fixed the above and verified I did not break anything. Will post a v3 with the remaining patches later.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#26 lore raw

Re: [PATCH v2 08/28] video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay

Hi

Am 30.11.20 um 20:01 schrieb Sam Ravnborg:

Quoted 14 lines

Hi Thomas.

Quoted 11 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 4 lines

Fix W=1 warning by commenting unused SiS_TVDelay* variables.

The SiS_TVDelay* variables seem to contain some magic numbers so looks like data worth keeping around but not as code we build.

I would remove it. sisfb is broken beyond repair and no one's going to try to use it anyway. In any case

Quoted 8 lines
Quoted 1 line

Thanks for your patience pointing out all my spelling and grammar errors. I once had codespell set up to catch some of this, will need to do so again.

Ironically I copied the above "Acked-by:" line to most of the commits and just noticed it had a spelling error :-)

Perfect! :D

Quoted 7 lines

I have applied everything that you acked and will push when I have fixed the above and verified I did not break anything. Will post a v3 with the remaining patches later.

Sam

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#27 lore raw

PATCH v2 9/28 video: fbdev: sis: Fix set but not used warnings in init.c

In reply to Sam Ravnborg

Fix set bit not used warnings by removing the code the assign the variables and the definition of the variables.
A register read is kept as it may have unknown side-effects.

This removes a lot of unused code - which is always a good thing to do.

v2:
- Updated subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/sis/init.c | 34 ++++++----------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)
drivers/video/fbdev/sis/init.c +6 -28
index fde27feae5d0..b77ea1a8825a 100644
@@ -2648,7 +2648,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;
@@ -2659,7 +2659,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);
       if(ModeNo > 0x13) {
 	 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
       }
@@ -3538,17 +3538,13 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
 			struct fb_var_screeninfo *var, bool writeres
 )
 {
-   unsigned short HRE, HBE, HRS, HBS, HDE, HT;
-   unsigned short VRE, VBE, VRS, VBS, VDE, VT;
-   unsigned char  sr_data, cr_data, cr_data2;
-   int            A, B, C, D, E, F, temp;
+   unsigned short HRE, HBE, HRS, HDE;
+   unsigned short VRE, VBE, VRS, VDE;
+   unsigned char  sr_data, cr_data;
+   int            B, C, D, E, F, temp;
 
    sr_data = crdata[14];
 
-   /* Horizontal total */
-   HT =  crdata[0] | ((unsigned short)(sr_data & 0x03) << 8);
-   A = HT + 5;
-
    /* Horizontal display enable end */
    HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6);
    E = HDE + 1;
@@ -3557,9 +3553,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
    HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2);
    F = HRS - E - 3;
 
-   /* Horizontal blank start */
-   HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4);
-
    sr_data = crdata[15];
    cr_data = crdata[5];
 
@@ -3588,13 +3581,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
    sr_data = crdata[13];
    cr_data = crdata[7];
 
-   /* Vertical total */
-   VT  = crdata[6] |
-	 ((unsigned short)(cr_data & 0x01) << 8) |
-	 ((unsigned short)(cr_data & 0x20) << 4) |
-	 ((unsigned short)(sr_data & 0x01) << 10);
-   A = VT + 2;
-
    /* Vertical display enable end */
    VDE = crdata[10] |
 	 ((unsigned short)(cr_data & 0x02) << 7) |
@@ -3609,14 +3595,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
 	 ((unsigned short)(sr_data & 0x08) << 7);
    F = VRS + 1 - E;
 
-   cr_data2 = (crdata[16] & 0x01) << 5;
-
-   /* Vertical blank start */
-   VBS = crdata[11] |
-	 ((unsigned short)(cr_data  & 0x08) << 5) |
-	 ((unsigned short)(cr_data2 & 0x20) << 4) |
-	 ((unsigned short)(sr_data  & 0x04) << 8);
-
    /* Vertical blank end */
    VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4);
    temp = VBE - ((E - 1) & 511);
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 9/28
#28 lore raw

Re: [PATCH v2 09/28] video: fbdev: sis: Fix set but not used warnings in init.c

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 1 line

Fix set bit not used warnings by removing the code the assign the

s/bit/but

Actually, I think the correct way of writing this would be with dashes:

Fix set-but-not-used warnings

In the current sentence, you're setting a 'but not used variable.'

Quoted 11 lines

variables and the definition of the variables.
A register read is kept as it may have unknown side-effects.

This removes a lot of unused code - which is always a good thing to do.

v2:
- Updated subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 88 lines
---
  drivers/video/fbdev/sis/init.c | 34 ++++++----------------------------
  1 file changed, 6 insertions(+), 28 deletions(-)
drivers/video/fbdev/sis/init.c +6 -28
index fde27feae5d0..b77ea1a8825a 100644
@@ -2648,7 +2648,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;
@@ -2659,7 +2659,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);
        if(ModeNo > 0x13) {
  	 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
        }
@@ -3538,17 +3538,13 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
  			struct fb_var_screeninfo *var, bool writeres
  )
  {
-   unsigned short HRE, HBE, HRS, HBS, HDE, HT;
-   unsigned short VRE, VBE, VRS, VBS, VDE, VT;
-   unsigned char  sr_data, cr_data, cr_data2;
-   int            A, B, C, D, E, F, temp;
+   unsigned short HRE, HBE, HRS, HDE;
+   unsigned short VRE, VBE, VRS, VDE;
+   unsigned char  sr_data, cr_data;
+   int            B, C, D, E, F, temp;
 
     sr_data = crdata[14];
 
-   /* Horizontal total */
-   HT =  crdata[0] | ((unsigned short)(sr_data & 0x03) << 8);
-   A = HT + 5;
-
     /* Horizontal display enable end */
     HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6);
     E = HDE + 1;
@@ -3557,9 +3553,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
     HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2);
     F = HRS - E - 3;
 
-   /* Horizontal blank start */
-   HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4);
-
     sr_data = crdata[15];
     cr_data = crdata[5];
 
@@ -3588,13 +3581,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
     sr_data = crdata[13];
     cr_data = crdata[7];
 
-   /* Vertical total */
-   VT  = crdata[6] |
-	 ((unsigned short)(cr_data & 0x01) << 8) |
-	 ((unsigned short)(cr_data & 0x20) << 4) |
-	 ((unsigned short)(sr_data & 0x01) << 10);
-   A = VT + 2;
-
     /* Vertical display enable end */
     VDE = crdata[10] |
  	 ((unsigned short)(cr_data & 0x02) << 7) |
@@ -3609,14 +3595,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
  	 ((unsigned short)(sr_data & 0x08) << 7);
     F = VRS + 1 - E;
 
-   cr_data2 = (crdata[16] & 0x01) << 5;
-
-   /* Vertical blank start */
-   VBS = crdata[11] |
-	 ((unsigned short)(cr_data  & 0x08) << 5) |
-	 ((unsigned short)(cr_data2 & 0x20) << 4) |
-	 ((unsigned short)(sr_data  & 0x04) << 8);
-
     /* Vertical blank end */
     VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4);
     temp = VBE - ((E - 1) & 511);
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#29 lore raw

PATCH v2 10/28 video: fbdev: sis: Fix set but not used warnings in sis_main

In reply to Sam Ravnborg

Fix warnings by dropping unused variable and the
unused assignments.

v2:
- Update subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/sis/sis_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/video/fbdev/sis/sis_main.c +4 -5
index 03c736f6f3d0..266a5582f94d 100644
@@ -5029,7 +5029,6 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 	static const u8 cs168[8] = {
 		0x48, 0x78, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00
 	};
-	u8 reg;
 	u8 v1;
 	u8 v2;
 	u8 v3;
@@ -5037,9 +5036,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 	SiS_SetReg(SISCR, 0xb0, 0x80); /* DDR2 dual frequency mode */
 	SiS_SetReg(SISCR, 0x82, 0x77);
 	SiS_SetReg(SISCR, 0x86, 0x00);
-	reg = SiS_GetReg(SISCR, 0x86);
+	SiS_GetReg(SISCR, 0x86);
 	SiS_SetReg(SISCR, 0x86, 0x88);
-	reg = SiS_GetReg(SISCR, 0x86);
+	SiS_GetReg(SISCR, 0x86);
 	v1 = cs168[regb]; v2 = cs160[regb]; v3 = cs158[regb];
 	if (ivideo->haveXGIROM) {
 		v1 = bios[regb + 0x168];
@@ -5049,9 +5048,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 	SiS_SetReg(SISCR, 0x86, v1);
 	SiS_SetReg(SISCR, 0x82, 0x77);
 	SiS_SetReg(SISCR, 0x85, 0x00);
-	reg = SiS_GetReg(SISCR, 0x85);
+	SiS_GetReg(SISCR, 0x85);
 	SiS_SetReg(SISCR, 0x85, 0x88);
-	reg = SiS_GetReg(SISCR, 0x85);
+	SiS_GetReg(SISCR, 0x85);
 	SiS_SetReg(SISCR, 0x85, v2);
 	SiS_SetReg(SISCR, 0x82, v3);
 	SiS_SetReg(SISCR, 0x98, 0x01);
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 10/28
#30 lore raw

Re: [PATCH v2 10/28] video: fbdev: sis: Fix set but not used warnings in sis_main

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 9 lines

Fix warnings by dropping unused variable and the
unused assignments.

v2:
- Update subject (Lee)

Cc Thomas Winischhofer <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 41 lines
---
  drivers/video/fbdev/sis/sis_main.c | 9 ++++-----
  1 file changed, 4 insertions(+), 5 deletions(-)
drivers/video/fbdev/sis/sis_main.c +4 -5
index 03c736f6f3d0..266a5582f94d 100644
@@ -5029,7 +5029,6 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
  	static const u8 cs168[8] = {
  		0x48, 0x78, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00
  	};
-	u8 reg;
  	u8 v1;
  	u8 v2;
  	u8 v3;
@@ -5037,9 +5036,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
  	SiS_SetReg(SISCR, 0xb0, 0x80); /* DDR2 dual frequency mode */
  	SiS_SetReg(SISCR, 0x82, 0x77);
  	SiS_SetReg(SISCR, 0x86, 0x00);
-	reg = SiS_GetReg(SISCR, 0x86);
+	SiS_GetReg(SISCR, 0x86);
  	SiS_SetReg(SISCR, 0x86, 0x88);
-	reg = SiS_GetReg(SISCR, 0x86);
+	SiS_GetReg(SISCR, 0x86);
  	v1 = cs168[regb]; v2 = cs160[regb]; v3 = cs158[regb];
  	if (ivideo->haveXGIROM) {
  		v1 = bios[regb + 0x168];
@@ -5049,9 +5048,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
  	SiS_SetReg(SISCR, 0x86, v1);
  	SiS_SetReg(SISCR, 0x82, 0x77);
  	SiS_SetReg(SISCR, 0x85, 0x00);
-	reg = SiS_GetReg(SISCR, 0x85);
+	SiS_GetReg(SISCR, 0x85);
  	SiS_SetReg(SISCR, 0x85, 0x88);
-	reg = SiS_GetReg(SISCR, 0x85);
+	SiS_GetReg(SISCR, 0x85);
  	SiS_SetReg(SISCR, 0x85, v2);
  	SiS_SetReg(SISCR, 0x82, v3);
  	SiS_SetReg(SISCR, 0x98, 0x01);
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#31 lore raw

PATCH v2 11/28 video: fbdev: via: Fix set but not used warning for mode_crt_table

In reply to Sam Ravnborg

Fix warning by deleting the variable. The function call viafb_get_best_mode() were verified to have no side-effects, and thus could be dropped too.

v2:
- Update subject (Lee)

Cc Florian Tobias Schandinat <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/via/lcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/via/lcd.c +1 -3
index 4a869402d120..088b962076b5 100644
@@ -537,11 +537,9 @@ 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);
 	/* 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);
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 11/28
#32 lore raw

Re: [PATCH v2 11/28] video: fbdev: via: Fix set but not used warning for mode_crt_table

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 2 lines

Fix warning by deleting the variable. The function call viafb_get_best_mode() were verified to have no side-effects,

s/were/was

Quoted 9 lines

and thus could be dropped too.

v2:
- Update subject (Lee)

Cc Florian Tobias Schandinat <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 22 lines
---
  drivers/video/fbdev/via/lcd.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/via/lcd.c +1 -3
index 4a869402d120..088b962076b5 100644
@@ -537,11 +537,9 @@ 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);
  	/* 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);
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#33 lore raw

PATCH v2 12/28 video: fbdev: tdfx: Fix set but not used warning in att_outb()

In reply to Sam Ravnborg

The tmp variable were assigned but the result was never used, so delete the tmp variable.

v2:
- Update subject (Lee)

Cc "Gustavo A. R. Silva" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/tdfxfb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/tdfxfb.c +1 -3
index f056d80f6359..67e37a62b07c 100644
@@ -206,9 +206,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);
 }
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 12/28
#34 lore raw

Re: [PATCH v2 12/28] video: fbdev: tdfx: Fix set but not used warning in att_outb()

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 1 line

The tmp variable were assigned but the result was never used,

s/were/was

Quoted 5 lines

so delete the tmp variable.

v2:
- Update subject (Lee)

Quoted 7 lines
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 9 lines
---
  drivers/video/fbdev/tdfxfb.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/tdfxfb.c +0 -0
index f056d80f6359..67e37a62b07c 100644

drivers/video/fbdev/tdfxfb.c static inline u8 crt_inb(struct tdfx_par *par, u32 idx) · line 209

Quoted 7 lines
drivers/video/fbdev/tdfxfb.c +1 -3
@@ -206,9 +206,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);

It resets the attribute register's state. Hopefully, this doesn't get optimized away.

Quoted 4 lines
drivers/video/fbdev/tdfxfb.c +0 -0
  	vga_outb(par, ATT_IW, idx);
  	vga_outb(par, ATT_IW, val);
  }
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#35 lore raw

PATCH v2 13/28 video: fbdev: riva: Fix kernel-doc and set but not used warnings

In reply to Sam Ravnborg

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

v2:
- Updated subject (Lee)

---
 drivers/video/fbdev/riva/fbdev.c   |  9 ++++-----
 drivers/video/fbdev/riva/riva_hw.c | 28 ++++++++--------------------
 2 files changed, 12 insertions(+), 25 deletions(-)
drivers/video/fbdev/riva/fbdev.c +4 -5
index ce55b9d2e862..55554b0433cb 100644
@@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
 
 /**
  * rivafb_load_cursor_image - load cursor image to hardware
- * @data: address to monochrome bitmap (1 = foreground color, 0 = background)
+ * @data8: address to monochrome bitmap (1 = foreground color, 0 = background)
  * @par:  pointer to private data
  * @w:    width of cursor image in pixels
  * @h:    height of cursor image in scanlines
@@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo *var,
 /**
  * rivafb_do_maximize - 
  * @info: pointer to fb_info object containing info for current riva board
- * @var:
- * @nom:
- * @den:
+ * @var: standard kernel fb changeable data
+ * @nom: nom
+ * @den: den
  *
  * DESCRIPTION:
  * .
@@ -1214,7 +1214,6 @@ static int rivafb_set_par(struct fb_info *info)
 /**
  * rivafb_pan_display
  * @var: standard kernel fb changeable data
- * @con: TODO
  * @info: pointer to fb_info object containing info for current riva board
  *
  * DESCRIPTION:
drivers/video/fbdev/riva/riva_hw.c +8 -20
index bcf9c4b4de31..8b829b720064 100644
@@ -836,17 +836,17 @@ static void nv10CalcArbitration
     nv10_sim_state *arb
 )
 {
-    int data, pagemiss, cas,width, video_enable, bpp;
-    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;
@@ -854,16 +854,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;
     bpp = arb->pix_bpp;
     mp_enable = arb->enable_mp;
     clwm = 0;
-    vlwm = 1024;
 
     cbs = 512;
-    vbs = 512;
 
     pclks = 4; /* lwm detect. */
 
@@ -924,17 +921,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 */
@@ -993,7 +984,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 ;
               }
           }
       }
@@ -1010,7 +1000,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); 
@@ -1038,7 +1027,6 @@ static void nv10CalcArbitration
               min_mclk_extra--;
         }
       }
-      craw = clwm;
 
       if(clwm < (1024-cbs+8)) clwm = 1024-cbs+8;
       data = (int)(clwm);
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 13/28
#36 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 30 lines

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

v2:
- Updated subject (Lee)

---
  drivers/video/fbdev/riva/fbdev.c   |  9 ++++-----
  drivers/video/fbdev/riva/riva_hw.c | 28 ++++++++--------------------
  2 files changed, 12 insertions(+), 25 deletions(-)
drivers/video/fbdev/riva/fbdev.c +1 -1
index ce55b9d2e862..55554b0433cb 100644
@@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
 
  /**
   * rivafb_load_cursor_image - load cursor image to hardware
- * @data: address to monochrome bitmap (1 = foreground color, 0 = background)
+ * @data8: address to monochrome bitmap (1 = foreground color, 0 = background)
   * @par:  pointer to private data
   * @w:    width of cursor image in pixels
   * @h:    height of cursor image in scanlines

drivers/video/fbdev/riva/fbdev.c static void riva_update_var(struct fb_var_screeninfo *var, · line 848

Quoted 9 lines
drivers/video/fbdev/riva/fbdev.c +3 -3
@@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo *var,
  /**
   * rivafb_do_maximize -
   * @info: pointer to fb_info object containing info for current riva board
- * @var:
- * @nom:
- * @den:
+ * @var: standard kernel fb changeable data
+ * @nom: nom
+ * @den: den

Well, it fixes the warning ;)

Quoted 101 lines
drivers/video/fbdev/riva/fbdev.c +0 -1
   *
   * DESCRIPTION:
   * .
@@ -1214,7 +1214,6 @@ static int rivafb_set_par(struct fb_info *info)
  /**
   * rivafb_pan_display
   * @var: standard kernel fb changeable data
- * @con: TODO
   * @info: pointer to fb_info object containing info for current riva board
   *
   * DESCRIPTION:
drivers/video/fbdev/riva/riva_hw.c +8 -20
index bcf9c4b4de31..8b829b720064 100644
@@ -836,17 +836,17 @@ static void nv10CalcArbitration
      nv10_sim_state *arb
  )
  {
-    int data, pagemiss, cas,width, video_enable, bpp;
-    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;
@@ -854,16 +854,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;
      bpp = arb->pix_bpp;
      mp_enable = arb->enable_mp;
      clwm = 0;
-    vlwm = 1024;
 
      cbs = 512;
-    vbs = 512;
 
      pclks = 4; /* lwm detect. */
 
@@ -924,17 +921,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 */
@@ -993,7 +984,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 ;
                }
            }
        }
@@ -1010,7 +1000,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);
@@ -1038,7 +1027,6 @@ static void nv10CalcArbitration
                min_mclk_extra--;
          }
        }
-      craw = clwm;
 
        if(clwm < (1024-cbs+8)) clwm = 1024-cbs+8;
        data = (int)(clwm);
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#37 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Quoted 35 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 32 lines

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

v2:
- Updated subject (Lee)

---
  drivers/video/fbdev/riva/fbdev.c   |  9 ++++-----
  drivers/video/fbdev/riva/riva_hw.c | 28 ++++++++--------------------
  2 files changed, 12 insertions(+), 25 deletions(-)
drivers/video/fbdev/riva/fbdev.c +1 -1
index ce55b9d2e862..55554b0433cb 100644
@@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
  /**
   * rivafb_load_cursor_image - load cursor image to hardware
- * @data: address to monochrome bitmap (1 = foreground color, 0 = background)
+ * @data8: address to monochrome bitmap (1 = foreground color, 0 = background)
   * @par:  pointer to private data
   * @w:    width of cursor image in pixels
   * @h:    height of cursor image in scanlines
@@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo *var,
  /**
   * rivafb_do_maximize -
   * @info: pointer to fb_info object containing info for current riva board
Quoted 8 lines

drivers/video/fbdev/riva/fbdev.c static void riva_update_var(struct fb_var_screeninfo *var, · line 848

Quoted 6 lines
drivers/video/fbdev/riva/fbdev.c +3 -3
- * @var:
- * @nom:
- * @den:
+ * @var: standard kernel fb changeable data
+ * @nom: nom
+ * @den: den

Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here. Was tempted to just drop all the kernel-doc syntax but that was a larger change.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#38 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Quoted 34 lines · Sam Ravnborg
Quoted 33 lines · Thomas Zimmermann

Am 28.11.20 um 23:40 schrieb Sam Ravnborg:

Quoted 30 lines

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

v2:
- Updated subject (Lee)

---
  drivers/video/fbdev/riva/fbdev.c   |  9 ++++-----
  drivers/video/fbdev/riva/riva_hw.c | 28 ++++++++--------------------
  2 files changed, 12 insertions(+), 25 deletions(-)
drivers/video/fbdev/riva/fbdev.c +1 -1
index ce55b9d2e862..55554b0433cb 100644
@@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
  /**
   * rivafb_load_cursor_image - load cursor image to hardware
- * @data: address to monochrome bitmap (1 = foreground color, 0 = background)
+ * @data8: address to monochrome bitmap (1 = foreground color, 0 = background)
   * @par:  pointer to private data
   * @w:    width of cursor image in pixels
   * @h:    height of cursor image in scanlines
@@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo *var,
  /**
Quoted 8 lines
Quoted 8 lines

drivers/video/fbdev/riva/fbdev.c static void riva_update_var(struct fb_var_screeninfo *var, · line 848

Quoted 8 lines
drivers/video/fbdev/riva/fbdev.c +3 -3
   * rivafb_do_maximize -
   * @info: pointer to fb_info object containing info for current riva board
- * @var:
- * @nom:
- * @den:
+ * @var: standard kernel fb changeable data
+ * @nom: nom
+ * @den: den

Cop-out!

Do what I do and make something up (joke)! :'D

Quoted 5 lines
Quoted 1 line

Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here. Was tempted to just drop all the kernel-doc syntax but that was a larger change.

Did you trace it from it's origin down to it's final use?

Signature · 8 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#39 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Hi Lee,

Quoted 4 lines

Cop-out!

Do what I do and make something up (joke)! :'D

If I thought anyone would actually read the comments then maybe yes. But I assume that apart from this thread no-one will read it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here. Was tempted to just drop all the kernel-doc syntax but that was a larger change.

Did you trace it from it's origin down to it's final use?

Yeah, but not something that seemed useful.
I could have added "translating from pixels->bytes" as they are described somewhere else. But I could not convince myself this was right so I just silenced the warning.

The only reason I kept the kernel-doc in the first place is that I am told some editors use it.

The only effect the kernel-doc in fbdev has right now is burning effort that could have been spent (better?) somewhere else, and I would personally prefer to drop the kernel-doc annotations.

But I already discussed this in another thread (not fbdev related) and I was told it was useful for some, so it is kept.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#40 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Quoted 26 lines · Sam Ravnborg

Hi Lee,

Quoted 4 lines

Cop-out!

Do what I do and make something up (joke)! :'D

If I thought anyone would actually read the comments then maybe yes. But I assume that apart from this thread no-one will read it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here. Was tempted to just drop all the kernel-doc syntax but that was a larger change.

Did you trace it from it's origin down to it's final use?

Yeah, but not something that seemed useful.
I could have added "translating from pixels->bytes" as they are described somewhere else. But I could not convince myself this was right so I just silenced the warning.

The only reason I kept the kernel-doc in the first place is that I am told some editors use it.

Quoted 6 lines

The only effect the kernel-doc in fbdev has right now is burning effort that could have been spent (better?) somewhere else, and I would personally prefer to drop the kernel-doc annotations.

But I already discussed this in another thread (not fbdev related) and I was told it was useful for some, so it is kept.

I personally think they should be kept. Despite not being referenced by any kernel-doc:: key-words. As you say, it can be helpful as an in-code reference for driver writers, people debugging code, et al.

Not sure I would just repeat the variable name just to silence the warning though - that is definitely a hack. In the thousands (literally!) of these that I've fixed thus far, I haven't needed to do that.

Signature · 8 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#41 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Quoted 36 lines · Lee Jones
Quoted 26 lines · Sam Ravnborg

Hi Lee,

Quoted 4 lines

Cop-out!

Do what I do and make something up (joke)! :'D

If I thought anyone would actually read the comments then maybe yes. But I assume that apart from this thread no-one will read it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here. Was tempted to just drop all the kernel-doc syntax but that was a larger change.

Did you trace it from it's origin down to it's final use?

Yeah, but not something that seemed useful.
I could have added "translating from pixels->bytes" as they are described somewhere else. But I could not convince myself this was right so I just silenced the warning.

The only reason I kept the kernel-doc in the first place is that I am told some editors use it.

Quoted 6 lines

The only effect the kernel-doc in fbdev has right now is burning effort that could have been spent (better?) somewhere else, and I would personally prefer to drop the kernel-doc annotations.

But I already discussed this in another thread (not fbdev related) and I was told it was useful for some, so it is kept.

Quoted 8 lines

I personally think they should be kept. Despite not being referenced by any kernel-doc:: key-words. As you say, it can be helpful as an in-code reference for driver writers, people debugging code, et al.

Not sure I would just repeat the variable name just to silence the warning though - that is definitely a hack. In the thousands (literally!) of these that I've fixed thus far, I haven't needed to do that.

Personally what I've done is to just remove the kerneldoc marker (and anything else that's obviously wrong) and leave plain comments behind. At least for old outdated code that no one actively maintains anymore. Keeps the comment as maybe something useful, and avoids pointless busy work of inventing kerneldoc which might or might not actually be correctly describing what's going on.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#42 lore raw

Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

Quoted 46 lines · Daniel Vetter
Quoted 36 lines · Lee Jones
Quoted 26 lines · Sam Ravnborg

Hi Lee,

Quoted 4 lines

Cop-out!

Do what I do and make something up (joke)! :'D

If I thought anyone would actually read the comments then maybe yes. But I assume that apart from this thread no-one will read it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here. Was tempted to just drop all the kernel-doc syntax but that was a larger change.

Did you trace it from it's origin down to it's final use?

Yeah, but not something that seemed useful.
I could have added "translating from pixels->bytes" as they are described somewhere else. But I could not convince myself this was right so I just silenced the warning.

The only reason I kept the kernel-doc in the first place is that I am told some editors use it.

Quoted 6 lines

The only effect the kernel-doc in fbdev has right now is burning effort that could have been spent (better?) somewhere else, and I would personally prefer to drop the kernel-doc annotations.

But I already discussed this in another thread (not fbdev related) and I was told it was useful for some, so it is kept.

Quoted 8 lines

I personally think they should be kept. Despite not being referenced by any kernel-doc:: key-words. As you say, it can be helpful as an in-code reference for driver writers, people debugging code, et al.

Not sure I would just repeat the variable name just to silence the warning though - that is definitely a hack. In the thousands (literally!) of these that I've fixed thus far, I haven't needed to do that.

Quoted 6 lines

Personally what I've done is to just remove the kerneldoc marker (and anything else that's obviously wrong) and leave plain comments behind. At least for old outdated code that no one actively maintains anymore. Keeps the comment as maybe something useful, and avoids pointless busy work of inventing kerneldoc which might or might not actually be correctly describing what's going on.

Right. Demoting is also a good option if in doubt.

Signature · 8 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#43 lore raw

PATCH v2 14/28 video: fbdev: pm2fb: Fix kernel-doc warnings

In reply to Sam Ravnborg

Fixed a few kernel-doc issues to fix the warnings.

v2:
- Updated subject (Lee)

Cc Sam Ravnborg <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/pm2fb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/pm2fb.c +4 -4
index 27893fa139b0..c68725eebee3 100644
@@ -1508,8 +1508,8 @@ static const struct fb_ops pm2fb_ops = {
  *
  * Initialise and allocate resource for PCI device.
  *
- * @param	pdev	PCI device.
- * @param	id	PCI device ID.
+ * @pdev:	PCI device.
+ * @id:		PCI device ID.
  */
 static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -1715,7 +1715,7 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  *
  * Release all device resources.
  *
- * @param	pdev	PCI device to clean up.
+ * @pdev:	PCI device to clean up.
  */
 static void pm2fb_remove(struct pci_dev *pdev)
 {
@@ -1756,7 +1756,7 @@ MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
 
 
 #ifndef MODULE
-/**
+/*
  * Parse user specified options.
  *
  * This is, comma-separated options following `video=pm2fb:'.
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 14/28
#44 lore raw

Re: [PATCH v2 14/28] video: fbdev: pm2fb: Fix kernel-doc warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 5 lines

Fixed a few kernel-doc issues to fix the warnings.

v2:
- Updated subject (Lee)

Quoted 8 lines
Cc Sam Ravnborg <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 38 lines
---
  drivers/video/fbdev/pm2fb.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/pm2fb.c +4 -4
index 27893fa139b0..c68725eebee3 100644
@@ -1508,8 +1508,8 @@ static const struct fb_ops pm2fb_ops = {
   *
   * Initialise and allocate resource for PCI device.
   *
- * @param	pdev	PCI device.
- * @param	id	PCI device ID.
+ * @pdev:	PCI device.
+ * @id:		PCI device ID.
   */
  static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  {
@@ -1715,7 +1715,7 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
   *
   * Release all device resources.
   *
- * @param	pdev	PCI device to clean up.
+ * @pdev:	PCI device to clean up.
   */
  static void pm2fb_remove(struct pci_dev *pdev)
  {
@@ -1756,7 +1756,7 @@ MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
 
 
  #ifndef MODULE
-/**
+/*
   * Parse user specified options.
   *
   * This is, comma-separated options following `video=pm2fb:'.
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#45 lore raw

PATCH v2 15/28 video: fbdev: neofb: Fix set but not used warning for CursorMem

In reply to Sam Ravnborg

Fix W=1 warnings by removing unused code

v2:
- Updated subject (Lee)

Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Evgeny Novikov <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/neofb.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/video/fbdev/neofb.c +0 -4
index 09a20d4ab35f..c0f4f402da3f 100644
@@ -1843,7 +1843,6 @@ static int neo_init_hw(struct fb_info *info)
 	struct neofb_par *par = info->par;
 	int videoRam = 896;
 	int maxClock = 65000;
-	int CursorMem = 1024;
 	int CursorOff = 0x100;
 
 	DBG("neo_init_hw");
@@ -1895,19 +1894,16 @@ static int neo_init_hw(struct fb_info *info)
 	case FB_ACCEL_NEOMAGIC_NM2070:
 	case FB_ACCEL_NEOMAGIC_NM2090:
 	case FB_ACCEL_NEOMAGIC_NM2093:
-		CursorMem = 2048;
 		CursorOff = 0x100;
 		break;
 	case FB_ACCEL_NEOMAGIC_NM2097:
 	case FB_ACCEL_NEOMAGIC_NM2160:
-		CursorMem = 1024;
 		CursorOff = 0x100;
 		break;
 	case FB_ACCEL_NEOMAGIC_NM2200:
 	case FB_ACCEL_NEOMAGIC_NM2230:
 	case FB_ACCEL_NEOMAGIC_NM2360:
 	case FB_ACCEL_NEOMAGIC_NM2380:
-		CursorMem = 1024;
 		CursorOff = 0x1000;
 
 		par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 15/28
#46 lore raw

Re: [PATCH v2 15/28] video: fbdev: neofb: Fix set but not used warning for CursorMem

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 5 lines

Fix W=1 warnings by removing unused code

v2:
- Updated subject (Lee)

Quoted 8 lines
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Evgeny Novikov <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 37 lines
---
  drivers/video/fbdev/neofb.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/video/fbdev/neofb.c +0 -4
index 09a20d4ab35f..c0f4f402da3f 100644
@@ -1843,7 +1843,6 @@ static int neo_init_hw(struct fb_info *info)
  	struct neofb_par *par = info->par;
  	int videoRam = 896;
  	int maxClock = 65000;
-	int CursorMem = 1024;
  	int CursorOff = 0x100;
 
  	DBG("neo_init_hw");
@@ -1895,19 +1894,16 @@ static int neo_init_hw(struct fb_info *info)
  	case FB_ACCEL_NEOMAGIC_NM2070:
  	case FB_ACCEL_NEOMAGIC_NM2090:
  	case FB_ACCEL_NEOMAGIC_NM2093:
-		CursorMem = 2048;
  		CursorOff = 0x100;
  		break;
  	case FB_ACCEL_NEOMAGIC_NM2097:
  	case FB_ACCEL_NEOMAGIC_NM2160:
-		CursorMem = 1024;
  		CursorOff = 0x100;
  		break;
  	case FB_ACCEL_NEOMAGIC_NM2200:
  	case FB_ACCEL_NEOMAGIC_NM2230:
  	case FB_ACCEL_NEOMAGIC_NM2360:
  	case FB_ACCEL_NEOMAGIC_NM2380:
-		CursorMem = 1024;
  		CursorOff = 0x1000;
 
  		par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#47 lore raw

PATCH v2 16/28 video: fbdev: hgafb: Fix kernel-doc warnings

In reply to Sam Ravnborg

Fix kernel-doc comments.

v2:
- Updated subject (Lee)

---
 drivers/video/fbdev/hgafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/hgafb.c +2 -2
index a45fcff1461f..69af72937844 100644
@@ -358,7 +358,7 @@ static int hga_card_detect(void)
 /**
  *	hgafb_open - open the framebuffer device
  *	@info:pointer to fb_info object containing info for current hga board
- *	@int:open by console system or userland.
+ *	@init:open by console system or userland.
  */
 
 static int hgafb_open(struct fb_info *info, int init)
@@ -372,7 +372,7 @@ static int hgafb_open(struct fb_info *info, int init)
 /**
  *	hgafb_open - open the framebuffer device
  *	@info:pointer to fb_info object containing info for current hga board
- *	@int:open by console system or userland.
+ *	@init:open by console system or userland.
  */
 
 static int hgafb_release(struct fb_info *info, int init)
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#48 lore raw

Re: [PATCH v2 16/28] video: fbdev: hgafb: Fix kernel-doc warnings

Hi Sam-

Quoted 18 lines · Sam Ravnborg

Fix kernel-doc comments.

v2:
- Updated subject (Lee)

---
 drivers/video/fbdev/hgafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/hgafb.c +0 -0
index a45fcff1461f..69af72937844 100644

drivers/video/fbdev/hgafb.c static int hga_card_detect(void) · line 361

Quoted 5 lines
drivers/video/fbdev/hgafb.c +1 -1
@@ -358,7 +358,7 @@ static int hga_card_detect(void)
 /**
  *	hgafb_open - open the framebuffer device
  *	@info:pointer to fb_info object containing info for current hga board
- *	@int:open by console system or userland.
+ *	@init:open by console system or userland.

Please add a space after the ':' in 2 lines above.

drivers/video/fbdev/hgafb.c static int hgafb_open(struct fb_info *info, int init) · line 375

Quoted 9 lines
drivers/video/fbdev/hgafb.c +1 -1
  */
 
 static int hgafb_open(struct fb_info *info, int init)
@@ -372,7 +372,7 @@ static int hgafb_open(struct fb_info *info, int init)
 /**
  *	hgafb_open - open the framebuffer device
  *	@info:pointer to fb_info object containing info for current hga board
- *	@int:open by console system or userland.
+ *	@init:open by console system or userland.

Same here (2 lines).

drivers/video/fbdev/hgafb.c static int hgafb_open(struct fb_info *info, int init) · line 378

Quoted 4 lines
drivers/video/fbdev/hgafb.c +0 -0
  */
 
 static int hgafb_release(struct fb_info *info, int init)

thanks.

Signature · 1 line
~Randy
#49 lore raw

PATCH v2 17/28 video: fbdev: tgafb: Fix kernel-doc and set but not used warnings

In reply to Sam Ravnborg

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code

v2:
- Updated subject (Lee)

Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Joe Perches <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/tgafb.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/video/fbdev/tgafb.c +3 -4
index 666fbe2f671c..ae0cf5540636 100644
@@ -555,7 +555,7 @@ tgafb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
 
 /**
  *      tgafb_blank - Optional function.  Blanks the display.
- *      @blank_mode: the blank mode we want.
+ *      @blank: the blank mode we want.
  *      @info: frame buffer structure that represents a single frame buffer
  */
 static int
@@ -837,7 +837,7 @@ tgafb_clut_imageblit(struct fb_info *info, const struct fb_image *image)
 	u32 *palette = ((u32 *)info->pseudo_palette);
 	unsigned long pos, line_length, i, j;
 	const unsigned char *data;
-	void __iomem *regs_base, *fb_base;
+	void __iomem *fb_base;
 
 	dx = image->dx;
 	dy = image->dy;
@@ -855,7 +855,6 @@ tgafb_clut_imageblit(struct fb_info *info, const struct fb_image *image)
 	if (dy + height > vyres)
 		height = vyres - dy;
 
-	regs_base = par->tga_regs_base;
 	fb_base = par->tga_fb_base;
 
 	pos = dy * line_length + (dx * 4);
@@ -1034,7 +1033,7 @@ tgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 		     regs_base + TGA_MODE_REG);
 }
 
-/**
+/*
  *      tgafb_copyarea - REQUIRED function. Can use generic routines if
  *                       non acclerated hardware and packed pixel based.
  *                       Copies on area of the screen to another area.
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 17/28
#50 lore raw

Re: [PATCH v2 17/28] video: fbdev: tgafb: Fix kernel-doc and set but not used warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 7 lines

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code

v2:
- Updated subject (Lee)

Quoted 8 lines
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Joe Perches <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 44 lines
---
  drivers/video/fbdev/tgafb.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
drivers/video/fbdev/tgafb.c +3 -4
index 666fbe2f671c..ae0cf5540636 100644
@@ -555,7 +555,7 @@ tgafb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
 
  /**
   *      tgafb_blank - Optional function.  Blanks the display.
- *      @blank_mode: the blank mode we want.
+ *      @blank: the blank mode we want.
   *      @info: frame buffer structure that represents a single frame buffer
   */
  static int
@@ -837,7 +837,7 @@ tgafb_clut_imageblit(struct fb_info *info, const struct fb_image *image)
  	u32 *palette = ((u32 *)info->pseudo_palette);
  	unsigned long pos, line_length, i, j;
  	const unsigned char *data;
-	void __iomem *regs_base, *fb_base;
+	void __iomem *fb_base;
 
  	dx = image->dx;
  	dy = image->dy;
@@ -855,7 +855,6 @@ tgafb_clut_imageblit(struct fb_info *info, const struct fb_image *image)
  	if (dy + height > vyres)
  		height = vyres - dy;
 
-	regs_base = par->tga_regs_base;
  	fb_base = par->tga_fb_base;
 
  	pos = dy * line_length + (dx * 4);
@@ -1034,7 +1033,7 @@ tgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
  		     regs_base + TGA_MODE_REG);
  }
 
-/**
+/*
   *      tgafb_copyarea - REQUIRED function. Can use generic routines if
   *                       non acclerated hardware and packed pixel based.
   *                       Copies on area of the screen to another area.
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#51 lore raw

PATCH v2 18/28 video: fbdev: mx3fb: Fix kernel-doc, set but not used and string warnings

In reply to Sam Ravnborg

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code/variables
- Use memcpy to copy a string without zero-termination strncpy() generates a warning

v2:
- Updated subject (Lee)

Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Xiaofei Tan <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/mx3fb.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/video/fbdev/mx3fb.c +8 -5
index 894617ddabcb..fabb271337ed 100644
@@ -445,7 +445,6 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 {
 	struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
-	uint32_t enabled;
 	unsigned long flags;
 
 	if (mx3_fbi->txd == NULL)
@@ -453,7 +452,7 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 
 	spin_lock_irqsave(&mx3fb->lock, flags);
 
-	enabled = sdc_fb_uninit(mx3_fbi);
+	sdc_fb_uninit(mx3_fbi);
 
 	spin_unlock_irqrestore(&mx3fb->lock, flags);
 
@@ -732,7 +731,7 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi);
 
 /**
  * mx3fb_set_fix() - set fixed framebuffer parameters from variable settings.
- * @info:	framebuffer information pointer
+ * @fbi:	framebuffer information pointer
  * @return:	0 on success or negative error code on failure.
  */
 static int mx3fb_set_fix(struct fb_info *fbi)
@@ -740,7 +739,7 @@ static int mx3fb_set_fix(struct fb_info *fbi)
 	struct fb_fix_screeninfo *fix = &fbi->fix;
 	struct fb_var_screeninfo *var = &fbi->var;
 
-	strncpy(fix->id, "DISP3 BG", 8);
+	memcpy(fix->id, "DISP3 BG", 8);
 
 	fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
 
@@ -1105,6 +1104,8 @@ static void __blank(int blank, struct fb_info *fbi)
 
 /**
  * mx3fb_blank() - blank the display.
+ * @blank:	blank value for the panel
+ * @fbi:	framebuffer information pointer
  */
 static int mx3fb_blank(int blank, struct fb_info *fbi)
 {
@@ -1126,7 +1127,7 @@ static int mx3fb_blank(int blank, struct fb_info *fbi)
 /**
  * mx3fb_pan_display() - pan or wrap the display
  * @var:	variable screen buffer information.
- * @info:	framebuffer information pointer.
+ * @fbi:	framebuffer information pointer.
  *
  * We look only at xoffset, yoffset and the FB_VMODE_YWRAP flag
  */
@@ -1387,6 +1388,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi)
 
 /**
  * mx3fb_init_fbinfo() - initialize framebuffer information object.
+ * @dev: the device
+ * @ops:	framebuffer device operations
  * @return:	initialized framebuffer structure.
  */
 static struct fb_info *mx3fb_init_fbinfo(struct device *dev,
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 18/28
#52 lore raw

Re: [PATCH v2 18/28] video: fbdev: mx3fb: Fix kernel-doc, set but not used and string warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 9 lines

Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code/variables
- Use memcpy to copy a string without zero-termination strncpy() generates a warning

v2:
- Updated subject (Lee)

Quoted 8 lines
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Xiaofei Tan <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 71 lines
---
  drivers/video/fbdev/mx3fb.c | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)
drivers/video/fbdev/mx3fb.c +8 -5
index 894617ddabcb..fabb271337ed 100644
@@ -445,7 +445,6 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
  static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
  {
  	struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
-	uint32_t enabled;
  	unsigned long flags;
 
  	if (mx3_fbi->txd == NULL)
@@ -453,7 +452,7 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 
  	spin_lock_irqsave(&mx3fb->lock, flags);
 
-	enabled = sdc_fb_uninit(mx3_fbi);
+	sdc_fb_uninit(mx3_fbi);
 
  	spin_unlock_irqrestore(&mx3fb->lock, flags);
 
@@ -732,7 +731,7 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi);
 
  /**
   * mx3fb_set_fix() - set fixed framebuffer parameters from variable settings.
- * @info:	framebuffer information pointer
+ * @fbi:	framebuffer information pointer
   * @return:	0 on success or negative error code on failure.
   */
  static int mx3fb_set_fix(struct fb_info *fbi)
@@ -740,7 +739,7 @@ static int mx3fb_set_fix(struct fb_info *fbi)
  	struct fb_fix_screeninfo *fix = &fbi->fix;
  	struct fb_var_screeninfo *var = &fbi->var;
 
-	strncpy(fix->id, "DISP3 BG", 8);
+	memcpy(fix->id, "DISP3 BG", 8);
 
  	fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
 
@@ -1105,6 +1104,8 @@ static void __blank(int blank, struct fb_info *fbi)
 
  /**
   * mx3fb_blank() - blank the display.
+ * @blank:	blank value for the panel
+ * @fbi:	framebuffer information pointer
   */
  static int mx3fb_blank(int blank, struct fb_info *fbi)
  {
@@ -1126,7 +1127,7 @@ static int mx3fb_blank(int blank, struct fb_info *fbi)
  /**
   * mx3fb_pan_display() - pan or wrap the display
   * @var:	variable screen buffer information.
- * @info:	framebuffer information pointer.
+ * @fbi:	framebuffer information pointer.
   *
   * We look only at xoffset, yoffset and the FB_VMODE_YWRAP flag
   */
@@ -1387,6 +1388,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi)
 
  /**
   * mx3fb_init_fbinfo() - initialize framebuffer information object.
+ * @dev: the device
+ * @ops:	framebuffer device operations
   * @return:	initialized framebuffer structure.
   */
  static struct fb_info *mx3fb_init_fbinfo(struct device *dev,
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#53 lore raw

PATCH v2 19/28 video: fbdev: sstfb: Updated logging to fix set but not used warnings

In reply to Sam Ravnborg

Fix set but not used warnings by introducing no_printk variants for the internal logging system for this driver.

Fix a new warning that popped up now that logging was checked for correct printf format strings.

A more invasive fix had been to replace all the internal logging with standard logging primitives - thats for another day.

v2:
- Update subject (Lee)

Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Alex Dewar <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/sstfb.c | 2 +-
 include/video/sstfb.h       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/sstfb.c +1 -1
index c05cdabeb11c..27d4b0ace2d6 100644
@@ -1390,7 +1390,7 @@ static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	        fix->smem_start, info->screen_base,
 	        fix->smem_len >> 20);
 
-	f_ddprintk("regbase_virt: %#lx\n", par->mmio_vbase);
+	f_ddprintk("regbase_virt: %p\n", par->mmio_vbase);
 	f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
 	f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
include/video/sstfb.h +2 -2
index 28384f354773..d4a5e41d1173 100644
@@ -23,7 +23,7 @@
 #  define SST_DEBUG_FUNC 1
 #  define SST_DEBUG_VAR  1
 #else
-#  define dprintk(X...)
+#  define dprintk(X...)		no_printk(X)
 #  define SST_DEBUG_REG  0
 #  define SST_DEBUG_FUNC 0
 #  define SST_DEBUG_VAR  0
@@ -48,7 +48,7 @@
 #if (SST_DEBUG_FUNC > 1)
 #  define f_ddprintk(X...)	dprintk(" " X)
 #else
-#  define f_ddprintk(X...)
+#  define f_ddprintk(X...)	no_printk(X)
 #endif
 #if (SST_DEBUG_FUNC > 2)
 #  define f_dddprintk(X...)	dprintk(" " X)
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 19/28
#54 lore raw

Re: [PATCH v2 19/28] video: fbdev: sstfb: Updated logging to fix set but not used warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 12 lines

Fix set but not used warnings by introducing no_printk variants for the internal logging system for this driver.

Fix a new warning that popped up now that logging was checked for correct printf format strings.

A more invasive fix had been to replace all the internal logging with standard logging primitives - thats for another day.

v2:
- Update subject (Lee)

Quoted 9 lines
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Alex Dewar <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 41 lines
---
  drivers/video/fbdev/sstfb.c | 2 +-
  include/video/sstfb.h       | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/sstfb.c +1 -1
index c05cdabeb11c..27d4b0ace2d6 100644
@@ -1390,7 +1390,7 @@ static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  	        fix->smem_start, info->screen_base,
  	        fix->smem_len >> 20);
 
-	f_ddprintk("regbase_virt: %#lx\n", par->mmio_vbase);
+	f_ddprintk("regbase_virt: %p\n", par->mmio_vbase);
  	f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
  	f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
include/video/sstfb.h +2 -2
index 28384f354773..d4a5e41d1173 100644
@@ -23,7 +23,7 @@
  #  define SST_DEBUG_FUNC 1
  #  define SST_DEBUG_VAR  1
  #else
-#  define dprintk(X...)
+#  define dprintk(X...)		no_printk(X)
  #  define SST_DEBUG_REG  0
  #  define SST_DEBUG_FUNC 0
  #  define SST_DEBUG_VAR  0
@@ -48,7 +48,7 @@
  #if (SST_DEBUG_FUNC > 1)
  #  define f_ddprintk(X...)	dprintk(" " X)
  #else
-#  define f_ddprintk(X...)
+#  define f_ddprintk(X...)	no_printk(X)
  #endif
  #if (SST_DEBUG_FUNC > 2)
  #  define f_dddprintk(X...)	dprintk(" " X)
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#55 lore raw

PATCH v2 20/28 video: fbdev: nvidia: Fix set but not used warnings

In reply to Sam Ravnborg

Fix warnings by deleting unused code. The register reads are kept as it is unknown if there are any hidden side-effects.

v2:
- Update subject (Lee)

---
 drivers/video/fbdev/nvidia/nv_setup.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/video/fbdev/nvidia/nv_setup.c +2 -5
index 2fa68669613a..5404017e6957 100644
@@ -89,9 +89,8 @@ u8 NVReadSeq(struct nvidia_par *par, u8 index)
 }
 void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
 {
-	volatile u8 tmp;
 
-	tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+	VGA_RD08(par->PCIO, par->IOBase + 0x0a);
 	if (par->paletteEnabled)
 		index &= ~0x20;
 	else
@@ -101,9 +100,7 @@ void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
 }
 u8 NVReadAttr(struct nvidia_par *par, u8 index)
 {
-	volatile u8 tmp;
-
-	tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+	VGA_RD08(par->PCIO, par->IOBase + 0x0a);
 	if (par->paletteEnabled)
 		index &= ~0x20;
 	else
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 20/28
#56 lore raw

Re: [PATCH v2 20/28] video: fbdev: nvidia: Fix set but not used warnings

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 19 lines

Fix warnings by deleting unused code. The register reads are kept as it is unknown if there are any hidden side-effects.

v2:
- Update subject (Lee)

---
  drivers/video/fbdev/nvidia/nv_setup.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/video/fbdev/nvidia/nv_setup.c +0 -0
index 2fa68669613a..5404017e6957 100644

drivers/video/fbdev/nvidia/nv_setup.c u8 NVReadSeq(struct nvidia_par *par, u8 index) · line 93

Quoted 7 lines
drivers/video/fbdev/nvidia/nv_setup.c +1 -2
@@ -89,9 +89,8 @@ u8 NVReadSeq(struct nvidia_par *par, u8 index)
  }
  void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
  {
-	volatile u8 tmp;
 
-	tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+	VGA_RD08(par->PCIO, par->IOBase + 0x0a);

This again looks like it sets up the attribute register. I hope this isn't optimized away now.

Quoted 15 lines
drivers/video/fbdev/nvidia/nv_setup.c +1 -3
  	if (par->paletteEnabled)
  		index &= ~0x20;
  	else
@@ -101,9 +100,7 @@ void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
  }
  u8 NVReadAttr(struct nvidia_par *par, u8 index)
  {
-	volatile u8 tmp;
-
-	tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+	VGA_RD08(par->PCIO, par->IOBase + 0x0a);
  	if (par->paletteEnabled)
  		index &= ~0x20;
  	else
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#57 lore raw

PATCH v2 21/28 video: fbdev: tmiofb: Fix set but not used warnings

In reply to Sam Ravnborg

Fix W=1 warnings by avoiding local variables and use direct references.

v2:
- Updated subject (Lee)

Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/tmiofb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/fbdev/tmiofb.c +2 -4
index 50111966c981..b70faa3850f2 100644
@@ -802,10 +802,8 @@ static int tmiofb_remove(struct platform_device *dev)
 	const struct mfd_cell *cell = mfd_get_cell(dev);
 	struct fb_info *info = platform_get_drvdata(dev);
 	int irq = platform_get_irq(dev, 0);
-	struct tmiofb_par *par;
 
 	if (info) {
-		par = info->par;
 		unregister_framebuffer(info);
 
 		tmiofb_hw_stop(dev);
@@ -816,8 +814,8 @@ static int tmiofb_remove(struct platform_device *dev)
 		free_irq(irq, info);
 
 		iounmap(info->screen_base);
-		iounmap(par->lcr);
-		iounmap(par->ccr);
+		iounmap(((struct tmiofb_par *)info->par)->lcr);
+		iounmap(((struct tmiofb_par *)info->par)->ccr);
 
 		framebuffer_release(info);
 	}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#58 lore raw

Re: [PATCH v2 21/28] video: fbdev: tmiofb: Fix set but not used warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 1 line

Fix W=1 warnings by avoiding local variables and use direct references.

What's the bug here?

Quoted 40 lines

v2:
- Updated subject (Lee)

Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/tmiofb.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/fbdev/tmiofb.c +2 -4
index 50111966c981..b70faa3850f2 100644
@@ -802,10 +802,8 @@ static int tmiofb_remove(struct platform_device *dev)
  	const struct mfd_cell *cell = mfd_get_cell(dev);
  	struct fb_info *info = platform_get_drvdata(dev);
  	int irq = platform_get_irq(dev, 0);
-	struct tmiofb_par *par;
 
  	if (info) {
-		par = info->par;
  		unregister_framebuffer(info);
 
  		tmiofb_hw_stop(dev);
@@ -816,8 +814,8 @@ static int tmiofb_remove(struct platform_device *dev)
  		free_irq(irq, info);
 
  		iounmap(info->screen_base);
-		iounmap(par->lcr);
-		iounmap(par->ccr);
+		iounmap(((struct tmiofb_par *)info->par)->lcr);
+		iounmap(((struct tmiofb_par *)info->par)->ccr);
 
  		framebuffer_release(info);
  	}
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#59 lore raw

Re: [PATCH v2 21/28] video: fbdev: tmiofb: Fix set but not used warnings

Hi Thomas,

Quoted 6 lines · Thomas Zimmermann

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 1 line

Fix W=1 warnings by avoiding local variables and use direct references.

What's the bug here?

sh define iounmap like this:
#define iounmap(addr) do { } while (0)

So par is not used resulting in a warning.

My patch just papers over the real issue.
The right fix is to fix sh so we reference addr.
Will give that a shot.

Sam

Quoted 29 lines
Quoted 29 lines

v2:
- Updated subject (Lee)

Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/tmiofb.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/fbdev/tmiofb.c +0 -2
index 50111966c981..b70faa3850f2 100644
@@ -802,10 +802,8 @@ static int tmiofb_remove(struct platform_device *dev)
  	const struct mfd_cell *cell = mfd_get_cell(dev);
  	struct fb_info *info = platform_get_drvdata(dev);
  	int irq = platform_get_irq(dev, 0);
-	struct tmiofb_par *par;
  	if (info) {
-		par = info->par;
  		unregister_framebuffer(info);
  		tmiofb_hw_stop(dev);
@@ -816,8 +814,8 @@ static int tmiofb_remove(struct platform_device *dev)
  		free_irq(irq, info);
Quoted 17 lines
Quoted 8 lines
drivers/video/fbdev/tmiofb.c +2 -2
  		iounmap(info->screen_base);
-		iounmap(par->lcr);
-		iounmap(par->ccr);
+		iounmap(((struct tmiofb_par *)info->par)->lcr);
+		iounmap(((struct tmiofb_par *)info->par)->ccr);
  		framebuffer_release(info);
  	}
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#60 lore raw

PATCH v2 22/28 video: fbdev: omapfb: Fix set but not used warnings in dsi

In reply to Sam Ravnborg

Fix several W=1 warnings.
This removes unused code and avoids an assignment by moving the use inside the conditional block.

The register read FLD_GET(r, 15, 8) could be dropped as it was done a few lines before too.

v2:
- Updated subject (Lee)

Cc Aditya Pakki <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/dsi.c +3 -9
index 6f9c25fec994..72d45a02c3ac 100644
@@ -1178,13 +1178,12 @@ static int dsi_regulator_init(struct platform_device *dsidev)
 
 static void _dsi_print_reset_status(struct platform_device *dsidev)
 {
-	u32 l;
 	int b0, b1, b2;
 
 	/* A dummy read using the SCP interface to any DSIPHY register is
 	 * required after DSIPHY reset to complete the reset of the DSI complex
 	 * I/O. */
-	l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
+	dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
 
 	if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) {
 		b0 = 28;
@@ -3627,7 +3626,7 @@ static int dsi_proto_config(struct platform_device *dsidev)
 static void dsi_proto_timings(struct platform_device *dsidev)
 {
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-	unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
+	unsigned tlpx, tclk_zero, tclk_prepare;
 	unsigned tclk_pre, tclk_post;
 	unsigned ths_prepare, ths_prepare_ths_zero, ths_zero;
 	unsigned ths_trail, ths_exit;
@@ -3646,7 +3645,6 @@ static void dsi_proto_timings(struct platform_device *dsidev)
 
 	r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG1);
 	tlpx = FLD_GET(r, 20, 16) * 2;
-	tclk_trail = FLD_GET(r, 15, 8);
 	tclk_zero = FLD_GET(r, 7, 0);
 
 	r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG2);
@@ -4040,7 +4038,6 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel,
 {
 	struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-	u16 dw, dh;
 
 	dsi_perf_mark_setup(dsidev);
 
@@ -4049,11 +4046,8 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel,
 	dsi->framedone_callback = callback;
 	dsi->framedone_data = data;
 
-	dw = dsi->timings.x_res;
-	dh = dsi->timings.y_res;
-
 #ifdef DSI_PERF_MEASURE
-	dsi->update_bytes = dw * dh *
+	dsi->update_bytes = dsi->timings.x_res * dsi->timings.y_res *
 		dsi_get_pixel_size(dsi->pix_fmt) / 8;
 #endif
 	dsi_update_screen_dispc(dsidev);
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 22/28
#61 lore raw

Re: [PATCH v2 22/28] video: fbdev: omapfb: Fix set but not used warnings in dsi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 7 lines

Fix several W=1 warnings.
This removes unused code and avoids an assignment by moving the use inside the conditional block.

The register read FLD_GET(r, 15, 8) could be dropped as it was done a few lines before too.

Quoted 8 lines

v2:
- Updated subject (Lee)

Cc Aditya Pakki <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 62 lines
---
  drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 12 +++---------
  1 file changed, 3 insertions(+), 9 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/dsi.c +3 -9
index 6f9c25fec994..72d45a02c3ac 100644
@@ -1178,13 +1178,12 @@ static int dsi_regulator_init(struct platform_device *dsidev)
 
  static void _dsi_print_reset_status(struct platform_device *dsidev)
  {
-	u32 l;
  	int b0, b1, b2;
 
  	/* A dummy read using the SCP interface to any DSIPHY register is
  	 * required after DSIPHY reset to complete the reset of the DSI complex
  	 * I/O. */
-	l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
+	dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
 
  	if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) {
  		b0 = 28;
@@ -3627,7 +3626,7 @@ static int dsi_proto_config(struct platform_device *dsidev)
  static void dsi_proto_timings(struct platform_device *dsidev)
  {
  	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-	unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
+	unsigned tlpx, tclk_zero, tclk_prepare;
  	unsigned tclk_pre, tclk_post;
  	unsigned ths_prepare, ths_prepare_ths_zero, ths_zero;
  	unsigned ths_trail, ths_exit;
@@ -3646,7 +3645,6 @@ static void dsi_proto_timings(struct platform_device *dsidev)
 
  	r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG1);
  	tlpx = FLD_GET(r, 20, 16) * 2;
-	tclk_trail = FLD_GET(r, 15, 8);
  	tclk_zero = FLD_GET(r, 7, 0);
 
  	r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG2);
@@ -4040,7 +4038,6 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel,
  {
  	struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
  	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-	u16 dw, dh;
 
  	dsi_perf_mark_setup(dsidev);
 
@@ -4049,11 +4046,8 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel,
  	dsi->framedone_callback = callback;
  	dsi->framedone_data = data;
 
-	dw = dsi->timings.x_res;
-	dh = dsi->timings.y_res;
-
  #ifdef DSI_PERF_MEASURE
-	dsi->update_bytes = dw * dh *
+	dsi->update_bytes = dsi->timings.x_res * dsi->timings.y_res *
  		dsi_get_pixel_size(dsi->pix_fmt) / 8;
  #endif
  	dsi_update_screen_dispc(dsidev);
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#62 lore raw

PATCH v2 23/28 video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core

In reply to Sam Ravnborg

Fix a few W=1 warnings about unused assignments. Drop the unused error code.

v2:
- Subject updated (Lee)

Cc Sam Ravnborg <[email protected]>
Cc Qilong Zhang <[email protected]>
Cc "Alexander A. Klimov" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c | 4 ++--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +2 -2
index 726c190862d4..e6363a420933 100644
@@ -679,7 +679,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
 	struct hdmi_audio_format audio_format;
 	struct hdmi_audio_dma audio_dma;
 	struct hdmi_core_audio_config acore;
-	int err, n, cts, channel_count;
+	int n, cts, channel_count;
 	unsigned int fs_nr;
 	bool word_length_16b = false;
 
@@ -741,7 +741,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
 		return -EINVAL;
 	}
 
-	err = hdmi_compute_acr(pclk, fs_nr, &n, &cts);
+	hdmi_compute_acr(pclk, fs_nr, &n, &cts);
 
 	/* Audio clock regeneration settings */
 	acore.n = n;
drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c +2 -2
index eda29d3032e1..cb63bc0e92ca 100644
@@ -790,7 +790,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
 	struct hdmi_audio_format audio_format;
 	struct hdmi_audio_dma audio_dma;
 	struct hdmi_core_audio_config core_cfg;
-	int err, n, cts, channel_count;
+	int n, cts, channel_count;
 	unsigned int fs_nr;
 	bool word_length_16b = false;
 
@@ -833,7 +833,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
 		return -EINVAL;
 	}
 
-	err = hdmi_compute_acr(pclk, fs_nr, &n, &cts);
+	hdmi_compute_acr(pclk, fs_nr, &n, &cts);
 	core_cfg.n = n;
 	core_cfg.cts = cts;
 
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#63 lore raw

Re: [PATCH v2 23/28] video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 31 lines

Fix a few W=1 warnings about unused assignments. Drop the unused error code.

v2:
- Subject updated (Lee)

Cc Sam Ravnborg <[email protected]>
Cc Qilong Zhang <[email protected]>
Cc "Alexander A. Klimov" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c | 4 ++--
  drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +1 -1
index 726c190862d4..e6363a420933 100644
@@ -679,7 +679,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  	struct hdmi_audio_format audio_format;
  	struct hdmi_audio_dma audio_dma;
  	struct hdmi_core_audio_config acore;
-	int err, n, cts, channel_count;
+	int n, cts, channel_count;
  	unsigned int fs_nr;
  	bool word_length_16b = false;
 

drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp, · line 744

Quoted 5 lines
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +1 -1
@@ -741,7 +741,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  		return -EINVAL;
  	}
 
-	err = hdmi_compute_acr(pclk, fs_nr, &n, &cts);
+	hdmi_compute_acr(pclk, fs_nr, &n, &cts);

I'd rather return the error reported by hdmi_compute_acr()

Best regards
Thomas

Quoted 26 lines
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +0 -0
  	/* Audio clock regeneration settings */
  	acore.n = n;
drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c +2 -2
index eda29d3032e1..cb63bc0e92ca 100644
@@ -790,7 +790,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  	struct hdmi_audio_format audio_format;
  	struct hdmi_audio_dma audio_dma;
  	struct hdmi_core_audio_config core_cfg;
-	int err, n, cts, channel_count;
+	int n, cts, channel_count;
  	unsigned int fs_nr;
  	bool word_length_16b = false;
 
@@ -833,7 +833,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  		return -EINVAL;
  	}
 
-	err = hdmi_compute_acr(pclk, fs_nr, &n, &cts);
+	hdmi_compute_acr(pclk, fs_nr, &n, &cts);
  	core_cfg.n = n;
  	core_cfg.cts = cts;
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#64 lore raw

Re: [PATCH v2 23/28] video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core

Quoted 31 lines · Thomas Zimmermann

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 28 lines

Fix a few W=1 warnings about unused assignments. Drop the unused error code.

v2:
- Subject updated (Lee)

Cc Sam Ravnborg <[email protected]>
Cc Qilong Zhang <[email protected]>
Cc "Alexander A. Klimov" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c | 4 ++--
  drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +1 -1
index 726c190862d4..e6363a420933 100644
@@ -679,7 +679,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  	struct hdmi_audio_format audio_format;
  	struct hdmi_audio_dma audio_dma;
  	struct hdmi_core_audio_config acore;
-	int err, n, cts, channel_count;
+	int n, cts, channel_count;
  	unsigned int fs_nr;
Quoted 8 lines

drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp, · line 743

Quoted 6 lines
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +1 -1
  	bool word_length_16b = false;
@@ -741,7 +741,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  		return -EINVAL;
  	}
-	err = hdmi_compute_acr(pclk, fs_nr, &n, &cts);
+	hdmi_compute_acr(pclk, fs_nr, &n, &cts);

I'd rather return the error reported by hdmi_compute_acr()

The DRM version of the same driver does not bother, so I think we should avoid it here too.

The better fix would be to sunset the omapfb driver - dunno how far we are from that. There is still a lot of patch chrunch on the omapdrm driver.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#65 lore raw

PATCH v2 24/28 video: fbdev: s3c-fb: Fix kernel-doc and set but not used warnings

In reply to Sam Ravnborg

Fix several W=1 warnings
- Updated kernel-doc as needed
- Deleted unused local variable, it was assigned but never used

v2:
- Updated subject (Lee)

---
 drivers/video/fbdev/s3c-fb.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/video/fbdev/s3c-fb.c +6 -5
index ba316bd56efd..3b134e1bbc38 100644
@@ -75,6 +75,7 @@ struct s3c_fb;
  * @buf_size: Offset of buffer size registers.
  * @buf_end: Offset of buffer end registers.
  * @osd: The base for the OSD registers.
+ * @osd_stride: stride of osd
  * @palette: Address of palette memory, or 0 if none.
  * @has_prtcon: Set if has PRTCON register.
  * @has_shadowcon: Set if has SHADOWCON register.
@@ -155,7 +156,7 @@ struct s3c_fb_palette {
  * @windata: The platform data supplied for the window configuration.
  * @parent: The hardware that this window is part of.
  * @fbinfo: Pointer pack to the framebuffer info for this window.
- * @varint: The variant information for this window.
+ * @variant: The variant information for this window.
  * @palette_buffer: Buffer/cache to hold palette entries.
  * @pseudo_palette: For use in TRUECOLOUR modes for entries 0..15/
  * @index: The window number of this window.
@@ -336,7 +337,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
 /**
  * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock.
  * @sfb: The hardware state.
- * @pixclock: The pixel clock wanted, in picoseconds.
+ * @pixclk: The pixel clock wanted, in picoseconds.
  *
  * Given the specified pixel clock, work out the necessary divider to get
  * close to the output frequency.
@@ -733,7 +734,7 @@ static inline unsigned int chan_to_field(unsigned int chan,
  * @red: The red field for the palette data.
  * @green: The green field for the palette data.
  * @blue: The blue field for the palette data.
- * @trans: The transparency (alpha) field for the palette data.
+ * @transp: The transparency (alpha) field for the palette data.
  * @info: The framebuffer being changed.
  */
 static int s3c_fb_setcolreg(unsigned regno,
@@ -1133,6 +1134,7 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win)
 
 /**
  * s3c_fb_release_win() - release resources for a framebuffer window.
+ * @sfb: The base resources for the hardware.
  * @win: The window to cleanup the resources for.
  *
  * Release the resources that where claimed for the hardware window,
@@ -1160,6 +1162,7 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win)
 /**
  * s3c_fb_probe_win() - register an hardware window
  * @sfb: The base resources for the hardware
+ * @win_no: The window number
  * @variant: The variant information for this window.
  * @res: Pointer to where to place the resultant window.
  *
@@ -1170,7 +1173,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
 			    struct s3c_fb_win_variant *variant,
 			    struct s3c_fb_win **res)
 {
-	struct fb_var_screeninfo *var;
 	struct fb_videomode initmode;
 	struct s3c_fb_pd_win *windata;
 	struct s3c_fb_win *win;
@@ -1198,7 +1200,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
 
 	win = fbinfo->par;
 	*res = win;
-	var = &fbinfo->var;
 	win->variant = *variant;
 	win->fbinfo = fbinfo;
 	win->parent = sfb;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 24/28
#66 lore raw

Re: [PATCH v2 24/28] video: fbdev: s3c-fb: Fix kernel-doc and set but not used warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 11 lines

Fix several W=1 warnings
- Updated kernel-doc as needed
- Deleted unused local variable, it was assigned but never used

v2:
- Updated subject (Lee)

Quoted 76 lines
---
  drivers/video/fbdev/s3c-fb.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
drivers/video/fbdev/s3c-fb.c +6 -5
index ba316bd56efd..3b134e1bbc38 100644
@@ -75,6 +75,7 @@ struct s3c_fb;
   * @buf_size: Offset of buffer size registers.
   * @buf_end: Offset of buffer end registers.
   * @osd: The base for the OSD registers.
+ * @osd_stride: stride of osd
   * @palette: Address of palette memory, or 0 if none.
   * @has_prtcon: Set if has PRTCON register.
   * @has_shadowcon: Set if has SHADOWCON register.
@@ -155,7 +156,7 @@ struct s3c_fb_palette {
   * @windata: The platform data supplied for the window configuration.
   * @parent: The hardware that this window is part of.
   * @fbinfo: Pointer pack to the framebuffer info for this window.
- * @varint: The variant information for this window.
+ * @variant: The variant information for this window.
   * @palette_buffer: Buffer/cache to hold palette entries.
   * @pseudo_palette: For use in TRUECOLOUR modes for entries 0..15/
   * @index: The window number of this window.
@@ -336,7 +337,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
  /**
   * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock.
   * @sfb: The hardware state.
- * @pixclock: The pixel clock wanted, in picoseconds.
+ * @pixclk: The pixel clock wanted, in picoseconds.
   *
   * Given the specified pixel clock, work out the necessary divider to get
   * close to the output frequency.
@@ -733,7 +734,7 @@ static inline unsigned int chan_to_field(unsigned int chan,
   * @red: The red field for the palette data.
   * @green: The green field for the palette data.
   * @blue: The blue field for the palette data.
- * @trans: The transparency (alpha) field for the palette data.
+ * @transp: The transparency (alpha) field for the palette data.
   * @info: The framebuffer being changed.
   */
  static int s3c_fb_setcolreg(unsigned regno,
@@ -1133,6 +1134,7 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win)
 
  /**
   * s3c_fb_release_win() - release resources for a framebuffer window.
+ * @sfb: The base resources for the hardware.
   * @win: The window to cleanup the resources for.
   *
   * Release the resources that where claimed for the hardware window,
@@ -1160,6 +1162,7 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win)
  /**
   * s3c_fb_probe_win() - register an hardware window
   * @sfb: The base resources for the hardware
+ * @win_no: The window number
   * @variant: The variant information for this window.
   * @res: Pointer to where to place the resultant window.
   *
@@ -1170,7 +1173,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
  			    struct s3c_fb_win_variant *variant,
  			    struct s3c_fb_win **res)
  {
-	struct fb_var_screeninfo *var;
  	struct fb_videomode initmode;
  	struct s3c_fb_pd_win *windata;
  	struct s3c_fb_win *win;
@@ -1198,7 +1200,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
 
  	win = fbinfo->par;
  	*res = win;
-	var = &fbinfo->var;
  	win->variant = *variant;
  	win->fbinfo = fbinfo;
  	win->parent = sfb;
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#67 lore raw

PATCH v2 25/28 video: fbdev: uvesafb: Fix set but not used warning

In reply to Sam Ravnborg

Fix W=1 warning by deleting unused local variable.

v2:
- Updated subject (Lee)

---
 drivers/video/fbdev/uvesafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/uvesafb.c +2 -2
index def14ac0ebe1..8ee0fc9c63cf 100644
@@ -554,12 +554,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;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#68 lore raw

Re: [PATCH v2 25/28] video: fbdev: uvesafb: Fix set but not used warning

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 19 lines

Fix W=1 warning by deleting unused local variable.

v2:
- Updated subject (Lee)

---
  drivers/video/fbdev/uvesafb.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/uvesafb.c +0 -0
index def14ac0ebe1..8ee0fc9c63cf 100644
@@ -554,12 +554,12 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
  static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,

drivers/video/fbdev/uvesafb.c static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task, · line 562

Quoted 10 lines
drivers/video/fbdev/uvesafb.c +2 -2
  			      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);

Would it be better to report the error here?

Best regards
Thomas

Quoted 4 lines
drivers/video/fbdev/uvesafb.c +0 -0
  	if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
  		par->pmi_setpal = par->ypan = 0;
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#69 lore raw

PATCH v2 26/28 video: fbdev: uvesafb: Fix string related warnings

In reply to Sam Ravnborg

Two W=1 string related warnings.
- Using strncpy to copy string without null-termination generates a warning. Use memcpy to copy only the relevant chars

- Fix a potential bug with a very long string, subtract one from the length to make room for the termination null.

---
 drivers/video/fbdev/uvesafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/uvesafb.c +2 -2
index 8ee0fc9c63cf..45dc8da191e4 100644
@@ -423,7 +423,7 @@ static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
 	task->t.flags = TF_VBEIB;
 	task->t.buf_len = sizeof(struct vbe_ib);
 	task->buf = &par->vbe_ib;
-	strncpy(par->vbe_ib.vbe_signature, "VBE2", 4);
+	memcpy(par->vbe_ib.vbe_signature, "VBE2", 4);
 
 	err = uvesafb_exec(task);
 	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
@@ -1871,7 +1871,7 @@ static ssize_t v86d_show(struct device_driver *dev, char *buf)
 static ssize_t v86d_store(struct device_driver *dev, const char *buf,
 		size_t count)
 {
-	strncpy(v86d_path, buf, PATH_MAX);
+	strncpy(v86d_path, buf, PATH_MAX - 1);
 	return count;
 }
 static DRIVER_ATTR_RW(v86d);
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 26/28
#70 lore raw

Re: [PATCH v2 26/28] video: fbdev: uvesafb: Fix string related warnings

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 28 lines

Two W=1 string related warnings.
- Using strncpy to copy string without null-termination generates a warning. Use memcpy to copy only the relevant chars

- Fix a potential bug with a very long string, subtract one from the length to make room for the termination null.

---
  drivers/video/fbdev/uvesafb.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/uvesafb.c +1 -1
index 8ee0fc9c63cf..45dc8da191e4 100644
@@ -423,7 +423,7 @@ static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
  	task->t.flags = TF_VBEIB;
  	task->t.buf_len = sizeof(struct vbe_ib);
  	task->buf = &par->vbe_ib;
-	strncpy(par->vbe_ib.vbe_signature, "VBE2", 4);
+	memcpy(par->vbe_ib.vbe_signature, "VBE2", 4);
 
  	err = uvesafb_exec(task);
  	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {

drivers/video/fbdev/uvesafb.c static ssize_t v86d_show(struct device_driver *dev, char *buf) · line 1874

Quoted 5 lines
drivers/video/fbdev/uvesafb.c +1 -1
@@ -1871,7 +1871,7 @@ static ssize_t v86d_show(struct device_driver *dev, char *buf)
  static ssize_t v86d_store(struct device_driver *dev, const char *buf,
  		size_t count)
  {
-	strncpy(v86d_path, buf, PATH_MAX);
+	strncpy(v86d_path, buf, PATH_MAX - 1);

From lookign a the drive rcode, I assume that the code never touches the final byte in v86d_path. So it remains \0 indefinitely.

Quoted 4 lines
drivers/video/fbdev/uvesafb.c +0 -0
  	return count;
  }
  static DRIVER_ATTR_RW(v86d);
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#71 lore raw

PATCH v2 27/28 video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings

In reply to Sam Ravnborg

Fix warnings:
- drop kernel-doc for the two debug functions to avoid the warnings
- delete unused code

v2:
- Updated subject (Lee)

Cc Thomas Zimemrmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Saeed Mirzamohammadi <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/cirrusfb.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/video/fbdev/cirrusfb.c +9 -11
index e9027172c0f5..93802abbbc72 100644
@@ -2463,8 +2463,6 @@ static void AttrOn(const struct cirrusfb_info *cinfo)
  */
 static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
 {
-	unsigned char dummy;
-
 	if (is_laguna(cinfo))
 		return;
 	if (cinfo->btype == BT_PICASSO) {
@@ -2473,18 +2471,18 @@ static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
 		WGen(cinfo, VGA_PEL_MSK, 0x00);
 		udelay(200);
 		/* next read dummy from pixel address (3c8) */
-		dummy = RGen(cinfo, VGA_PEL_IW);
+		RGen(cinfo, VGA_PEL_IW);
 		udelay(200);
 	}
 	/* now do the usual stuff to access the HDR */
 
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
 	udelay(200);
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
 	udelay(200);
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
 	udelay(200);
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
 	udelay(200);
 
 	WGen(cinfo, VGA_PEL_MSK, val);
@@ -2492,7 +2490,7 @@ static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
 
 	if (cinfo->btype == BT_PICASSO) {
 		/* now first reset HDR access counter */
-		dummy = RGen(cinfo, VGA_PEL_IW);
+		RGen(cinfo, VGA_PEL_IW);
 		udelay(200);
 
 		/* and at the end, restore the mask value */
@@ -2800,9 +2798,9 @@ static void bestclock(long freq, int *nom, int *den, int *div)
 
 #ifdef CIRRUSFB_DEBUG
 
-/**
+/*
  * cirrusfb_dbg_print_regs
- * @base: If using newmmio, the newmmio base address, otherwise %NULL
+ * @regbase: If using newmmio, the newmmio base address, otherwise %NULL
  * @reg_class: type of registers to read: %CRT, or %SEQ
  *
  * DESCRIPTION:
@@ -2847,7 +2845,7 @@ static void cirrusfb_dbg_print_regs(struct fb_info *info,
 	va_end(list);
 }
 
-/**
+/*
  * cirrusfb_dbg_reg_dump
  * @base: If using newmmio, the newmmio base address, otherwise %NULL
  *
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v2 27/28
#72 lore raw

Re: [PATCH v2 27/28] video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 34 lines

Fix warnings:
- drop kernel-doc for the two debug functions to avoid the warnings
- delete unused code

v2:
- Updated subject (Lee)

Cc Thomas Zimemrmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Saeed Mirzamohammadi <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/cirrusfb.c | 20 +++++++++-----------
  1 file changed, 9 insertions(+), 11 deletions(-)
drivers/video/fbdev/cirrusfb.c +0 -2
index e9027172c0f5..93802abbbc72 100644
@@ -2463,8 +2463,6 @@ static void AttrOn(const struct cirrusfb_info *cinfo)
   */
  static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
  {
-	unsigned char dummy;
-
  	if (is_laguna(cinfo))
  		return;
  	if (cinfo->btype == BT_PICASSO) {

drivers/video/fbdev/cirrusfb.c static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val) · line 2474

Quoted 5 lines
drivers/video/fbdev/cirrusfb.c +1 -1
@@ -2473,18 +2471,18 @@ static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
  		WGen(cinfo, VGA_PEL_MSK, 0x00);
  		udelay(200);
  		/* next read dummy from pixel address (3c8) */
-		dummy = RGen(cinfo, VGA_PEL_IW);
+		RGen(cinfo, VGA_PEL_IW);

I hope these kinds of changes do not turn into an endless stream of warnings from static ananlysis. I git an email with that today about such a call.

Quoted 49 lines
drivers/video/fbdev/cirrusfb.c +8 -8
  		udelay(200);
  	}
  	/* now do the usual stuff to access the HDR */
 
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
  	udelay(200);
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
  	udelay(200);
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
  	udelay(200);
-	dummy = RGen(cinfo, VGA_PEL_MSK);
+	RGen(cinfo, VGA_PEL_MSK);
  	udelay(200);
 
  	WGen(cinfo, VGA_PEL_MSK, val);
@@ -2492,7 +2490,7 @@ static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
 
  	if (cinfo->btype == BT_PICASSO) {
  		/* now first reset HDR access counter */
-		dummy = RGen(cinfo, VGA_PEL_IW);
+		RGen(cinfo, VGA_PEL_IW);
  		udelay(200);
 
  		/* and at the end, restore the mask value */
@@ -2800,9 +2798,9 @@ static void bestclock(long freq, int *nom, int *den, int *div)
 
  #ifdef CIRRUSFB_DEBUG
 
-/**
+/*
   * cirrusfb_dbg_print_regs
- * @base: If using newmmio, the newmmio base address, otherwise %NULL
+ * @regbase: If using newmmio, the newmmio base address, otherwise %NULL
   * @reg_class: type of registers to read: %CRT, or %SEQ
   *
   * DESCRIPTION:
@@ -2847,7 +2845,7 @@ static void cirrusfb_dbg_print_regs(struct fb_info *info,
  	va_end(list);
  }
 
-/**
+/*
   * cirrusfb_dbg_reg_dump
   * @base: If using newmmio, the newmmio base address, otherwise %NULL
   *
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#73 lore raw

Re: [PATCH v2 27/28] video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings

Hi Thomas.

Quoted 37 lines · Thomas Zimmermann

Hi

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 34 lines

Fix warnings:
- drop kernel-doc for the two debug functions to avoid the warnings
- delete unused code

v2:
- Updated subject (Lee)

Cc Thomas Zimemrmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Saeed Mirzamohammadi <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/cirrusfb.c | 20 +++++++++-----------
  1 file changed, 9 insertions(+), 11 deletions(-)
drivers/video/fbdev/cirrusfb.c +0 -2
index e9027172c0f5..93802abbbc72 100644
@@ -2463,8 +2463,6 @@ static void AttrOn(const struct cirrusfb_info *cinfo)
   */
  static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
  {
-	unsigned char dummy;
-
  	if (is_laguna(cinfo))
  		return;
  	if (cinfo->btype == BT_PICASSO) {
@@ -2473,18 +2471,18 @@ static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
Quoted 8 lines

drivers/video/fbdev/cirrusfb.c static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val) · line 2474

Quoted 5 lines
drivers/video/fbdev/cirrusfb.c +1 -1
  		WGen(cinfo, VGA_PEL_MSK, 0x00);
  		udelay(200);
  		/* next read dummy from pixel address (3c8) */
-		dummy = RGen(cinfo, VGA_PEL_IW);
+		RGen(cinfo, VGA_PEL_IW);

I hope these kinds of changes do not turn into an endless stream of warnings from static ananlysis. I git an email with that today about such a call.

Got the same mail, will type a patch for it.

Quoted 2 lines

This and the other acked patches are now applied to drm-misc-next. Building for a few more architectures turned up new warnings, so I will prepare a new set of patches with comments addressed.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#74 lore raw

PATCH v2 28/28 video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

In reply to Sam Ravnborg

Fix following W=1 warnings:
- Fix set but not nused variables which was used only for logging. Fixed by introducing no_printk() to trick compiler to think variables are used
- Fix kernel-doc warning by deleting an empty comment line

v2:
- Subject updated (Lee)

Cc Kristoffer Ericson <[email protected]>
Cc Lee Jones <[email protected]>
---
 drivers/video/fbdev/s1d13xxxfb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/fbdev/s1d13xxxfb.c +1 -2
index 4541afcf9386..d1b5f965bc96 100644
@@ -45,7 +45,7 @@
 #if 0
 #define dbg(fmt, args...) do { printk(KERN_INFO fmt, ## args); } while(0)
 #else
-#define dbg(fmt, args...) do { } while (0)
+#define dbg(fmt, args...) do { no_printk(KERN_INFO fmt, ## args); } while (0)
 #endif
 
 /*
@@ -512,7 +512,6 @@ s1d13xxxfb_bitblt_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 }
 
 /**
- *
  *	s1d13xxxfb_bitblt_solidfill - accelerated solidfill function
  *	@info : framebuffer structure
  *	@rect : fb_fillrect structure
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v2 28/28
#75 lore raw

Re: [PATCH v2 28/28] video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 2 lines

Fix following W=1 warnings:
- Fix set but not nused variables which was used only for logging.

s/nused/used

s/which was/that were

Otherwise

Quoted 36 lines

Fixed by introducing no_printk() to trick compiler to think variables are used
- Fix kernel-doc warning by deleting an empty comment line

v2:
- Subject updated (Lee)

Cc Kristoffer Ericson <[email protected]>
Cc Lee Jones <[email protected]>
---
  drivers/video/fbdev/s1d13xxxfb.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/fbdev/s1d13xxxfb.c +1 -2
index 4541afcf9386..d1b5f965bc96 100644
@@ -45,7 +45,7 @@
  #if 0
  #define dbg(fmt, args...) do { printk(KERN_INFO fmt, ## args); } while(0)
  #else
-#define dbg(fmt, args...) do { } while (0)
+#define dbg(fmt, args...) do { no_printk(KERN_INFO fmt, ## args); } while (0)
  #endif
 
  /*
@@ -512,7 +512,6 @@ s1d13xxxfb_bitblt_copyarea(struct fb_info *info, const struct fb_copyarea *area)
  }
 
  /**
- *
   *	s1d13xxxfb_bitblt_solidfill - accelerated solidfill function
   *	@info : framebuffer structure
   *	@rect : fb_fillrect structure
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#76 lore raw

Re: [PATCH v2 28/28] video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

Hi Thomas.

Quoted 6 lines · Thomas Zimmermann

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 2 lines

Fix following W=1 warnings:
- Fix set but not nused variables which was used only for logging.

Quoted 7 lines

s/nused/used

s/which was/that were

Otherwise

Fixed and applied to drm-misc-next.

Thanks for the a-b's and r-b. Are you up to take a look at the remaining 24 patches? It is all simple patches so should be doable in limited time.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#77 lore raw

Re: [PATCH v2 28/28] video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

Hi Sam

Am 29.11.20 um 22:52 schrieb Sam Ravnborg:

Quoted 13 lines

Hi Thomas.

Quoted 10 lines · Thomas Zimmermann

Am 28.11.20 um 23:41 schrieb Sam Ravnborg:

Quoted 2 lines

Fix following W=1 warnings:
- Fix set but not nused variables which was used only for logging.

s/nused/used

s/which was/that were

Quoted 8 lines
Quoted 3 lines

Otherwise

Fixed and applied to drm-misc-next.

Thanks for the a-b's and r-b. Are you up to take a look at the remaining 24 patches? It is all simple patches so should be doable in limited time.

I think I had a question on one or two of them. If I forgot a patch, just put it into the next iteration and I'll take a look.

Best regards
Thomas

Quoted 7 lines

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel