Skip to contentSkip to conversation

drm/vc4: Remove unused variables

PATCH In review Tian Tao 3 participants 3 messages Sep 10, 2020 – Sep 14, 2020

Subsystems (3)
lore
Share & tools
lore

Tian Tao

author
#0 lore raw

PATCH 1/1 drm/vc4: Remove unused variables

Fixes the following W=1 kernel build warning(s):
vc4_plane.c: In function ‘vc4_plane_init’:
vc4_plane.c:1340:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

---
 drivers/gpu/drm/vc4/vc4_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_plane.c +1 -2
index 24d7e6d..5be0f5dda 100644
@@ -1337,7 +1337,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
 	struct drm_plane *plane = NULL;
 	struct vc4_plane *vc4_plane;
 	u32 formats[ARRAY_SIZE(hvs_formats)];
-	int ret = 0;
 	unsigned i;
 	static const uint64_t modifiers[] = {
 		DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
@@ -1357,7 +1356,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
 		formats[i] = hvs_formats[i].drm;
 
 	plane = &vc4_plane->base;
-	ret = drm_universal_plane_init(dev, plane, 0,
+	drm_universal_plane_init(dev, plane, 0,
 				       &vc4_plane_funcs,
 				       formats, ARRAY_SIZE(formats),
 				       modifiers, type, NULL);
Signature · 6 lines
2.7.4

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

Hi

Am 09.09.20 um 09:33 schrieb Tian Tao:

Quoted 23 lines

Fixes the following W=1 kernel build warning(s):
vc4_plane.c: In function ‘vc4_plane_init’:
vc4_plane.c:1340:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

---
 drivers/gpu/drm/vc4/vc4_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_plane.c +0 -1
index 24d7e6d..5be0f5dda 100644
@@ -1337,7 +1337,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
 	struct drm_plane *plane = NULL;
 	struct vc4_plane *vc4_plane;
 	u32 formats[ARRAY_SIZE(hvs_formats)];
-	int ret = 0;
 	unsigned i;
 	static const uint64_t modifiers[] = {
 		DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,

drivers/gpu/drm/vc4/vc4_plane.c struct drm_plane *vc4_plane_init(struct drm_device *dev, · line 1362

Quoted 8 lines
drivers/gpu/drm/vc4/vc4_plane.c +1 -1
@@ -1357,7 +1356,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
 		formats[i] = hvs_formats[i].drm;
 
 	plane = &vc4_plane->base;
-	ret = drm_universal_plane_init(dev, plane, 0,
+	drm_universal_plane_init(dev, plane, 0,
 				       &vc4_plane_funcs,
 				       formats, ARRAY_SIZE(formats),
 				       modifiers, type, NULL);

IMHO vc4_plane_init() should rather handle ret correctly and return an error if it's non-zero.

Best regards
Thomas

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

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

#2 lore raw

Hi Thomas:

Quoted 28 lines · Thomas Zimmermann

Hi

Am 09.09.20 um 09:33 schrieb Tian Tao:

Quoted 25 lines

Fixes the following W=1 kernel build warning(s):
vc4_plane.c: In function ‘vc4_plane_init’:
vc4_plane.c:1340:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

---
  drivers/gpu/drm/vc4/vc4_plane.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_plane.c +0 -1
index 24d7e6d..5be0f5dda 100644
@@ -1337,7 +1337,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
  	struct drm_plane *plane = NULL;
  	struct vc4_plane *vc4_plane;
  	u32 formats[ARRAY_SIZE(hvs_formats)];
-	int ret = 0;
  	unsigned i;
  	static const uint64_t modifiers[] = {
  		DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
@@ -1357,7 +1356,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
  		formats[i] = hvs_formats[i].drm;
 
Quoted 9 lines

drivers/gpu/drm/vc4/vc4_plane.c struct drm_plane *vc4_plane_init(struct drm_device *dev, · line 1362

Quoted 6 lines
drivers/gpu/drm/vc4/vc4_plane.c +1 -1
  	plane = &vc4_plane->base;
-	ret = drm_universal_plane_init(dev, plane, 0,
+	drm_universal_plane_init(dev, plane, 0,
  				       &vc4_plane_funcs,
  				       formats, ARRAY_SIZE(formats),
  				       modifiers, type, NULL);

IMHO vc4_plane_init() should rather handle ret correctly and return an error if it's non-zero.

Thanks for the advice, I'm dropping the patch and re-posting anoher patch to fix this warning.

Quoted 6 lines

Best regards
Thomas

Quoted 1 line

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