mbox series

[v3,0/13] drivers/video: W=1 warning fixes

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

Message

Sam Ravnborg Dec. 6, 2020, 7:02 p.m. UTC
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

Build tested on a set of architectures with various configs.

The patches do not depend on each other and fixes for one driver
are kept in a single patch.

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

v3:
  - Applied patches that was acked - thanks Thomas!
  - Updated patches after feedback from Randy and Thomas
  - Added several new patches to cover warnings that triggers
    with other architectures than the one I used for v1 + v2
  - Included one sh specific fix that handle a corner-case,
    let's see what the sh people say to that
  - One fix to previous set of patches to fix an issue
    reported by Coverity (By Colin)

	Sam

Sam Ravnborg (13):
      video: fbdev: hgafb: Fix kernel-doc warnings
      video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify
      video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core
      video: fbdev: uvesafb: Fix set but not used warning
      sh: Fix set but not used warnings with !CONFIG_MMU
      video: fbdev: sparc drivers: fix kernel-doc warnings for blank_mode
      video: fbdev: mmp: Fix kernel-doc warning for lcd_spi_write
      video: fbdev: wmt_ge_rops: Fix function not declared warnings
      video: fbdev: goldfishfb: Fix defined but not used warning
      video: fbdev: gbefb: Fix set but not used warning
      video: fbdev: efifb: Fix set but not used warning for screen_pitch
      video: fbdev: controlfb: Fix set but not used warnings
      video: fbdev: sis: Drop useless call to SiS_GetResInfo()


 arch/sh/include/asm/io.h                          |  2 +-
 drivers/video/fbdev/bw2.c                         |  2 +-
 drivers/video/fbdev/cg3.c                         |  2 +-
 drivers/video/fbdev/cg6.c                         |  2 +-
 drivers/video/fbdev/controlfb.c                   |  4 ++--
 drivers/video/fbdev/core/fb_notify.c              | 10 ++++++++++
 drivers/video/fbdev/core/fbmon.c                  |  2 +-
 drivers/video/fbdev/efifb.c                       |  3 +--
 drivers/video/fbdev/ffb.c                         |  2 +-
 drivers/video/fbdev/gbefb.c                       |  4 +---
 drivers/video/fbdev/goldfishfb.c                  |  2 ++
 drivers/video/fbdev/hgafb.c                       | 10 +++++-----
 drivers/video/fbdev/leo.c                         |  2 +-
 drivers/video/fbdev/mmp/hw/mmp_spi.c              |  2 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c |  4 ++--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c |  4 ++--
 drivers/video/fbdev/p9100.c                       |  2 +-
 drivers/video/fbdev/sis/init.c                    |  1 -
 drivers/video/fbdev/tcx.c                         |  2 +-
 drivers/video/fbdev/uvesafb.c                     |  2 ++
 drivers/video/fbdev/wmt_ge_rops.c                 |  1 +
 21 files changed, 38 insertions(+), 27 deletions(-)

Comments

Randy Dunlap Dec. 6, 2020, 7:34 p.m. UTC | #1
On 12/6/20 11:02 AM, Sam Ravnborg wrote:
> Fix kernel-doc comments.
> 
> v2:
>   - Updated subject (Lee)
> 
> v3:
>   - Add space after ':' (Randy)
>   - Fix name of function in comment
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
> Cc: linux-nvidia@lists.surfsouth.com
> Cc: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/video/fbdev/hgafb.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
> index a45fcff1461f..8bbac7182ad3 100644
> --- a/drivers/video/fbdev/hgafb.c
> +++ b/drivers/video/fbdev/hgafb.c
> @@ -357,8 +357,8 @@ 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.
> + *	@info: pointer to fb_info object containing info for current hga board
> + *	@init: open by console system or userland.
>   */
>  
>  static int hgafb_open(struct fb_info *info, int init)
> @@ -370,9 +370,9 @@ 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.
> + *	hgafb_release - open the framebuffer device
> + *	@info: pointer to fb_info object containing info for current hga board
> + *	@init: open by console system or userland.
>   */
>  
>  static int hgafb_release(struct fb_info *info, int init)
> 

LGTM. Thanks.

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Thomas Zimmermann Dec. 7, 2020, 8:17 a.m. UTC | #2
Am 06.12.20 um 20:02 schrieb Sam Ravnborg:
> Fix a few W=1 warnings about unused assignments.
> Drop the unused error code.
> 
> v2:
>    - Subject updated (Lee)
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Qilong Zhang <zhangqilong3@huawei.com>
> Cc: "Alexander A. Klimov" <grandmaster@al2klimov.de>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Lee Jones <lee.jones@linaro.org>

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

> ---
>   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(-)
> 
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
> index 726c190862d4..e6363a420933 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
> @@ -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;
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
> index eda29d3032e1..cb63bc0e92ca 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
> @@ -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;
>   
>
Thomas Zimmermann Dec. 7, 2020, 1:48 p.m. UTC | #3
Am 06.12.20 um 20:02 schrieb Sam Ravnborg:
> Add missing parameter and drop parameter that is not present
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

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

> ---
>   drivers/video/fbdev/mmp/hw/mmp_spi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/mmp/hw/mmp_spi.c b/drivers/video/fbdev/mmp/hw/mmp_spi.c
> index 1911a47769b6..16401eb95c6c 100644
> --- a/drivers/video/fbdev/mmp/hw/mmp_spi.c
> +++ b/drivers/video/fbdev/mmp/hw/mmp_spi.c
> @@ -17,8 +17,8 @@
>   
>   /**
>    * spi_write - write command to the SPI port
> + * @spi:  the SPI device.
>    * @data: can be 8/16/32-bit, MSB justified data to write.
> - * @len:  data length.
>    *
>    * Wait bus transfer complete IRQ.
>    * The caller is expected to perform the necessary locking.
>
Thomas Zimmermann Dec. 7, 2020, 1:49 p.m. UTC | #4
Am 06.12.20 um 20:02 schrieb Sam Ravnborg:
> The goldfish_fb_acpi_match table is only used with ACPI enabled.
> Ifdef it out unless it is needed.
> This is a similar fix to what other acpi drivers do.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>

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

> ---
>   drivers/video/fbdev/goldfishfb.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
> index 9c83ec3f8e1f..2b885cd046fe 100644
> --- a/drivers/video/fbdev/goldfishfb.c
> +++ b/drivers/video/fbdev/goldfishfb.c
> @@ -305,11 +305,13 @@ static const struct of_device_id goldfish_fb_of_match[] = {
>   };
>   MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
>   
> +#ifdef CONFIG_ACPI
>   static const struct acpi_device_id goldfish_fb_acpi_match[] = {
>   	{ "GFSH0004", 0 },
>   	{ },
>   };
>   MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match);
> +#endif
>   
>   static struct platform_driver goldfish_fb_driver = {
>   	.probe		= goldfish_fb_probe,
>
Thomas Zimmermann Dec. 7, 2020, 1:53 p.m. UTC | #5
Am 06.12.20 um 20:02 schrieb Sam Ravnborg:
> Coverity reported:
> 
>      Useless call (USELESS_CALL) side_effect_free: Calling
>       SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex) is only useful for its
>      return value, which is ignored.
> 
> And this is correct - so drop the call.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Reported-by: Colin Ian King <colin.king@canonical.com>
> Addresses-Coverity: ("Useless call")
> Cc: Colin Ian King <colin.king@canonical.com>
> Cc: Thomas Winischhofer <thomas@winischhofer.net>

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

> ---
>   drivers/video/fbdev/sis/init.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
> index b77ea1a8825a..b568c646a76c 100644
> --- a/drivers/video/fbdev/sis/init.c
> +++ b/drivers/video/fbdev/sis/init.c
> @@ -2659,7 +2659,6 @@ SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
>      if(SiS_Pr->UseCustomMode) {
>         infoflag = SiS_Pr->CInfoFlag;
>      } else {
> -      SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
>         if(ModeNo > 0x13) {
>   	 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
>         }
>
Sam Ravnborg Dec. 8, 2020, 6:02 p.m. UTC | #6
On Sun, Dec 06, 2020 at 08:02:34PM +0100, Sam Ravnborg wrote:
> 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
> 
> Build tested on a set of architectures with various configs.
> 
> The patches do not depend on each other and fixes for one driver
> are kept in a single patch.
> 
> 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
> 
> v3:
>   - Applied patches that was acked - thanks Thomas!
>   - Updated patches after feedback from Randy and Thomas
>   - Added several new patches to cover warnings that triggers
>     with other architectures than the one I used for v1 + v2
>   - Included one sh specific fix that handle a corner-case,
>     let's see what the sh people say to that
>   - One fix to previous set of patches to fix an issue
>     reported by Coverity (By Colin)
> 
> 	Sam
> 
> Sam Ravnborg (13):
>       video: fbdev: hgafb: Fix kernel-doc warnings
>       video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify
>       video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core
>       video: fbdev: uvesafb: Fix set but not used warning
>       sh: Fix set but not used warnings with !CONFIG_MMU
>       video: fbdev: sparc drivers: fix kernel-doc warnings for blank_mode
>       video: fbdev: mmp: Fix kernel-doc warning for lcd_spi_write
>       video: fbdev: wmt_ge_rops: Fix function not declared warnings
>       video: fbdev: goldfishfb: Fix defined but not used warning
>       video: fbdev: gbefb: Fix set but not used warning
>       video: fbdev: efifb: Fix set but not used warning for screen_pitch
>       video: fbdev: controlfb: Fix set but not used warnings
>       video: fbdev: sis: Drop useless call to SiS_GetResInfo()

Thanks for the feedback!
All applied to drm-misc-next except the sh patch.

The sh patch will be resend to the sh people as it should go in via the
sh tree.

	Sam