Skip to contentSkip to conversation

drm: Fix a bunch of sparse warnings

PATCH Applied [email protected] 9 participants 25 messages Sep 19, 2016 – Sep 22, 2016

Subsystems (14)
lore
Share & tools
lore
#0 lore raw

cover drm: Fix a bunch of sparse warnings

From: Ville Syrjälä <[email protected]>

I got a bit fed up from the sparse noise during a full build, so I tried to shut some of it up. Mostly missing statics or function declarations.

I didn't touch the main offender (radeon/amdgpu) since there was enough of this stuff in the other drivers as well. Nouveau was pretty bad too, but it was spread around mode so I didn't realize how much there was until I was already half way through. If I had, I probably wouldn't have bothered. There's still a bunch of warnings left in many of the drivers (__mmio type of stuff is probably responsible for most of it).

Entire series avaialable here:
git://github.com/vsyrjala/linux.git drm_sparse_warn

Ville Syrjälä (14):
drm/atomic-helper: Fix sparse warnings
drm/blend: Fix sparse warnings
drm/fb-helper: Fix sparse warnings
drm/arm: Fix sparse warnings
drm/ast: Fix sparse warnings
drm/bochs: Fix sparse warnings
drm/cirrus: Fix sparse warnings
drm/mgag200: Fix sparse warnings
drm/msm: Fix sparse warnings
drm/nouveau: Fix sparse warnings
drm/rockchip: Fix sparse warnings
drm/sti: Fix sparse warnings
drm/sun4i: Fix sparse warnings
drm/tilcdc: Fix sparse warnings

 drivers/gpu/drm/arm/malidp_planes.c                |  6 ++--
 drivers/gpu/drm/ast/ast_drv.c                      |  2 +-
 drivers/gpu/drm/ast/ast_ttm.c                      |  2 +-
 drivers/gpu/drm/bochs/bochs_kms.c                  |  2 +-
 drivers/gpu/drm/bochs/bochs_mm.c                   |  2 +-
 drivers/gpu/drm/cirrus/cirrus_drv.c                |  2 +-
 drivers/gpu/drm/cirrus/cirrus_ttm.c                |  2 +-
 drivers/gpu/drm/drm_atomic_helper.c                |  2 +-
 drivers/gpu/drm/drm_blend.c                        |  2 +-
 drivers/gpu/drm/drm_crtc_helper_internal.h         |  7 ++++
 drivers/gpu/drm/drm_fb_helper.c                    |  2 ++
 drivers/gpu/drm/mgag200/mgag200_drv.c              |  2 +-
 drivers/gpu/drm/mgag200/mgag200_ttm.c              |  2 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c   |  2 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c          |  2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c            | 12 +++----
 drivers/gpu/drm/msm/msm_fb.c                       |  2 +-
 drivers/gpu/drm/nouveau/dispnv04/overlay.c         |  2 +-
 drivers/gpu/drm/nouveau/nouveau_connector.c        |  2 +-
 drivers/gpu/drm/nouveau/nouveau_display.c          |  2 +-
 drivers/gpu/drm/nouveau/nv10_fence.c               |  2 +-
 drivers/gpu/drm/nouveau/nvif/client.c              |  2 +-
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c       |  1 +
 drivers/gpu/drm/nouveau/nvkm/engine/device/user.c  |  2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/channv50.c    |  8 ++---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/coreg94.c |  2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/coregp104.c   |  2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c  |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c |  4 +--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c  |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c  |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c   |  1 +
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c     |  4 +--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c     |  4 +--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c     |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c      |  4 +--
 drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c     |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c     |  4 +--
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c  |  8 ++---
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c     |  1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c     |  1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c   |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c      |  2 +-
 .../gpu/drm/nouveau/nvkm/subdev/iccsense/base.c    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c |  4 +--
 drivers/gpu/drm/nouveau/nvkm/subdev/mc/g84.c       |  2 +-
 .../gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c   |  4 +--
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c   |  4 +--
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c    |  1 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c        |  4 +--
 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c      |  1 +
 drivers/gpu/drm/sti/sti_compositor.c               |  4 +--
 drivers/gpu/drm/sti/sti_cursor.c                   |  2 +-
 drivers/gpu/drm/sti/sti_drv.c                      |  2 +-
 drivers/gpu/drm/sti/sti_dvo.c                      |  3 +-
 drivers/gpu/drm/sti/sti_gdp.c                      |  6 ++--
 drivers/gpu/drm/sti/sti_hqvdp.c                    |  7 ++--
 drivers/gpu/drm/sti/sti_mixer.c                    |  2 +-
 drivers/gpu/drm/sti/sti_tvout.c                    |  1 +
 drivers/gpu/drm/sti/sti_vtac.c                     |  2 ++
 drivers/gpu/drm/sti/sti_vtg.c                      |  3 +-
 drivers/gpu/drm/sun4i/sun4i_tv.c                   | 38 +++++++++++-----------
 drivers/gpu/drm/tilcdc/tilcdc_drv.c                |  4 +--
 drivers/gpu/drm/tilcdc/tilcdc_panel.c              |  3 +-
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c             |  3 +-
 include/drm/drm_fb_helper.h                        |  5 ---
 69 files changed, 127 insertions(+), 109 deletions(-)
Signature · 6 lines
2.7.4

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

PATCH 1/14 drm/atomic-helper: Fix sparse warnings

From: Ville Syrjälä <[email protected]>

drm/drm_atomic_helper.c:1696:6: warning: symbol 'plane_crtc_active' was not declared. Should it be static?

---
 drivers/gpu/drm/drm_atomic_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_helper.c +1 -1
index ea78d70de9f3..c3f83476f996 100644
@@ -1693,7 +1693,7 @@ fail:
 }
 EXPORT_SYMBOL(drm_atomic_helper_prepare_planes);
 
-bool plane_crtc_active(struct drm_plane_state *state)
+static bool plane_crtc_active(const struct drm_plane_state *state)
 {
 	return state->crtc && state->crtc->state->active;
 }
Signature · 6 lines
2.7.4

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

PATCH 2/14 drm/blend: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/drm_blend.c:207:5: warning: symbol 'drm_atomic_normalize_zpos' was not declared. Should it be static?

Cc Marek Szyprowski <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_blend.c +1 -1
index 0813b7e021be..0a0b9357db35 100644
@@ -30,7 +30,7 @@
 #include <linux/slab.h>
 #include <linux/sort.h>
 
-#include "drm_internal.h"
+#include "drm_crtc_internal.h"
 
 /**
  * drm_plane_create_zpos_property - create mutable zpos property
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 2/14
#3 lore raw

Re: [PATCH 02/14] drm/blend: Fix sparse warnings

Hi Ville,

Thank you for the patch.

Quoted 9 lines · On Monday 19 Sep 2016 16:33:43 [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/drm_blend.c:207:5: warning: symbol 'drm_atomic_normalize_zpos' was not declared. Should it be static?

Cc Marek Szyprowski <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Laurent Pinchart <[email protected]>
Quoted 17 lines
---
 drivers/gpu/drm/drm_blend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_blend.c +1 -1
index 0813b7e021be..0a0b9357db35 100644
@@ -30,7 +30,7 @@
 #include <linux/slab.h>
 #include <linux/sort.h>
 
-#include "drm_internal.h"
+#include "drm_crtc_internal.h"
 
 /**
  * drm_plane_create_zpos_property - create mutable zpos property
Signature · 8 lines
Regards,

Laurent Pinchart

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

PATCH 3/14 drm/fb-helper: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/drm_fb_helper.c:2306:12: warning: symbol 'drm_fb_helper_modinit' was not declared. Should it be static?

While at it, move the lefover static inline to the right place.

Cc Daniel Vetter <[email protected]>
Cc Sean Paul <[email protected]>
---
 drivers/gpu/drm/drm_crtc_helper_internal.h | 7 +++++++
 drivers/gpu/drm/drm_fb_helper.c            | 2 ++
 include/drm/drm_fb_helper.h                | 5 -----
 3 files changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_crtc_helper_internal.h +7 -0
index 4e6b57ae7188..28295e5d0d9e 100644
@@ -29,7 +29,14 @@
 #include <drm/drm_dp_helper.h>
 
 /* drm_fb_helper.c */
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 int drm_fb_helper_modinit(void);
+#else
+static inline int drm_fb_helper_modinit(void)
+{
+	return 0;
+}
+#endif
 
 /* drm_dp_aux_dev.c */
 #ifdef CONFIG_DRM_DP_AUX_CHARDEV
drivers/gpu/drm/drm_fb_helper.c +2 -0
index dd8e3b68fd53..03414bde1f15 100644
@@ -41,6 +41,8 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 
+#include "drm_crtc_helper_internal.h"
+
 static bool drm_fbdev_emulation = true;
 module_param_named(fbdev_emulation, drm_fbdev_emulation, bool, 0600);
 MODULE_PARM_DESC(fbdev_emulation,
include/drm/drm_fb_helper.h +0 -5
index 797fb5f80c45..e19458dd1a43 100644
@@ -287,11 +287,6 @@ int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_
 int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
 				       struct drm_connector *connector);
 #else
-static inline int drm_fb_helper_modinit(void)
-{
-	return 0;
-}
-
 static inline void drm_fb_helper_prepare(struct drm_device *dev,
 					struct drm_fb_helper *helper,
 					const struct drm_fb_helper_funcs *funcs)
Signature · 6 lines
2.7.4

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

Re: [PATCH 03/14] drm/fb-helper: Fix sparse warnings

Quoted 9 lines · On Mon, Sep 19, 2016 at 04:33:44PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/drm_fb_helper.c:2306:12: warning: symbol 'drm_fb_helper_modinit' was not declared. Should it be static?

While at it, move the lefover static inline to the right place.

Cc Daniel Vetter <[email protected]>
Cc Sean Paul <[email protected]>

Merged the first 3 core patches to drm-misc. For the others a bit more soaking time for maintainers to ack them I guess.
-Daniel

Quoted 57 lines
---
 drivers/gpu/drm/drm_crtc_helper_internal.h | 7 +++++++
 drivers/gpu/drm/drm_fb_helper.c            | 2 ++
 include/drm/drm_fb_helper.h                | 5 -----
 3 files changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_crtc_helper_internal.h +7 -0
index 4e6b57ae7188..28295e5d0d9e 100644
@@ -29,7 +29,14 @@
 #include <drm/drm_dp_helper.h>
 
 /* drm_fb_helper.c */
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 int drm_fb_helper_modinit(void);
+#else
+static inline int drm_fb_helper_modinit(void)
+{
+	return 0;
+}
+#endif
 
 /* drm_dp_aux_dev.c */
 #ifdef CONFIG_DRM_DP_AUX_CHARDEV
drivers/gpu/drm/drm_fb_helper.c +2 -0
index dd8e3b68fd53..03414bde1f15 100644
@@ -41,6 +41,8 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 
+#include "drm_crtc_helper_internal.h"
+
 static bool drm_fbdev_emulation = true;
 module_param_named(fbdev_emulation, drm_fbdev_emulation, bool, 0600);
 MODULE_PARM_DESC(fbdev_emulation,
include/drm/drm_fb_helper.h +0 -5
index 797fb5f80c45..e19458dd1a43 100644
@@ -287,11 +287,6 @@ int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_
 int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
 				       struct drm_connector *connector);
 #else
-static inline int drm_fb_helper_modinit(void)
-{
-	return 0;
-}
-
 static inline void drm_fb_helper_prepare(struct drm_device *dev,
 					struct drm_fb_helper *helper,
 					const struct drm_fb_helper_funcs *funcs)
Signature · 1 line
2.7.4
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
#6 lore raw

PATCH 4/14 drm/arm: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/arm/malidp_planes.c:49:24: warning: symbol 'malidp_duplicate_plane_state' was not declared. Should it be static? drm/arm/malidp_planes.c:66:6: warning: symbol 'malidp_destroy_plane_state' was not declared. Should it be static?

Cc Liviu Dudau <[email protected]>
Cc Brian Starkey <[email protected]>
Cc Mali DP Maintainers <[email protected]>
---
 drivers/gpu/drm/arm/malidp_planes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/malidp_planes.c +3 -3
index 82c193e5e0d6..cc9b8e02904d 100644
@@ -46,7 +46,7 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
 	devm_kfree(plane->dev->dev, mp);
 }
 
-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
 	struct malidp_plane_state *state, *m_state;
 
@@ -63,8 +63,8 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 	return &state->base;
 }
 
-void malidp_destroy_plane_state(struct drm_plane *plane,
-				struct drm_plane_state *state)
+static void malidp_destroy_plane_state(struct drm_plane *plane,
+				       struct drm_plane_state *state)
 {
 	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
 
Signature · 6 lines
2.7.4

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

Re: [PATCH 04/14] drm/arm: Fix sparse warnings

Quoted 6 lines · On Mon, Sep 19, 2016 at 04:33:45PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/arm/malidp_planes.c:49:24: warning: symbol 'malidp_duplicate_plane_state' was not declared. Should it be static? drm/arm/malidp_planes.c:66:6: warning: symbol 'malidp_destroy_plane_state' was not declared. Should it be static?

Cc Liviu Dudau <[email protected]>

Thanks for cleaning it up!

Liviu

Quoted 34 lines
Cc Brian Starkey <[email protected]>
Cc Mali DP Maintainers <[email protected]>
---
 drivers/gpu/drm/arm/malidp_planes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/malidp_planes.c +3 -3
index 82c193e5e0d6..cc9b8e02904d 100644
@@ -46,7 +46,7 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
 	devm_kfree(plane->dev->dev, mp);
 }
 
-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
 	struct malidp_plane_state *state, *m_state;
 
@@ -63,8 +63,8 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 	return &state->base;
 }
 
-void malidp_destroy_plane_state(struct drm_plane *plane,
-				struct drm_plane_state *state)
+static void malidp_destroy_plane_state(struct drm_plane *plane,
+				       struct drm_plane_state *state)
 {
 	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
 
Signature · 1 line
2.7.4
Signature · 12 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#8 lore raw

Re: [PATCH 04/14] drm/arm: Fix sparse warnings

Quoted 8 lines · Liviu Dudau
Quoted 6 lines · On Mon, Sep 19, 2016 at 04:33:45PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/arm/malidp_planes.c:49:24: warning: symbol 'malidp_duplicate_plane_state' was not declared. Should it be static? drm/arm/malidp_planes.c:66:6: warning: symbol 'malidp_destroy_plane_state' was not declared. Should it be static?

Cc Liviu Dudau <[email protected]>

BTW, I have already acked this patch when Baoyou Xie submitted it!

https://lists.freedesktop.org/archives/dri-devel/2016-September/117624.html

Maybe you should acknowledge his contribution if that was the case?

Best regards,
Liviu

Quoted 40 lines

Thanks for cleaning it up!

Liviu

Quoted 34 lines
Cc Brian Starkey <[email protected]>
Cc Mali DP Maintainers <[email protected]>
---
 drivers/gpu/drm/arm/malidp_planes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/malidp_planes.c +3 -3
index 82c193e5e0d6..cc9b8e02904d 100644
@@ -46,7 +46,7 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
 	devm_kfree(plane->dev->dev, mp);
 }
 
-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
 	struct malidp_plane_state *state, *m_state;
 
@@ -63,8 +63,8 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 	return &state->base;
 }
 
-void malidp_destroy_plane_state(struct drm_plane *plane,
-				struct drm_plane_state *state)
+static void malidp_destroy_plane_state(struct drm_plane *plane,
+				       struct drm_plane_state *state)
 {
 	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
 
Signature · 1 line
2.7.4
Signature · 12 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH 5/14 drm/ast: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/ast/ast_drv.c:36:5: warning: symbol 'ast_modeset' was not declared. Should it be static? drm/ast/ast_ttm.c:227:22: warning: symbol 'ast_bo_driver' was not declared. Should it be static?

---
 drivers/gpu/drm/ast/ast_drv.c | 2 +-
 drivers/gpu/drm/ast/ast_ttm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ast/ast_drv.c +1 -1
index f54afd2113a9..3d16d9f1f3ec 100644
@@ -33,7 +33,7 @@
 
 #include "ast_drv.h"
 
-int ast_modeset = -1;
+static int ast_modeset = -1;
 
 MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
 module_param_named(modeset, ast_modeset, int, 0400);
drivers/gpu/drm/ast/ast_ttm.c +1 -1
index b29a41218fc9..899ee7711f15 100644
@@ -224,7 +224,7 @@ static void ast_ttm_tt_unpopulate(struct ttm_tt *ttm)
 	ttm_pool_unpopulate(ttm);
 }
 
-struct ttm_bo_driver ast_bo_driver = {
+static struct ttm_bo_driver ast_bo_driver = {
 	.ttm_tt_create = ast_ttm_tt_create,
 	.ttm_tt_populate = ast_ttm_tt_populate,
 	.ttm_tt_unpopulate = ast_ttm_tt_unpopulate,
Signature · 6 lines
2.7.4

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

PATCH 6/14 drm/bochs: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/bochs/bochs_mm.c:196:22: warning: symbol 'bochs_bo_driver' was not declared. Should it be static? drm/bochs/bochs_kms.c:181:5: warning: symbol 'bochs_connector_get_modes' was not declared. Should it be static?

---
 drivers/gpu/drm/bochs/bochs_kms.c | 2 +-
 drivers/gpu/drm/bochs/bochs_mm.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bochs/bochs_kms.c +1 -1
index 207a2cbcc113..0b4e5d117043 100644
@@ -178,7 +178,7 @@ static void bochs_encoder_init(struct drm_device *dev)
 }
 
 
-int bochs_connector_get_modes(struct drm_connector *connector)
+static int bochs_connector_get_modes(struct drm_connector *connector)
 {
 	int count;
 
drivers/gpu/drm/bochs/bochs_mm.c +1 -1
index 5c5638a777a1..dafd764134e8 100644
@@ -193,7 +193,7 @@ static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev,
 	return tt;
 }
 
-struct ttm_bo_driver bochs_bo_driver = {
+static struct ttm_bo_driver bochs_bo_driver = {
 	.ttm_tt_create = bochs_ttm_tt_create,
 	.ttm_tt_populate = ttm_pool_populate,
 	.ttm_tt_unpopulate = ttm_pool_unpopulate,
Signature · 6 lines
2.7.4

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

PATCH 7/14 drm/cirrus: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/cirrus/cirrus_drv.c:18:5: warning: symbol 'cirrus_modeset' was not declared. Should it be static? drm/cirrus/cirrus_ttm.c:227:22: warning: symbol 'cirrus_bo_driver' was not declared. Should it be static?

---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 2 +-
 drivers/gpu/drm/cirrus/cirrus_ttm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/cirrus/cirrus_drv.c +1 -1
index 6c76d125995b..94928af5e7a4 100644
@@ -15,7 +15,7 @@
 
 #include "cirrus_drv.h"
 
-int cirrus_modeset = -1;
+static int cirrus_modeset = -1;
 int cirrus_bpp = 24;
 
 MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
drivers/gpu/drm/cirrus/cirrus_ttm.c +1 -1
index 1cc9ee607128..13c2303e1d3e 100644
@@ -224,7 +224,7 @@ static void cirrus_ttm_tt_unpopulate(struct ttm_tt *ttm)
 	ttm_pool_unpopulate(ttm);
 }
 
-struct ttm_bo_driver cirrus_bo_driver = {
+static struct ttm_bo_driver cirrus_bo_driver = {
 	.ttm_tt_create = cirrus_ttm_tt_create,
 	.ttm_tt_populate = cirrus_ttm_tt_populate,
 	.ttm_tt_unpopulate = cirrus_ttm_tt_unpopulate,
Signature · 6 lines
2.7.4

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

PATCH 8/14 drm/mgag200: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/mgag200/mgag200_drv.c:24:5: warning: symbol 'mgag200_modeset' was not declared. Should it be static? drm/mgag200/mgag200_ttm.c:227:22: warning: symbol 'mgag200_bo_driver' was not declared. Should it be static?

---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +-
 drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -1
index 1443b3a34775..9c02a22451d2 100644
@@ -21,7 +21,7 @@
  * which then performs further device association and calls our graphics init
  * functions
  */
-int mgag200_modeset = -1;
+static int mgag200_modeset = -1;
 
 MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
 module_param_named(modeset, mgag200_modeset, int, 0400);
drivers/gpu/drm/mgag200/mgag200_ttm.c +1 -1
index 68268e55d595..88604af23382 100644
@@ -224,7 +224,7 @@ static void mgag200_ttm_tt_unpopulate(struct ttm_tt *ttm)
 	ttm_pool_unpopulate(ttm);
 }
 
-struct ttm_bo_driver mgag200_bo_driver = {
+static struct ttm_bo_driver mgag200_bo_driver = {
 	.ttm_tt_create = mgag200_ttm_tt_create,
 	.ttm_tt_populate = mgag200_ttm_tt_populate,
 	.ttm_tt_unpopulate = mgag200_ttm_tt_unpopulate,
Signature · 6 lines
2.7.4

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

PATCH 9/14 drm/msm: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c:96:22: warning: symbol 'get_connector' was not declared. Should it be static? drm/msm/mdp/mdp4/mdp4_plane.c:84:5: warning: symbol 'mdp4_plane_set_property' was not declared. Should it be static? drm/msm/mdp/mdp5/mdp5_cfg.c:25:26: warning: symbol 'msm8x74v1_config' was not declared. Should it be static? drm/msm/mdp/mdp5/mdp5_cfg.c:95:26: warning: symbol 'msm8x74v2_config' was not declared. Should it be static? drm/msm/mdp/mdp5/mdp5_cfg.c:165:26: warning: symbol 'apq8084_config' was not declared. Should it be static? drm/msm/mdp/mdp5/mdp5_cfg.c:243:26: warning: symbol 'msm8x16_config' was not declared. Should it be static? drm/msm/mdp/mdp5/mdp5_cfg.c:304:26: warning: symbol 'msm8x94_config' was not declared. Should it be static? drm/msm/mdp/mdp5/mdp5_cfg.c:382:26: warning: symbol 'msm8x96_config' was not declared. Should it be static?

---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c |  2 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c        |  2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c          | 12 ++++++------
 drivers/gpu/drm/msm/msm_fb.c                     |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c +1 -1
index bc3d8e719c6c..a06b064f86c1 100644
@@ -93,7 +93,7 @@ static const struct drm_encoder_funcs mdp4_lcdc_encoder_funcs = {
 };
 
 /* this should probably be a helper: */
-struct drm_connector *get_connector(struct drm_encoder *encoder)
+static struct drm_connector *get_connector(struct drm_encoder *encoder)
 {
 	struct drm_device *dev = encoder->dev;
 	struct drm_connector *connector;
drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c +1 -1
index 7c9626d92019..3903dbcda763 100644
@@ -81,7 +81,7 @@ static void mdp4_plane_install_properties(struct drm_plane *plane,
 	// XXX
 }
 
-int mdp4_plane_set_property(struct drm_plane *plane,
+static int mdp4_plane_set_property(struct drm_plane *plane,
 		struct drm_property *property, uint64_t val)
 {
 	// XXX
drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c +6 -6
index ac9e4cde1380..94f9d1ad45b1 100644
@@ -22,7 +22,7 @@ struct mdp5_cfg_handler {
 /* mdp5_cfg must be exposed (used in mdp5.xml.h) */
 const struct mdp5_cfg_hw *mdp5_cfg = NULL;
 
-const struct mdp5_cfg_hw msm8x74v1_config = {
+static const struct mdp5_cfg_hw msm8x74v1_config = {
 	.name = "msm8x74v1",
 	.mdp = {
 		.count = 1,
@@ -92,7 +92,7 @@ const struct mdp5_cfg_hw msm8x74v1_config = {
 	.max_clk = 200000000,
 };
 
-const struct mdp5_cfg_hw msm8x74v2_config = {
+static const struct mdp5_cfg_hw msm8x74v2_config = {
 	.name = "msm8x74",
 	.mdp = {
 		.count = 1,
@@ -162,7 +162,7 @@ const struct mdp5_cfg_hw msm8x74v2_config = {
 	.max_clk = 200000000,
 };
 
-const struct mdp5_cfg_hw apq8084_config = {
+static const struct mdp5_cfg_hw apq8084_config = {
 	.name = "apq8084",
 	.mdp = {
 		.count = 1,
@@ -240,7 +240,7 @@ const struct mdp5_cfg_hw apq8084_config = {
 	.max_clk = 320000000,
 };
 
-const struct mdp5_cfg_hw msm8x16_config = {
+static const struct mdp5_cfg_hw msm8x16_config = {
 	.name = "msm8x16",
 	.mdp = {
 		.count = 1,
@@ -301,7 +301,7 @@ const struct mdp5_cfg_hw msm8x16_config = {
 	.max_clk = 320000000,
 };
 
-const struct mdp5_cfg_hw msm8x94_config = {
+static const struct mdp5_cfg_hw msm8x94_config = {
 	.name = "msm8x94",
 	.mdp = {
 		.count = 1,
@@ -379,7 +379,7 @@ const struct mdp5_cfg_hw msm8x94_config = {
 	.max_clk = 400000000,
 };
 
-const struct mdp5_cfg_hw msm8x96_config = {
+static const struct mdp5_cfg_hw msm8x96_config = {
 	.name = "msm8x96",
 	.mdp = {
 		.count = 1,
drivers/gpu/drm/msm/msm_fb.c +1 -1
index 95cf8fe72ee5..8c5b399f387e 100644
@@ -132,7 +132,7 @@ const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb)
 struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
 		struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd)
 {
-	struct drm_gem_object *bos[4] = {0};
+	struct drm_gem_object *bos[4] = {};
 	struct drm_framebuffer *fb;
 	int ret, i, n = drm_format_num_planes(mode_cmd->pixel_format);
 
Signature · 6 lines
2.7.4

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

Re: [PATCH 09/14] drm/msm: Fix sparse warnings

drivers/gpu/drm/msm/msm_fb.c const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb) · line 135

Quoted 8 lines · On 19 September 2016 at 14:33, <[email protected]> wrote:
drivers/gpu/drm/msm/msm_fb.c +1 -1
@@ -132,7 +132,7 @@ const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb)
 struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
                struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd)
 {
-       struct drm_gem_object *bos[4] = {0};
+       struct drm_gem_object *bos[4] = {};

Fwiw I was reminded using empty initializers isn't standard C [1].

Regards,
Emil

[1] http://stackoverflow.com/questions/17589533/is-an-empty-initializer-list-valid-c-code
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw

Re: [PATCH 09/14] drm/msm: Fix sparse warnings

Quoted 11 lines · Emil Velikov

drivers/gpu/drm/msm/msm_fb.c const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb) · line 135

Quoted 8 lines · On 19 September 2016 at 14:33, <[email protected]> wrote:
drivers/gpu/drm/msm/msm_fb.c +1 -1
@@ -132,7 +132,7 @@ const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb)
 struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
                struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd)
 {
-       struct drm_gem_object *bos[4] = {0};
+       struct drm_gem_object *bos[4] = {};

Fwiw I was reminded using empty initializers isn't standard C [1].

Well, meh, we're not doing -std=c11 -pedantic. Arguably {} is neater.

I guess the commit message lacks the sparse warning about using plain integer 0 as NULL pointer.

BR,
Jani.

Quoted 9 lines

Regards,
Emil

[1] http://stackoverflow.com/questions/17589533/is-an-empty-initializer-list-valid-c-code
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#16 lore raw

Re: [PATCH 09/14] drm/msm: Fix sparse warnings

Quoted 13 lines · Jani Nikula
Quoted 11 lines · Emil Velikov

drivers/gpu/drm/msm/msm_fb.c const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb) · line 135

Quoted 8 lines · On 19 September 2016 at 14:33, <[email protected]> wrote:
drivers/gpu/drm/msm/msm_fb.c +1 -1
@@ -132,7 +132,7 @@ const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb)
 struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
                struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd)
 {
-       struct drm_gem_object *bos[4] = {0};
+       struct drm_gem_object *bos[4] = {};

Fwiw I was reminded using empty initializers isn't standard C [1].

Quoted 5 lines

Well, meh, we're not doing -std=c11 -pedantic. Arguably {} is neater.

I guess the commit message lacks the sparse warning about using plain integer 0 as NULL pointer.

Ack. Just pointing it out for people, who weren't familiar. Fwiw this is one of the bigger bikesheding topics I've seen, esp. since different compiler (versions) produce warnings for each permutation :-\

Sparse shouldn't produce warning since the spec explicitly states that 0 should be 'good enough' for anyone ;-)

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

#17 lore raw

PATCH 10/14 drm/nouveau: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/nouveau/dispnv04/overlay.c:496:1: warning: symbol 'nouveau_overlay_init' was not declared. Should it be static? drm/nouveau/nouveau_connector.c:63:5: warning: symbol 'nouveau_hdmimhz' was not declared. Should it be static? drm/nouveau/nouveau_display.c:96:1: warning: symbol 'nouveau_display_scanoutpos_head' was not declared. Should it be static? drm/nouveau/nv10_fence.c:70:1: warning: symbol 'nv10_fence_context_new' was not declared. Should it be static? drm/nouveau/nvif/client.c:58:26: warning: symbol 'nvif_drivers' was not declared. Should it be static? drm/nouveau/nvkm/core/firmware.c:34:1: warning: symbol 'nvkm_firmware_get' was not declared. Should it be static? drm/nouveau/nvkm/core/firmware.c:58:1: warning: symbol 'nvkm_firmware_put' was not declared. Should it be static? drm/nouveau/nvkm/engine/device/user.c:330:1: warning: symbol 'nvkm_udevice_new' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/channv50.c:157:1: warning: symbol 'nv50_disp_chan_rd32' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/channv50.c:167:1: warning: symbol 'nv50_disp_chan_wr32' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/channv50.c:177:1: warning: symbol 'nv50_disp_chan_ntfy' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/channv50.c:193:1: warning: symbol 'nv50_disp_chan_map' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/coreg94.c:30:1: warning: symbol 'g94_disp_core_mthd_sor' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/coregp104.c:63:1: warning: symbol 'gp104_disp_core_func' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/rootnv50.c:70:1: warning: symbol 'nv50_disp_root_mthd_' was not declared. Should it be static? drm/nouveau/nvkm/engine/disp/sorg94.c:49:1: warning: symbol 'g94_sor_output_new' was not declared. Should it be static? drm/nouveau/nvkm/engine/fifo/chang84.c:133:1: warning: symbol 'g84_fifo_chan_engine_init' was not declared. Should it be static? drm/nouveau/nvkm/engine/fifo/chang84.c:174:1: warning: symbol 'g84_fifo_chan_object_ctor' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/ctxgf117.c:222:1: warning: symbol 'gf117_grctx_generate_main' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/ctxgm107.c:937:1: warning: symbol 'gm107_grctx_generate_tpcid' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/ctxnv50.c:255:1: warning: symbol 'nv50_grctx_fill' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/ctxnv50.c:265:1: warning: symbol 'nv50_grctx_init' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/gf100.c:1388:1: warning: symbol 'gf100_gr_init_fw' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/gf100.c:1705:1: warning: symbol 'gf100_gr_init_' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/gf117.c:106:1: warning: symbol 'gf117_gr_fecs_ucode' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/gf117.c:116:1: warning: symbol 'gf117_gr_gpccs_ucode' was not declared. Should it be static? drm/nouveau/nvkm/engine/gr/gm107.c:312:1: warning: symbol 'gm107_gr_init' was not declared. Should it be static? drm/nouveau/nvkm/engine/pm/base.c:703:1: warning: symbol 'nvkm_perfsrc_new' was not declared. Should it be static? drm/nouveau/nvkm/engine/pm/base.c:74:21: warning: symbol 'nvkm_perfsig_find' was not declared. Should it be static? drm/nouveau/nvkm/engine/pm/gf100.c:106:1: warning: symbol 'gf100_pm_part' was not declared. Should it be static? drm/nouveau/nvkm/subdev/bios/fan.c:29:1: warning: symbol 'nvbios_fan_table' was not declared. Should it be static? drm/nouveau/nvkm/subdev/bios/fan.c:56:1: warning: symbol 'nvbios_fan_entry' was not declared. Should it be static? drm/nouveau/nvkm/subdev/clk/gt215.c:184:1: warning: symbol 'gt215_clk_info' was not declared. Should it be static? drm/nouveau/nvkm/subdev/fb/ramgt215.c:153:1: warning: symbol 'gt215_link_train' was not declared. Should it be static? drm/nouveau/nvkm/subdev/fb/ramgt215.c:271:1: warning: symbol 'gt215_link_train_init' was not declared. Should it be static? drm/nouveau/nvkm/subdev/fb/ramgt215.c:337:1: warning: symbol 'gt215_link_train_fini' was not declared. Should it be static? drm/nouveau/nvkm/subdev/fb/ramgt215.c:99:1: warning: symbol 'gt215_link_train_calc' was not declared. Should it be static? drm/nouveau/nvkm/subdev/fb/sddr2.c:60:1: warning: symbol 'nvkm_sddr2_calc' was not declared. Should it be static? drm/nouveau/nvkm/subdev/fb/sddr3.c:69:1: warning: symbol 'nvkm_sddr3_calc' was not declared. Should it be static? drm/nouveau/nvkm/subdev/gpio/gk104.c:41:1: warning: symbol 'gk104_gpio_intr_mask' was not declared. Should it be static? drm/nouveau/nvkm/subdev/i2c/aux.c:78:1: warning: symbol 'nvkm_i2c_aux_i2c_algo' was not declared. Should it be static? drm/nouveau/nvkm/subdev/iccsense/base.c:332:25: warning: symbol 'iccsense_func' was not declared. Should it be static? drm/nouveau/nvkm/subdev/instmem/base.c:108:1: warning: symbol 'nvkm_instobj_func' was not declared. Should it be static? drm/nouveau/nvkm/subdev/instmem/base.c:160:1: warning: symbol 'nvkm_instobj_func_slow' was not declared. Should it be static? drm/nouveau/nvkm/subdev/mc/g84.c:38:1: warning: symbol 'g84_mc_intr' was not declared. Should it be static?
../drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c:1206:20: warning: Variable length array is used.
drm/nouveau/nvkm/subdev/secboot/gm200.c:1368:1: warning: symbol 'gm200_secboot_fini' was not declared. Should it be static?
../drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c:779:42: warning: Variable length array is used.
drm/nouveau/nvkm/subdev/volt/gk104.c:38:1: warning: symbol 'gk104_volt_get' was not declared. Should it be static? drm/nouveau/nvkm/subdev/volt/gk104.c:51:1: warning: symbol 'gk104_volt_set' was not declared. Should it be static? drm/nouveau/nvkm/subdev/volt/gm20b.c:28:23: warning: symbol 'gm20b_cvb_coef' was not declared. Should it be static? drm/nouveau/nvkm/subdev/volt/gm20b.c:61:11: warning: symbol 'speedo_to_vmin' was not declared. Should it be static? drm/nouveau/nvkm/subdev/volt/gpio.c:35:1: warning: symbol 'nvkm_voltgpio_get' was not declared. Should it be static? drm/nouveau/nvkm/subdev/volt/gpio.c:54:1: warning: symbol 'nvkm_voltgpio_set' was not declared. Should it be static? drm/nouveau/nvkm/subdev/volt/gpio.c:71:1: warning: symbol 'nvkm_voltgpio_init' was not declared. Should it be static?

---
 drivers/gpu/drm/nouveau/dispnv04/overlay.c           | 2 +-
 drivers/gpu/drm/nouveau/nouveau_connector.c          | 2 +-
 drivers/gpu/drm/nouveau/nouveau_display.c            | 2 +-
 drivers/gpu/drm/nouveau/nv10_fence.c                 | 2 +-
 drivers/gpu/drm/nouveau/nvif/client.c                | 2 +-
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c         | 1 +
 drivers/gpu/drm/nouveau/nvkm/engine/device/user.c    | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c  | 8 ++++----
 drivers/gpu/drm/nouveau/nvkm/engine/disp/coreg94.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/coregp104.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c  | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c    | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c   | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c    | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c    | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c     | 1 +
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c       | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c       | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c       | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c        | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c       | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c       | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c      | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c    | 8 ++++----
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c       | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c       | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c     | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c        | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c  | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c   | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/mc/g84.c         | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c  | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c     | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c     | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c      | 1 +
 35 files changed, 49 insertions(+), 44 deletions(-)
drivers/gpu/drm/nouveau/dispnv04/overlay.c +1 -1
index ec444eac6258..486401f6dab8 100644
@@ -27,6 +27,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_fourcc.h>
 
+#include "disp.h"
 #include "nouveau_drv.h"
 
 #include "nouveau_bo.h"
@@ -34,7 +35,6 @@
 #include "nouveau_display.h"
 #include "nvreg.h"
 
-
 struct nouveau_plane {
 	struct drm_plane base;
 	bool flip;
drivers/gpu/drm/nouveau/nouveau_connector.c +1 -1
index c1084088f9e4..61f3f67b5f09 100644
@@ -60,7 +60,7 @@ int nouveau_duallink = 1;
 module_param_named(duallink, nouveau_duallink, int, 0400);
 
 MODULE_PARM_DESC(hdmimhz, "Force a maximum HDMI pixel clock (in MHz)");
-int nouveau_hdmimhz = 0;
+static int nouveau_hdmimhz;
 module_param_named(hdmimhz, nouveau_hdmimhz, int, 0400);
 
 struct nouveau_encoder *
drivers/gpu/drm/nouveau/nouveau_display.c +1 -1
index afbf557b23d4..b60ee21f4571 100644
@@ -92,7 +92,7 @@ calc(int blanks, int blanke, int total, int line)
 	return line;
 }
 
-int
+static int
 nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
 				ktime_t *stime, ktime_t *etime)
 {
drivers/gpu/drm/nouveau/nv10_fence.c +1 -1
index 4e3de34ff6f4..619f79de5859 100644
@@ -66,7 +66,7 @@ nv10_fence_context_del(struct nouveau_channel *chan)
 	nouveau_fence_context_free(&fctx->base);
 }
 
-int
+static int
 nv10_fence_context_new(struct nouveau_channel *chan)
 {
 	struct nv10_fence_chan *fctx;
drivers/gpu/drm/nouveau/nvif/client.c +1 -1
index 1ee9294eca2e..29c20dfd894d 100644
@@ -55,7 +55,7 @@ nvif_client_fini(struct nvif_client *client)
 	}
 }
 
-const struct nvif_driver *
+static const struct nvif_driver *
 nvif_drivers[] = {
 #ifdef __KERNEL__
 	&nvif_driver_nvkm,
drivers/gpu/drm/nouveau/nvkm/core/firmware.c +1 -0
index 34ecd4a7e0c1..058ff46b5f16 100644
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <core/device.h>
+#include <core/firmware.h>
 
 /**
  * nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c +1 -1
index 79a8f71cf788..513ee6b79553 100644
@@ -326,7 +326,7 @@ nvkm_udevice = {
 	.sclass = nvkm_udevice_child_get,
 };
 
-int
+static int
 nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size,
 		 struct nvkm_object **pobject)
 {
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c +4 -4
index dd2953bc9264..26990d44ae75 100644
@@ -153,7 +153,7 @@ nv50_disp_chan_uevent = {
 	.fini = nv50_disp_chan_uevent_fini,
 };
 
-int
+static int
 nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data)
 {
 	struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -163,7 +163,7 @@ nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data)
 	return 0;
 }
 
-int
+static int
 nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, u32 data)
 {
 	struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -173,7 +173,7 @@ nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, u32 data)
 	return 0;
 }
 
-int
+static int
 nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
 		    struct nvkm_event **pevent)
 {
@@ -189,7 +189,7 @@ nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
 	return -EINVAL;
 }
 
-int
+static int
 nv50_disp_chan_map(struct nvkm_object *object, u64 *addr, u32 *size)
 {
 	struct nv50_disp_chan *chan = nv50_disp_chan(object);
drivers/gpu/drm/nouveau/nvkm/engine/disp/coreg94.c +1 -1
index 019379a3a01c..b94db5e68cab 100644
@@ -26,7 +26,7 @@
 
 #include <nvif/class.h>
 
-const struct nv50_disp_mthd_list
+static const struct nv50_disp_mthd_list
 g94_disp_core_mthd_sor = {
 	.mthd = 0x0040,
 	.addr = 0x000008,
drivers/gpu/drm/nouveau/nvkm/engine/disp/coregp104.c +1 -1
index 6922f4007b61..e356f87fbe60 100644
@@ -59,7 +59,7 @@ gp104_disp_core_init(struct nv50_disp_dmac *chan)
 	return 0;
 }
 
-const struct nv50_disp_dmac_func
+static const struct nv50_disp_dmac_func
 gp104_disp_core_func = {
 	.init = gp104_disp_core_init,
 	.fini = gf119_disp_core_fini,
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c +1 -1
index 2f9cecd81d04..6424b396dcde 100644
@@ -66,7 +66,7 @@ nv50_disp_root_scanoutpos(NV50_DISP_MTHD_V0)
 	return 0;
 }
 
-int
+static int
 nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
 {
 	union {
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c +1 -1
index 1bb9d661e9b3..bae51b5ba51d 100644
@@ -45,7 +45,7 @@ static const struct nvkm_output_func
 g94_sor_output_func = {
 };
 
-int
+static int
 g94_sor_output_new(struct nvkm_disp *disp, int index,
 		   struct dcb_output *dcbE, struct nvkm_output **poutp)
 {
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c +2 -2
index aeb3387a3fb0..15a992b3580a 100644
@@ -129,7 +129,7 @@ g84_fifo_chan_engine_fini(struct nvkm_fifo_chan *base,
 }
 
 
-int
+static int
 g84_fifo_chan_engine_init(struct nvkm_fifo_chan *base,
 			  struct nvkm_engine *engine)
 {
@@ -170,7 +170,7 @@ g84_fifo_chan_engine_ctor(struct nvkm_fifo_chan *base,
 	return nvkm_object_bind(object, NULL, 0, &chan->engn[engn]);
 }
 
-int
+static int
 g84_fifo_chan_object_ctor(struct nvkm_fifo_chan *base,
 			  struct nvkm_object *object)
 {
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c +1 -1
index c925ade5880e..74a64e3fd59a 100644
@@ -218,7 +218,7 @@ gf117_grctx_generate_attrib(struct gf100_grctx *info)
 	}
 }
 
-void
+static void
 gf117_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
 {
 	struct nvkm_device *device = gr->base.engine.subdev.device;
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c +1 -1
index 6d3c5011e18c..4c4b5ab6e46d 100644
@@ -933,7 +933,7 @@ gm107_grctx_generate_attrib(struct gf100_grctx *info)
 	}
 }
 
-void
+static void
 gm107_grctx_generate_tpcid(struct gf100_gr *gr)
 {
 	struct nvkm_device *device = gr->base.engine.subdev.device;
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c +1 -0
index 1e13278cf306..c8bb9191f9a2 100644
@@ -106,6 +106,7 @@
 #define CP_SEEK_2      0x00c800ff
 
 #include "ctxnv40.h"
+#include "nv50.h"
 
 #include <subdev/fb.h>
 
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +2 -2
index 157919c788e6..eccdee04107d 100644
@@ -1384,7 +1384,7 @@ gf100_gr_intr(struct nvkm_gr *base)
 	nvkm_fifo_chan_put(device->fifo, flags, &chan);
 }
 
-void
+static void
 gf100_gr_init_fw(struct gf100_gr *gr, u32 fuc_base,
 		 struct gf100_gr_fuc *code, struct gf100_gr_fuc *data)
 {
@@ -1701,7 +1701,7 @@ gf100_gr_oneinit(struct nvkm_gr *base)
 	return 0;
 }
 
-int
+static int
 gf100_gr_init_(struct nvkm_gr *base)
 {
 	struct gf100_gr *gr = gf100_gr(base);
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c +2 -2
index 70335f65c51e..0124e468086e 100644
@@ -102,7 +102,7 @@ gf117_gr_pack_mmio[] = {
 
 #include "fuc/hubgf117.fuc3.h"
 
-struct gf100_gr_ucode
+static struct gf100_gr_ucode
 gf117_gr_fecs_ucode = {
 	.code.data = gf117_grhub_code,
 	.code.size = sizeof(gf117_grhub_code),
@@ -112,7 +112,7 @@ gf117_gr_fecs_ucode = {
 
 #include "fuc/gpcgf117.fuc3.h"
 
-struct gf100_gr_ucode
+static struct gf100_gr_ucode
 gf117_gr_gpccs_ucode = {
 	.code.data = gf117_grgpc_code,
 	.code.size = sizeof(gf117_grgpc_code),
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c +1 -1
index 45f965f608a7..2c67fac576d1 100644
@@ -308,7 +308,7 @@ gm107_gr_init_bios(struct gf100_gr *gr)
 	}
 }
 
-int
+static int
 gm107_gr_init(struct gf100_gr *gr)
 {
 	struct nvkm_device *device = gr->base.engine.subdev.device;
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c +2 -2
index 8616636ad7b4..dde89a4a0f5b 100644
@@ -71,7 +71,7 @@ nvkm_perfdom_find(struct nvkm_pm *pm, int di)
 	return NULL;
 }
 
-struct nvkm_perfsig *
+static struct nvkm_perfsig *
 nvkm_perfsig_find(struct nvkm_pm *pm, u8 di, u8 si, struct nvkm_perfdom **pdom)
 {
 	struct nvkm_perfdom *dom = *pdom;
@@ -699,7 +699,7 @@ nvkm_pm_oclass_get(struct nvkm_oclass *oclass, int index,
 	return 1;
 }
 
-int
+static int
 nvkm_perfsrc_new(struct nvkm_pm *pm, struct nvkm_perfsig *sig,
 		 const struct nvkm_specsrc *spec)
 {
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c +1 -1
index d2901e9a7808..fe2532ee4145 100644
@@ -102,7 +102,7 @@ gf100_pm_gpc[] = {
 	{}
 };
 
-const struct nvkm_specdom
+static const struct nvkm_specdom
 gf100_pm_part[] = {
 	{ 0xe0, (const struct nvkm_specsig[]) {
 			{ 0x0f, "part00_pbfb_00", gf100_pbfb_sources },
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c +2 -2
index 80fed7e78dcb..e2905815049b 100644
@@ -25,7 +25,7 @@
 #include <subdev/bios/bit.h>
 #include <subdev/bios/fan.h>
 
-u16
+static u16
 nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
 {
 	struct bit_entry bit_P;
@@ -52,7 +52,7 @@ nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
 	return 0x0000;
 }
 
-u16
+static u16
 nvbios_fan_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
 		 u8 *cnt, u8 *len)
 {
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c +1 -1
index 056702ef69aa..96e0941c8edd 100644
@@ -180,7 +180,7 @@ gt215_clk_read(struct nvkm_clk *base, enum nv_clk_src src)
 	return 0;
 }
 
-int
+static int
 gt215_clk_info(struct nvkm_clk *base, int idx, u32 khz,
 	       struct gt215_clk_info *info)
 {
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c +4 -4
index d15ea886df27..f10664372161 100644
@@ -95,7 +95,7 @@ struct gt215_ram {
 	struct gt215_ltrain ltrain;
 };
 
-void
+static void
 gt215_link_train_calc(u32 *vals, struct gt215_ltrain *train)
 {
 	int i, lo, hi;
@@ -149,7 +149,7 @@ gt215_link_train_calc(u32 *vals, struct gt215_ltrain *train)
 /*
  * Link training for (at least) DDR3
  */
-int
+static int
 gt215_link_train(struct gt215_ram *ram)
 {
 	struct gt215_ltrain *train = &ram->ltrain;
@@ -267,7 +267,7 @@ out:
 	return ret;
 }
 
-int
+static int
 gt215_link_train_init(struct gt215_ram *ram)
 {
 	static const u32 pattern[16] = {
@@ -333,7 +333,7 @@ gt215_link_train_init(struct gt215_ram *ram)
 	return 0;
 }
 
-void
+static void
 gt215_link_train_fini(struct gt215_ram *ram)
 {
 	if (ram->ltrain.mem)
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c +1 -0
index b9f1ffdfc602..4dcd8742f2da 100644
@@ -23,6 +23,7 @@
  *          Ben Skeggs
  */
 #include "priv.h"
+#include "ram.h"
 
 struct ramxlat {
 	int id;
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c +1 -0
index 26900333b1d6..eca8a445eab3 100644
@@ -23,6 +23,7 @@
  * 	    Roy Spliet <[email protected]>
  */
 #include "priv.h"
+#include "ram.h"
 
 struct ramxlat {
 	int id;
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c +1 -1
index 3f45afd17d5a..2ead515b8530 100644
@@ -37,7 +37,7 @@ gk104_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo)
 	nvkm_wr32(device, 0x00dc80, intr1);
 }
 
-void
+static void
 gk104_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
 {
 	struct nvkm_device *device = gpio->subdev.device;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c +1 -1
index f0851d57df2f..01d5c5a56e2e 100644
@@ -74,7 +74,7 @@ nvkm_i2c_aux_i2c_func(struct i2c_adapter *adap)
 	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
-const struct i2c_algorithm
+static const struct i2c_algorithm
 nvkm_i2c_aux_i2c_algo = {
 	.master_xfer = nvkm_i2c_aux_i2c_xfer,
 	.functionality = nvkm_i2c_aux_i2c_func
drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c +1 -1
index 41bd5d0f7692..6c49beec5bde 100644
@@ -329,7 +329,7 @@ nvkm_iccsense_init(struct nvkm_subdev *subdev)
 	return 0;
 }
 
-struct nvkm_subdev_func iccsense_func = {
+static const struct nvkm_subdev_func iccsense_func = {
 	.oneinit = nvkm_iccsense_oneinit,
 	.init = nvkm_iccsense_init,
 	.dtor = nvkm_iccsense_dtor,
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c +2 -2
index 8ed8f65ff664..10c987a654ec 100644
@@ -104,7 +104,7 @@ nvkm_instobj_dtor(struct nvkm_memory *memory)
 	return iobj;
 }
 
-const struct nvkm_memory_func
+static const struct nvkm_memory_func
 nvkm_instobj_func = {
 	.dtor = nvkm_instobj_dtor,
 	.target = nvkm_instobj_target,
@@ -156,7 +156,7 @@ nvkm_instobj_wr32_slow(struct nvkm_memory *memory, u64 offset, u32 data)
 	return nvkm_wo32(iobj->parent, offset, data);
 }
 
-const struct nvkm_memory_func
+static const struct nvkm_memory_func
 nvkm_instobj_func_slow = {
 	.dtor = nvkm_instobj_dtor,
 	.target = nvkm_instobj_target,
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g84.c +1 -1
index c3d66ef5dc12..430a61c3df44 100644
@@ -34,7 +34,7 @@ g84_mc_reset[] = {
 	{}
 };
 
-const struct nvkm_mc_map
+static const struct nvkm_mc_map
 g84_mc_intr[] = {
 	{ 0x04000000, NVKM_ENGINE_DISP },
 	{ 0x00020000, NVKM_ENGINE_VP },
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c +1 -1
index f1e2dc914366..ec48e4ace37a 100644
@@ -1364,7 +1364,7 @@ gm200_secboot_init(struct nvkm_secboot *sb)
 	return 0;
 }
 
-int
+static int
 gm200_secboot_fini(struct nvkm_secboot *sb, bool suspend)
 {
 	struct gm200_secboot *gsb = gm200_secboot(sb);
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c +2 -2
index 420bd84d8483..1527d12aa222 100644
@@ -34,7 +34,7 @@ struct gk104_volt {
 	struct nvbios_volt bios;
 };
 
-int
+static int
 gk104_volt_get(struct nvkm_volt *base)
 {
 	struct nvbios_volt *bios = &gk104_volt(base)->bios;
@@ -47,7 +47,7 @@ gk104_volt_get(struct nvkm_volt *base)
 	return bios->base + bios->pwm_range * duty / div;
 }
 
-int
+static int
 gk104_volt_set(struct nvkm_volt *base, u32 uv)
 {
 	struct nvbios_volt *bios = &gk104_volt(base)->bios;
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c +2 -2
index 74db4d28930f..2925b9cae681 100644
@@ -25,7 +25,7 @@
 
 #include <core/tegra.h>
 
-const struct cvb_coef gm20b_cvb_coef[] = {
+static const struct cvb_coef gm20b_cvb_coef[] = {
 	/* KHz,             c0,      c1,   c2 */
 	/*  76800 */ { 1786666,  -85625, 1632 },
 	/* 153600 */ { 1846729,  -87525, 1632 },
@@ -58,7 +58,7 @@ static const struct cvb_coef gm20b_na_cvb_coef[] = {
 	/* 998400 */ { 1316991, 8144, -940, 808, -21583, 226 },
 };
 
-const u32 speedo_to_vmin[] = {
+static const u32 speedo_to_vmin[] = {
 	/*   0,      1,      2,      3,      4, */
 	950000, 840000, 818750, 840000, 810000,
 };
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c +1 -0
index d2bac1d77819..cb749a0ba582 100644
@@ -22,6 +22,7 @@
  * Authors: Ben Skeggs
  */
 #include <subdev/volt.h>
+#include <subdev/volt/priv.h>
 #include <subdev/bios.h>
 #include <subdev/bios/gpio.h>
 #include <subdev/gpio.h>
Signature · 6 lines
2.7.4

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

PATCH 11/14 drm/rockchip: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/rockchip/rockchip_drm_drv.c:312:6: warning: symbol 'rockchip_drm_fb_suspend' was not declared. Should it be static? drm/rockchip/rockchip_drm_drv.c:321:6: warning: symbol 'rockchip_drm_fb_resume' was not declared. Should it be static? drm/rockchip/rockchip_drm_fbdev.c:130:5: warning: symbol 'rockchip_drm_fbdev_init' was not declared. Should it be static? drm/rockchip/rockchip_drm_fbdev.c:173:6: warning: symbol 'rockchip_drm_fbdev_fini' was not declared. Should it be static?

---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c   | 4 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +2 -2
index 76eaf1de52e4..38c3be5f2c67 100644
@@ -309,7 +309,7 @@ static struct drm_driver rockchip_drm_driver = {
 };
 
 #ifdef CONFIG_PM_SLEEP
-void rockchip_drm_fb_suspend(struct drm_device *drm)
+static void rockchip_drm_fb_suspend(struct drm_device *drm)
 {
 	struct rockchip_drm_private *priv = drm->dev_private;
 
@@ -318,7 +318,7 @@ void rockchip_drm_fb_suspend(struct drm_device *drm)
 	console_unlock();
 }
 
-void rockchip_drm_fb_resume(struct drm_device *drm)
+static void rockchip_drm_fb_resume(struct drm_device *drm)
 {
 	struct rockchip_drm_private *priv = drm->dev_private;
 
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c +1 -0
index 207e01de6e32..a16c69f96ed5 100644
@@ -20,6 +20,7 @@
 #include "rockchip_drm_drv.h"
 #include "rockchip_drm_gem.h"
 #include "rockchip_drm_fb.h"
+#include "rockchip_drm_fbdev.h"
 
 #define PREFERRED_BPP		32
 #define to_drm_private(x) \
Signature · 6 lines
2.7.4

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

PATCH 12/14 drm/sti: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/sti/sti_mixer.c:361:6: warning: symbol 'sti_mixer_set_matrix' was not declared. Should it be static? drm/sti/sti_gdp.c:476:5: warning: symbol 'sti_gdp_field_cb' was not declared. Should it be static? drm/sti/sti_gdp.c:885:24: warning: symbol 'sti_gdp_plane_helpers_funcs' was not declared. Should it be static? drm/sti/sti_cursor.c:348:24: warning: symbol 'sti_cursor_plane_helpers_funcs' was not declared. Should it be static? drm/sti/sti_compositor.c:28:28: warning: symbol 'stih407_compositor_data' was not declared. Should it be static? drm/sti/sti_compositor.c:49:28: warning: symbol 'stih416_compositor_data' was not declared. Should it be static? drm/sti/sti_vtg.c:75:1: warning: symbol 'vtg_lookup' was not declared. Should it be static? drm/sti/sti_vtg.c:476:24: warning: symbol 'sti_vtg_driver' was not declared. Should it be static? drm/sti/sti_dvo.c:109:5: warning: symbol 'dvo_awg_generate_code' was not declared. Should it be static? drm/sti/sti_dvo.c:602:24: warning: symbol 'sti_dvo_driver' was not declared. Should it be static? drm/sti/sti_vtac.c:209:24: warning: symbol 'sti_vtac_driver' was not declared. Should it be static? drm/sti/sti_tvout.c:914:24: warning: symbol 'sti_tvout_driver' was not declared. Should it be static? drm/sti/sti_hqvdp.c:786:5: warning: symbol 'sti_hqvdp_vtg_cb' was not declared. Should it be static? drm/sti/sti_hqvdp.c:1253:24: warning: symbol 'sti_hqvdp_plane_helpers_funcs' was not declared. Should it be static? drm/sti/sti_hqvdp.c:1292:5: warning: symbol 'sti_hqvdp_bind' was not declared. Should it be static? drm/sti/sti_hqvdp.c:1385:24: warning: symbol 'sti_hqvdp_driver' was not declared. Should it be static? drm/sti/sti_drv.c:143:6: warning: symbol 'sti_drm_dbg_cleanup' was not declared. Should it be static?

Cc Benjamin Gaignard <[email protected]>
Cc Vincent Abriou <[email protected]>
---
 drivers/gpu/drm/sti/sti_compositor.c | 4 ++--
 drivers/gpu/drm/sti/sti_cursor.c     | 2 +-
 drivers/gpu/drm/sti/sti_drv.c        | 2 +-
 drivers/gpu/drm/sti/sti_dvo.c        | 3 ++-
 drivers/gpu/drm/sti/sti_gdp.c        | 6 +++---
 drivers/gpu/drm/sti/sti_hqvdp.c      | 7 ++++---
 drivers/gpu/drm/sti/sti_mixer.c      | 2 +-
 drivers/gpu/drm/sti/sti_tvout.c      | 1 +
 drivers/gpu/drm/sti/sti_vtac.c       | 2 ++
 drivers/gpu/drm/sti/sti_vtg.c        | 3 ++-
 10 files changed, 19 insertions(+), 13 deletions(-)
drivers/gpu/drm/sti/sti_compositor.c +2 -2
index 134201ecc6fd..a8441ae2623a 100644
@@ -25,7 +25,7 @@
 /*
  * stiH407 compositor properties
  */
-struct sti_compositor_data stih407_compositor_data = {
+static const struct sti_compositor_data stih407_compositor_data = {
 	.nb_subdev = 8,
 	.subdev_desc = {
 			{STI_CURSOR_SUBDEV, (int)STI_CURSOR, 0x000},
@@ -46,7 +46,7 @@ struct sti_compositor_data stih407_compositor_data = {
  * Moreover, GDPx is different for Main and Aux Mixer. So this subdev map does
  * not fit for stiH416 if we want to enable the MIXER_AUX.
  */
-struct sti_compositor_data stih416_compositor_data = {
+static const struct sti_compositor_data stih416_compositor_data = {
 	.nb_subdev = 3,
 	.subdev_desc = {
 			{STI_GPD_SUBDEV, (int)STI_GDP_0, 0x100},
drivers/gpu/drm/sti/sti_cursor.c +1 -1
index 3b53f7f2e3fc..651f231c4615 100644
@@ -345,7 +345,7 @@ static int sti_cursor_late_register(struct drm_plane *drm_plane)
 	return cursor_debugfs_init(cursor, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_cursor_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = sti_cursor_destroy,
drivers/gpu/drm/sti/sti_drv.c +1 -1
index 7cd3804c6dee..e6f0706bc6c7 100644
@@ -140,7 +140,7 @@ err:
 	return ret;
 }
 
-void sti_drm_dbg_cleanup(struct drm_minor *minor)
+static void sti_drm_dbg_cleanup(struct drm_minor *minor)
 {
 	drm_debugfs_remove_files(sti_drm_dbg_list,
 				 ARRAY_SIZE(sti_drm_dbg_list), minor);
drivers/gpu/drm/sti/sti_dvo.c +2 -1
index 00881eb4536e..e8c1ed08a9f7 100644
@@ -17,6 +17,7 @@
 #include <drm/drm_panel.h>
 
 #include "sti_awg_utils.h"
+#include "sti_drv.h"
 #include "sti_mixer.h"
 
 /* DVO registers */
@@ -106,7 +107,7 @@ struct sti_dvo_connector {
 	container_of(x, struct sti_dvo_connector, drm_connector)
 
 #define BLANKING_LEVEL 16
-int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
+static int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
 {
 	struct drm_display_mode *mode = &dvo->mode;
 	struct dvo_config *config = dvo->config;
drivers/gpu/drm/sti/sti_gdp.c +3 -3
index b8d942ca45e8..9873b4c360b9 100644
@@ -473,8 +473,8 @@ static void sti_gdp_disable(struct sti_gdp *gdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_gdp_field_cb(struct notifier_block *nb,
-		unsigned long event, void *data)
+static int sti_gdp_field_cb(struct notifier_block *nb,
+			    unsigned long event, void *data)
 {
 	struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb);
 
@@ -882,7 +882,7 @@ static int sti_gdp_late_register(struct drm_plane *drm_plane)
 	return gdp_debugfs_init(gdp, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_gdp_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = sti_gdp_destroy,
drivers/gpu/drm/sti/sti_hqvdp.c +4 -3
index b5ee783e3e7c..04546ebb75d7 100644
@@ -17,6 +17,7 @@
 #include "sti_hqvdp_lut.h"
 #include "sti_plane.h"
 #include "sti_vtg.h"
+#include "sti_drv.h"
 
 /* Firmware name */
 #define HQVDP_FMW_NAME          "hqvdp-stih407.bin"
@@ -783,7 +784,7 @@ static void sti_hqvdp_disable(struct sti_hqvdp *hqvdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
+static int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
 {
 	struct sti_hqvdp *hqvdp = container_of(nb, struct sti_hqvdp, vtg_nb);
 	int btm_cmd_offset, top_cmd_offest;
@@ -1250,7 +1251,7 @@ static int sti_hqvdp_late_register(struct drm_plane *drm_plane)
 	return hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = sti_hqvdp_destroy,
@@ -1289,7 +1290,7 @@ static struct drm_plane *sti_hqvdp_create(struct drm_device *drm_dev,
 	return &hqvdp->plane.drm_plane;
 }
 
-int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
+static int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
 {
 	struct sti_hqvdp *hqvdp = dev_get_drvdata(dev);
 	struct drm_device *drm_dev = data;
drivers/gpu/drm/sti/sti_mixer.c +1 -1
index 7d9aea805eab..b78cec538aaa 100644
@@ -358,7 +358,7 @@ int sti_mixer_set_plane_status(struct sti_mixer *mixer,
 	return 0;
 }
 
-void sti_mixer_set_matrix(struct sti_mixer *mixer)
+static void sti_mixer_set_matrix(struct sti_mixer *mixer)
 {
 	unsigned int i;
 
drivers/gpu/drm/sti/sti_tvout.c +1 -0
index e25995b35715..cc07e069a770 100644
@@ -18,6 +18,7 @@
 #include <drm/drm_crtc_helper.h>
 
 #include "sti_crtc.h"
+#include "sti_drv.h"
 #include "sti_vtg.h"
 
 /* glue registers */
drivers/gpu/drm/sti/sti_vtac.c +2 -0
index b1eb0d77630d..cf7fe8a1db42 100644
@@ -12,6 +12,8 @@
 
 #include <drm/drmP.h>
 
+#include "sti_drv.h"
+
 /* registers offset */
 #define VTAC_CONFIG                     0x00
 #define VTAC_RX_FIFO_CONFIG             0x04
drivers/gpu/drm/sti/sti_vtg.c +2 -1
index 0bdc385eec17..a8882bdd0f8b 100644
@@ -13,6 +13,7 @@
 
 #include <drm/drmP.h>
 
+#include "sti_drv.h"
 #include "sti_vtg.h"
 
 #define VTG_MODE_MASTER         0
@@ -72,7 +73,7 @@
 #define AWG_DELAY_ED        (-8)
 #define AWG_DELAY_SD        (-7)
 
-LIST_HEAD(vtg_lookup);
+static LIST_HEAD(vtg_lookup);
 
 /*
  * STI VTG register offset structure
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 12/14
#20 lore raw

Re: [PATCH 12/14] drm/sti: Fix sparse warnings

Quoted 220 lines · On 09/19/2016 03:33 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/sti/sti_mixer.c:361:6: warning: symbol 'sti_mixer_set_matrix' was not declared. Should it be static? drm/sti/sti_gdp.c:476:5: warning: symbol 'sti_gdp_field_cb' was not declared. Should it be static? drm/sti/sti_gdp.c:885:24: warning: symbol 'sti_gdp_plane_helpers_funcs' was not declared. Should it be static? drm/sti/sti_cursor.c:348:24: warning: symbol 'sti_cursor_plane_helpers_funcs' was not declared. Should it be static? drm/sti/sti_compositor.c:28:28: warning: symbol 'stih407_compositor_data' was not declared. Should it be static? drm/sti/sti_compositor.c:49:28: warning: symbol 'stih416_compositor_data' was not declared. Should it be static? drm/sti/sti_vtg.c:75:1: warning: symbol 'vtg_lookup' was not declared. Should it be static? drm/sti/sti_vtg.c:476:24: warning: symbol 'sti_vtg_driver' was not declared. Should it be static? drm/sti/sti_dvo.c:109:5: warning: symbol 'dvo_awg_generate_code' was not declared. Should it be static? drm/sti/sti_dvo.c:602:24: warning: symbol 'sti_dvo_driver' was not declared. Should it be static? drm/sti/sti_vtac.c:209:24: warning: symbol 'sti_vtac_driver' was not declared. Should it be static? drm/sti/sti_tvout.c:914:24: warning: symbol 'sti_tvout_driver' was not declared. Should it be static? drm/sti/sti_hqvdp.c:786:5: warning: symbol 'sti_hqvdp_vtg_cb' was not declared. Should it be static? drm/sti/sti_hqvdp.c:1253:24: warning: symbol 'sti_hqvdp_plane_helpers_funcs' was not declared. Should it be static? drm/sti/sti_hqvdp.c:1292:5: warning: symbol 'sti_hqvdp_bind' was not declared. Should it be static? drm/sti/sti_hqvdp.c:1385:24: warning: symbol 'sti_hqvdp_driver' was not declared. Should it be static? drm/sti/sti_drv.c:143:6: warning: symbol 'sti_drm_dbg_cleanup' was not declared. Should it be static?

Cc Benjamin Gaignard <[email protected]>
Cc Vincent Abriou <[email protected]>
---
 drivers/gpu/drm/sti/sti_compositor.c | 4 ++--
 drivers/gpu/drm/sti/sti_cursor.c     | 2 +-
 drivers/gpu/drm/sti/sti_drv.c        | 2 +-
 drivers/gpu/drm/sti/sti_dvo.c        | 3 ++-
 drivers/gpu/drm/sti/sti_gdp.c        | 6 +++---
 drivers/gpu/drm/sti/sti_hqvdp.c      | 7 ++++---
 drivers/gpu/drm/sti/sti_mixer.c      | 2 +-
 drivers/gpu/drm/sti/sti_tvout.c      | 1 +
 drivers/gpu/drm/sti/sti_vtac.c       | 2 ++
 drivers/gpu/drm/sti/sti_vtg.c        | 3 ++-
 10 files changed, 19 insertions(+), 13 deletions(-)
drivers/gpu/drm/sti/sti_compositor.c +2 -2
index 134201ecc6fd..a8441ae2623a 100644
@@ -25,7 +25,7 @@
 /*
  * stiH407 compositor properties
  */
-struct sti_compositor_data stih407_compositor_data = {
+static const struct sti_compositor_data stih407_compositor_data = {
 	.nb_subdev = 8,
 	.subdev_desc = {
 			{STI_CURSOR_SUBDEV, (int)STI_CURSOR, 0x000},
@@ -46,7 +46,7 @@ struct sti_compositor_data stih407_compositor_data = {
  * Moreover, GDPx is different for Main and Aux Mixer. So this subdev map does
  * not fit for stiH416 if we want to enable the MIXER_AUX.
  */
-struct sti_compositor_data stih416_compositor_data = {
+static const struct sti_compositor_data stih416_compositor_data = {
 	.nb_subdev = 3,
 	.subdev_desc = {
 			{STI_GPD_SUBDEV, (int)STI_GDP_0, 0x100},
drivers/gpu/drm/sti/sti_cursor.c +1 -1
index 3b53f7f2e3fc..651f231c4615 100644
@@ -345,7 +345,7 @@ static int sti_cursor_late_register(struct drm_plane *drm_plane)
 	return cursor_debugfs_init(cursor, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_cursor_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = sti_cursor_destroy,
drivers/gpu/drm/sti/sti_drv.c +1 -1
index 7cd3804c6dee..e6f0706bc6c7 100644
@@ -140,7 +140,7 @@ err:
 	return ret;
 }
 
-void sti_drm_dbg_cleanup(struct drm_minor *minor)
+static void sti_drm_dbg_cleanup(struct drm_minor *minor)
 {
 	drm_debugfs_remove_files(sti_drm_dbg_list,
 				 ARRAY_SIZE(sti_drm_dbg_list), minor);
drivers/gpu/drm/sti/sti_dvo.c +2 -1
index 00881eb4536e..e8c1ed08a9f7 100644
@@ -17,6 +17,7 @@
 #include <drm/drm_panel.h>
 
 #include "sti_awg_utils.h"
+#include "sti_drv.h"
 #include "sti_mixer.h"
 
 /* DVO registers */
@@ -106,7 +107,7 @@ struct sti_dvo_connector {
 	container_of(x, struct sti_dvo_connector, drm_connector)
 
 #define BLANKING_LEVEL 16
-int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
+static int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
 {
 	struct drm_display_mode *mode = &dvo->mode;
 	struct dvo_config *config = dvo->config;
drivers/gpu/drm/sti/sti_gdp.c +3 -3
index b8d942ca45e8..9873b4c360b9 100644
@@ -473,8 +473,8 @@ static void sti_gdp_disable(struct sti_gdp *gdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_gdp_field_cb(struct notifier_block *nb,
-		unsigned long event, void *data)
+static int sti_gdp_field_cb(struct notifier_block *nb,
+			    unsigned long event, void *data)
 {
 	struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb);
 
@@ -882,7 +882,7 @@ static int sti_gdp_late_register(struct drm_plane *drm_plane)
 	return gdp_debugfs_init(gdp, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_gdp_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = sti_gdp_destroy,
drivers/gpu/drm/sti/sti_hqvdp.c +4 -3
index b5ee783e3e7c..04546ebb75d7 100644
@@ -17,6 +17,7 @@
 #include "sti_hqvdp_lut.h"
 #include "sti_plane.h"
 #include "sti_vtg.h"
+#include "sti_drv.h"
 
 /* Firmware name */
 #define HQVDP_FMW_NAME          "hqvdp-stih407.bin"
@@ -783,7 +784,7 @@ static void sti_hqvdp_disable(struct sti_hqvdp *hqvdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
+static int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
 {
 	struct sti_hqvdp *hqvdp = container_of(nb, struct sti_hqvdp, vtg_nb);
 	int btm_cmd_offset, top_cmd_offest;
@@ -1250,7 +1251,7 @@ static int sti_hqvdp_late_register(struct drm_plane *drm_plane)
 	return hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = sti_hqvdp_destroy,
@@ -1289,7 +1290,7 @@ static struct drm_plane *sti_hqvdp_create(struct drm_device *drm_dev,
 	return &hqvdp->plane.drm_plane;
 }
 
-int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
+static int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
 {
 	struct sti_hqvdp *hqvdp = dev_get_drvdata(dev);
 	struct drm_device *drm_dev = data;
drivers/gpu/drm/sti/sti_mixer.c +1 -1
index 7d9aea805eab..b78cec538aaa 100644
@@ -358,7 +358,7 @@ int sti_mixer_set_plane_status(struct sti_mixer *mixer,
 	return 0;
 }
 
-void sti_mixer_set_matrix(struct sti_mixer *mixer)
+static void sti_mixer_set_matrix(struct sti_mixer *mixer)
 {
 	unsigned int i;
 
drivers/gpu/drm/sti/sti_tvout.c +1 -0
index e25995b35715..cc07e069a770 100644
@@ -18,6 +18,7 @@
 #include <drm/drm_crtc_helper.h>
 
 #include "sti_crtc.h"
+#include "sti_drv.h"
 #include "sti_vtg.h"
 
 /* glue registers */
drivers/gpu/drm/sti/sti_vtac.c +2 -0
index b1eb0d77630d..cf7fe8a1db42 100644
@@ -12,6 +12,8 @@
 
 #include <drm/drmP.h>
 
+#include "sti_drv.h"
+
 /* registers offset */
 #define VTAC_CONFIG                     0x00
 #define VTAC_RX_FIFO_CONFIG             0x04
drivers/gpu/drm/sti/sti_vtg.c +1 -0
index 0bdc385eec17..a8882bdd0f8b 100644
@@ -13,6 +13,7 @@
 
 #include <drm/drmP.h>
 
+#include "sti_drv.h"
 #include "sti_vtg.h"
 
 #define VTG_MODE_MASTER         0

drivers/gpu/drm/sti/sti_vtg.c line 79

Quoted 8 lines
drivers/gpu/drm/sti/sti_vtg.c +1 -1
@@ -72,7 +73,7 @@
 #define AWG_DELAY_ED        (-8)
 #define AWG_DELAY_SD        (-7)
 
-LIST_HEAD(vtg_lookup);
+static LIST_HEAD(vtg_lookup);
 
 /*
  * STI VTG register offset structure

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

#21 lore raw

PATCH 13/14 drm/sun4i: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/sun4i/sun4i_tv.c:181:21: warning: symbol 'ntsc_video_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:185:21: warning: symbol 'pal_video_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:189:21: warning: symbol 'ntsc_burst_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:193:21: warning: symbol 'pal_burst_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:197:20: warning: symbol 'ntsc_color_gains' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:201:20: warning: symbol 'pal_color_gains' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:205:26: warning: symbol 'ntsc_resync_parameters' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:209:26: warning: symbol 'pal_resync_parameters' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:213:16: warning: symbol 'tv_modes' was not declared. Should it be static?

---
 drivers/gpu/drm/sun4i/sun4i_tv.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/gpu/drm/sun4i/sun4i_tv.c +19 -19
index b84147896294..3d69bd34f36c 100644
@@ -161,10 +161,10 @@ struct tv_mode {
 	bool		dac3_en;
 	bool		dac_bit25_en;
 
-	struct color_gains		*color_gains;
-	struct burst_levels		*burst_levels;
-	struct video_levels		*video_levels;
-	struct resync_parameters	*resync_params;
+	const struct color_gains	*color_gains;
+	const struct burst_levels	*burst_levels;
+	const struct video_levels	*video_levels;
+	const struct resync_parameters	*resync_params;
 };
 
 struct sun4i_tv {
@@ -178,39 +178,39 @@ struct sun4i_tv {
 	struct sun4i_drv	*drv;
 };
 
-struct video_levels ntsc_video_levels = {
+static const struct video_levels ntsc_video_levels = {
 	.black = 282,	.blank = 240,
 };
 
-struct video_levels pal_video_levels = {
+static const struct video_levels pal_video_levels = {
 	.black = 252,	.blank = 252,
 };
 
-struct burst_levels ntsc_burst_levels = {
+static const struct burst_levels ntsc_burst_levels = {
 	.cb = 79,	.cr = 0,
 };
 
-struct burst_levels pal_burst_levels = {
+static const struct burst_levels pal_burst_levels = {
 	.cb = 40,	.cr = 40,
 };
 
-struct color_gains ntsc_color_gains = {
+static const struct color_gains ntsc_color_gains = {
 	.cb = 160,	.cr = 160,
 };
 
-struct color_gains pal_color_gains = {
+static const struct color_gains pal_color_gains = {
 	.cb = 224,	.cr = 224,
 };
 
-struct resync_parameters ntsc_resync_parameters = {
+static const struct resync_parameters ntsc_resync_parameters = {
 	.field = false,	.line = 14,	.pixel = 12,
 };
 
-struct resync_parameters pal_resync_parameters = {
+static const struct resync_parameters pal_resync_parameters = {
 	.field = true,	.line = 13,	.pixel = 12,
 };
 
-struct tv_mode tv_modes[] = {
+static const struct tv_mode tv_modes[] = {
 	{
 		.name		= "NTSC",
 		.mode		= SUN4I_TVE_CFG0_RES_480i,
@@ -289,13 +289,13 @@ drm_connector_to_sun4i_tv(struct drm_connector *connector)
  * So far, it doesn't seem to be preserved when the mode is passed by
  * to mode_set for some reason.
  */
-static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
+static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct drm_display_mode *mode)
 {
 	int i;
 
 	/* First try to identify the mode by name */
 	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
-		struct tv_mode *tv_mode = &tv_modes[i];
+		const struct tv_mode *tv_mode = &tv_modes[i];
 
 		DRM_DEBUG_DRIVER("Comparing mode %s vs %s",
 				 mode->name, tv_mode->name);
@@ -306,7 +306,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
 
 	/* Then by number of lines */
 	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
-		struct tv_mode *tv_mode = &tv_modes[i];
+		const struct tv_mode *tv_mode = &tv_modes[i];
 
 		DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)",
 				 mode->name, tv_mode->name,
@@ -319,7 +319,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
 	return NULL;
 }
 
-static void sun4i_tv_mode_to_drm_mode(struct tv_mode *tv_mode,
+static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode,
 				      struct drm_display_mode *mode)
 {
 	DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name);
@@ -386,7 +386,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
 	struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);
 	struct sun4i_drv *drv = tv->drv;
 	struct sun4i_tcon *tcon = drv->tcon;
-	struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode);
+	const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode);
 
 	sun4i_tcon1_mode_set(tcon, mode);
 
@@ -508,7 +508,7 @@ static int sun4i_tv_comp_get_modes(struct drm_connector *connector)
 
 	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
 		struct drm_display_mode *mode = drm_mode_create(connector->dev);
-		struct tv_mode *tv_mode = &tv_modes[i];
+		const struct tv_mode *tv_mode = &tv_modes[i];
 
 		strcpy(mode->name, tv_mode->name);
 
Signature · 6 lines
2.7.4

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

Re: [PATCH 13/14] drm/sun4i: Fix sparse warnings

1;4402;0c

Quoted 12 lines · On Mon, Sep 19, 2016 at 04:33:54PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/sun4i/sun4i_tv.c:181:21: warning: symbol 'ntsc_video_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:185:21: warning: symbol 'pal_video_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:189:21: warning: symbol 'ntsc_burst_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:193:21: warning: symbol 'pal_burst_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:197:20: warning: symbol 'ntsc_color_gains' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:201:20: warning: symbol 'pal_color_gains' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:205:26: warning: symbol 'ntsc_resync_parameters' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:209:26: warning: symbol 'pal_resync_parameters' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:213:16: warning: symbol 'tv_modes' was not declared. Should it be static?

Quoted 2 lines

Applied, thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

#23 lore raw

PATCH 14/14 drm/tilcdc: Fix sparse warnings

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

drm/tilcdc/tilcdc_tfp410.c:385:24: warning: symbol 'tfp410_driver' was not declared. Should it be static? drm/tilcdc/tilcdc_tfp410.c:395:12: warning: symbol 'tilcdc_tfp410_init' was not declared. Should it be static? drm/tilcdc/tilcdc_tfp410.c:400:13: warning: symbol 'tilcdc_tfp410_fini' was not declared. Should it be static? drm/tilcdc/tilcdc_panel.c:436:24: warning: symbol 'panel_driver' was not declared. Should it be static? drm/tilcdc/tilcdc_panel.c:446:12: warning: symbol 'tilcdc_panel_init' was not declared. Should it be static? drm/tilcdc/tilcdc_panel.c:451:13: warning: symbol 'tilcdc_panel_fini' was not declared. Should it be static? drm/tilcdc/tilcdc_drv.c:78:5: warning: symbol 'tilcdc_atomic_check' was not declared. Should it be static?

Cc Jyri Sarha <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c    | 4 ++--
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 3 ++-
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +2 -2
index f8892e9ad169..d6f8780e41df 100644
@@ -75,8 +75,8 @@ static void tilcdc_fb_output_poll_changed(struct drm_device *dev)
 	drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
 
-int tilcdc_atomic_check(struct drm_device *dev,
-			struct drm_atomic_state *state)
+static int tilcdc_atomic_check(struct drm_device *dev,
+			       struct drm_atomic_state *state)
 {
 	int ret;
 
drivers/gpu/drm/tilcdc/tilcdc_panel.c +2 -1
index 7b3650901930..b8dbcc2a4b7c 100644
@@ -25,6 +25,7 @@
 #include <drm/drm_atomic_helper.h>
 
 #include "tilcdc_drv.h"
+#include "tilcdc_panel.h"
 
 struct panel_module {
 	struct tilcdc_module base;
@@ -433,7 +434,7 @@ static struct of_device_id panel_of_match[] = {
 		{ },
 };
 
-struct platform_driver panel_driver = {
+static struct platform_driver panel_driver = {
 	.probe = panel_probe,
 	.remove = panel_remove,
 	.driver = {
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +2 -1
index c6a70da6473d..2247150f326a 100644
@@ -23,6 +23,7 @@
 #include <drm/drm_atomic_helper.h>
 
 #include "tilcdc_drv.h"
+#include "tilcdc_tfp410.h"
 
 struct tfp410_module {
 	struct tilcdc_module base;
@@ -382,7 +383,7 @@ static struct of_device_id tfp410_of_match[] = {
 		{ },
 };
 
-struct platform_driver tfp410_driver = {
+static struct platform_driver tfp410_driver = {
 	.probe = tfp410_probe,
 	.remove = tfp410_remove,
 	.driver = {
Signature · 6 lines
2.7.4

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

Re: [PATCH 14/14] drm/tilcdc: Fix sparse warnings

Quoted 10 lines · On 09/19/16 16:33, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

drm/tilcdc/tilcdc_tfp410.c:385:24: warning: symbol 'tfp410_driver' was not declared. Should it be static? drm/tilcdc/tilcdc_tfp410.c:395:12: warning: symbol 'tilcdc_tfp410_init' was not declared. Should it be static? drm/tilcdc/tilcdc_tfp410.c:400:13: warning: symbol 'tilcdc_tfp410_fini' was not declared. Should it be static? drm/tilcdc/tilcdc_panel.c:436:24: warning: symbol 'panel_driver' was not declared. Should it be static? drm/tilcdc/tilcdc_panel.c:446:12: warning: symbol 'tilcdc_panel_init' was not declared. Should it be static? drm/tilcdc/tilcdc_panel.c:451:13: warning: symbol 'tilcdc_panel_fini' was not declared. Should it be static? drm/tilcdc/tilcdc_drv.c:78:5: warning: symbol 'tilcdc_atomic_check' was not declared. Should it be static?

Quoted 3 lines
Cc Jyri Sarha <[email protected]>
Cc Tomi Valkeinen <[email protected]>

Thanks,
But I have picked already picked these two patches:

https://lists.freedesktop.org/archives/dri-devel/2016-September/117900.html

http://www.spinics.net/lists/kernel/msg2340400.html

I think, I'll send anothet pull request still to nininght to avoid more fixes being generated :).

Best regards,
Jyri

Quoted 56 lines
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c    | 4 ++--
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 3 ++-
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +2 -2
index f8892e9ad169..d6f8780e41df 100644
@@ -75,8 +75,8 @@ static void tilcdc_fb_output_poll_changed(struct drm_device *dev)
 	drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
 
-int tilcdc_atomic_check(struct drm_device *dev,
-			struct drm_atomic_state *state)
+static int tilcdc_atomic_check(struct drm_device *dev,
+			       struct drm_atomic_state *state)
 {
 	int ret;
 
drivers/gpu/drm/tilcdc/tilcdc_panel.c +2 -1
index 7b3650901930..b8dbcc2a4b7c 100644
@@ -25,6 +25,7 @@
 #include <drm/drm_atomic_helper.h>
 
 #include "tilcdc_drv.h"
+#include "tilcdc_panel.h"
 
 struct panel_module {
 	struct tilcdc_module base;
@@ -433,7 +434,7 @@ static struct of_device_id panel_of_match[] = {
 		{ },
 };
 
-struct platform_driver panel_driver = {
+static struct platform_driver panel_driver = {
 	.probe = panel_probe,
 	.remove = panel_remove,
 	.driver = {
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1 -0
index c6a70da6473d..2247150f326a 100644
@@ -23,6 +23,7 @@
 #include <drm/drm_atomic_helper.h>
 
 #include "tilcdc_drv.h"
+#include "tilcdc_tfp410.h"
 
 struct tfp410_module {
 	struct tilcdc_module base;

drivers/gpu/drm/tilcdc/tilcdc_tfp410.c static struct of_device_id tfp410_of_match[] = { · line 389

Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1 -1
@@ -382,7 +383,7 @@ static struct of_device_id tfp410_of_match[] = {
 		{ },
 };
 
-struct platform_driver tfp410_driver = {
+static struct platform_driver tfp410_driver = {
 	.probe = tfp410_probe,
 	.remove = tfp410_remove,
 	.driver = {

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