Skip to contentSkip to conversation

drm/rockchip: fix some sparse warnings

PATCH In review John Keeping 2 participants 5 messages May 10, 2016 – May 23, 2016

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

cover drm/rockchip: fix some sparse warnings

The first patch wasn't found by sparse, but is something I noticed while in the area. The following two fix all of the sparse warnings inside drm/rockchip.

John Keeping (3):
drm/rockchip: dw_hdmi: remove unused #include drm/rockchip: fb: add missing header drm/rockchip: fix "should it be static?" warnings

 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c  | 7 ++++---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.8.2.565.gdb84f68.dirty
#1 lore raw

PATCH 1/3 drm/rockchip: dw_hdmi: remove unused #include

drm_encoder_slave is not used in this file.

---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +0 -1
index 801110f65a63..0665fb915579 100644
@@ -15,7 +15,6 @@
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_encoder_slave.h>
 #include <drm/bridge/dw_hdmi.h>
 
 #include "rockchip_drm_drv.h"
Signature · 1 line
2.8.2.565.gdb84f68.dirty
#2 lore raw

PATCH 2/3 drm/rockchip: fb: add missing header

In reply to John Keeping

This fixes the following sparse warnings:

drivers/gpu/drm/rockchip/rockchip_drm_fb.c:32:23: warning: symbol 'rockchip_fb_get_gem_obj' was not declared. Should it be static? drivers/gpu/drm/rockchip/rockchip_drm_fb.c:315:24: warning: symbol 'rockchip_drm_framebuffer_init' was not declared. Should it be static? drivers/gpu/drm/rockchip/rockchip_drm_fb.c:329:6: warning: symbol 'rockchip_drm_mode_config_init' was not declared. Should it be static?

---
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rockchip/rockchip_drm_fb.c +1 -0
index 8c10163a95bc..85aa87ee12f5 100644
@@ -20,6 +20,7 @@
 #include <drm/drm_crtc_helper.h>
 
 #include "rockchip_drm_drv.h"
+#include "rockchip_drm_fb.h"
 #include "rockchip_drm_gem.h"
 
 #define to_rockchip_fb(x) container_of(x, struct rockchip_drm_fb, fb)
Signature · 1 line
2.8.2.565.gdb84f68.dirty
#3 lore raw

PATCH 3/3 drm/rockchip: fix "should it be static?" warnings

In reply to John Keeping

Combined with the previous commit, this fixes all of the sparse warnings in drm/rockchip.

---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c  | 6 +++---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +2 -2
index 399adf3c4224..b253f65c3e14 100644
@@ -287,7 +287,7 @@ static void rockchip_drm_preclose(struct drm_device *dev,
 		rockchip_drm_crtc_cancel_pending_vblank(crtc, file_priv);
 }
 
-void rockchip_drm_lastclose(struct drm_device *dev)
+static void rockchip_drm_lastclose(struct drm_device *dev)
 {
 	struct rockchip_drm_private *priv = dev->dev_private;
 
@@ -307,7 +307,7 @@ static const struct file_operations rockchip_drm_driver_fops = {
 	.release = drm_release,
 };
 
-const struct vm_operations_struct rockchip_drm_vm_ops = {
+static const struct vm_operations_struct rockchip_drm_vm_ops = {
 	.open = drm_gem_vm_open,
 	.close = drm_gem_vm_close,
 };
drivers/gpu/drm/rockchip/rockchip_drm_fb.c +3 -3
index 85aa87ee12f5..96d91f16e001 100644
@@ -275,9 +275,9 @@ void rockchip_drm_atomic_work(struct work_struct *work)
 	rockchip_atomic_commit_complete(commit);
 }
 
-int rockchip_drm_atomic_commit(struct drm_device *dev,
-			       struct drm_atomic_state *state,
-			       bool nonblock)
+static int rockchip_drm_atomic_commit(struct drm_device *dev,
+				      struct drm_atomic_state *state,
+				      bool nonblock)
 {
 	struct rockchip_drm_private *private = dev->dev_private;
 	struct rockchip_atomic_commit *commit = &private->commit;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -2
index bf55cda356ba..949171a80631 100644
@@ -779,7 +779,7 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = {
 	.atomic_disable = vop_plane_atomic_disable,
 };
 
-void vop_atomic_plane_reset(struct drm_plane *plane)
+static void vop_atomic_plane_reset(struct drm_plane *plane)
 {
 	struct vop_plane_state *vop_plane_state =
 					to_vop_plane_state(plane->state);
@@ -796,7 +796,7 @@ void vop_atomic_plane_reset(struct drm_plane *plane)
 	plane->state->plane = plane;
 }
 
-struct drm_plane_state *
+static struct drm_plane_state *
 vop_atomic_plane_duplicate_state(struct drm_plane *plane)
 {
 	struct vop_plane_state *old_vop_plane_state;
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1 -1
index 3166b46a5893..52661d116ec2 100644
@@ -299,7 +299,7 @@ static int vop_remove(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver vop_platform_driver = {
+static struct platform_driver vop_platform_driver = {
 	.probe = vop_probe,
 	.remove = vop_remove,
 	.driver = {
Signature · 1 line
2.8.2.565.gdb84f68.dirty
#4 lore raw
In reply to John Keeping
Quoted 9 lines · John Keeping

The first patch wasn't found by sparse, but is something I noticed while in the area. The following two fix all of the sparse warnings inside drm/rockchip.

John Keeping (3):
drm/rockchip: dw_hdmi: remove unused #include drm/rockchip: fb: add missing header drm/rockchip: fix "should it be static?" warnings

Quoted 7 lines
  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 -
  drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
  drivers/gpu/drm/rockchip/rockchip_drm_fb.c  | 7 ++++---
  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
  drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 +-
  5 files changed, 9 insertions(+), 9 deletions(-)

Hi John

Sorry for reply late, this series of patches looks good for me, Applied to my branch.

Thanks.

Signature · 1 line
?ark Yao