diff mbox series

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

Message ID 20201128224114.1033617-19-sam@ravnborg.org
State New
Headers show
Series drivers/video: W=1 warning fixes | expand

Commit Message

Sam Ravnborg Nov. 28, 2020, 10:41 p.m. UTC
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)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Xiaofei Tan <tanxiaofei@huawei.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Lee Jones <lee.jones@linaro.org>
---
 drivers/video/fbdev/mx3fb.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Thomas Zimmermann Nov. 30, 2020, 1:22 p.m. UTC | #1
Am 28.11.20 um 23:41 schrieb 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)
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Xiaofei Tan <tanxiaofei@huawei.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Lee Jones <lee.jones@linaro.org>

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/mx3fb.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
> index 894617ddabcb..fabb271337ed 100644
> --- a/drivers/video/fbdev/mx3fb.c
> +++ b/drivers/video/fbdev/mx3fb.c
> @@ -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,
>
diff mbox series

Patch

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 894617ddabcb..fabb271337ed 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -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,