Skip to contentSkip to conversation

drm/hyperv: Remove unused variable

PATCH In review Pu Lehui 3 participants 7 messages Jun 9, 2021 – Jun 15, 2021

Subsystems (5)
lore
Share & tools
lore

Pu Lehui

author
#0 lore raw

PATCH 1/1 drm/hyperv: Remove unused variable

Fixes gcc '-Wunused-const-variable' warning:
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
'hyperv_modifiers' defined but not used [-Wunused-const-variable=]

---
 drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -5
index 02718e3e859e..3f83493909e6 100644
@@ -149,11 +149,6 @@ static const uint32_t hyperv_formats[] = {
 	DRM_FORMAT_XRGB8888,
 };
 
-static const uint64_t hyperv_modifiers[] = {
-	DRM_FORMAT_MOD_LINEAR,
-	DRM_FORMAT_MOD_INVALID
-};
-
 static inline int hyperv_pipe_init(struct hyperv_drm_device *hv)
 {
 	int ret;
Signature · 1 line
2.17.1
#1 lore raw

Hi

Am 09.06.21 um 04:49 schrieb Pu Lehui:

Quoted 14 lines

Fixes gcc '-Wunused-const-variable' warning:
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
'hyperv_modifiers' defined but not used [-Wunused-const-variable=]

---
  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -0
index 02718e3e859e..3f83493909e6 100644

drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static const uint32_t hyperv_formats[] = { · line 155

Quoted 7 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -4
@@ -149,11 +149,6 @@ static const uint32_t hyperv_formats[] = {
  	DRM_FORMAT_XRGB8888,
  };
 
-static const uint64_t hyperv_modifiers[] = {
-	DRM_FORMAT_MOD_LINEAR,
-	DRM_FORMAT_MOD_INVALID
-};

This constant should rather be used in the call to drm_simple_display_pipe_init(). [1]

Best regards
Thomas

[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c#n161

Quoted 5 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -1
-
  static inline int hyperv_pipe_init(struct hyperv_drm_device *hv)
  {
  	int ret;
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
#2 lore raw
Quoted 30 lines · Thomas Zimmermann

Hi

Am 09.06.21 um 04:49 schrieb Pu Lehui:

Quoted 19 lines

Fixes gcc '-Wunused-const-variable' warning:
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
     'hyperv_modifiers' defined but not used [-Wunused-const- variable=]

---
  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 -----

  1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -0
index 02718e3e859e..3f83493909e6 100644
@@ -149,11 +149,6 @@ static const uint32_t hyperv_formats[] = {
         DRM_FORMAT_XRGB8888,
   };

drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static const uint32_t hyperv_formats[] = { · line 155

Quoted 4 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -4
-static const uint64_t hyperv_modifiers[] = {
-       DRM_FORMAT_MOD_LINEAR,
-       DRM_FORMAT_MOD_INVALID
-};

This constant should rather be used in the call to drm_simple_display_pipe_init(). [1]

Quoted 7 lines

Best regards
Thomas

[1]
https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c#n161

Hi Pu,

Thanks for the patch. Is it possible to send another patch as per suggestion by Thomas. There is a kernel test robot failure as well.

Deepak

author
#3 lore raw
Quoted 39 lines · Deepak Rawat
Quoted 30 lines · Thomas Zimmermann

Hi

Am 09.06.21 um 04:49 schrieb Pu Lehui:

Quoted 16 lines

Fixes gcc '-Wunused-const-variable' warning:
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
     'hyperv_modifiers' defined but not used [-Wunused-const-
variable=]

---
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 -----
   1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -0
index 02718e3e859e..3f83493909e6 100644

drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static const uint32_t hyperv_formats[] = { · line 155

Quoted 7 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -4
@@ -149,11 +149,6 @@ static const uint32_t hyperv_formats[] = {
         DRM_FORMAT_XRGB8888,
   };
 
-static const uint64_t hyperv_modifiers[] = {
-       DRM_FORMAT_MOD_LINEAR,
-       DRM_FORMAT_MOD_INVALID
-};

This constant should rather be used in the call to drm_simple_display_pipe_init(). [1]

Quoted 7 lines

Best regards
Thomas

[1]
https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c#n161

Quoted 9 lines

Hi Pu,

Thanks for the patch. Is it possible to send another patch as per suggestion by Thomas. There is a kernel test robot failure as well.

Deepak

.

Hi Deepak,

Thanks for your reply, I will send v2 soon.

Best regards
Lehui

author
#4 lore raw
In reply to Thomas Zimmermann
Quoted 26 lines · Thomas Zimmermann

Hi

Am 09.06.21 um 04:49 schrieb Pu Lehui:

Quoted 14 lines

Fixes gcc '-Wunused-const-variable' warning:
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
     'hyperv_modifiers' defined but not used [-Wunused-const-variable=]

---
  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 -----

  1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -0
index 02718e3e859e..3f83493909e6 100644

drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static const uint32_t hyperv_formats[] = { · line 154

Quoted 6 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -4
@@ -149,11 +149,6 @@ static const uint32_t hyperv_formats[] = {
       DRM_FORMAT_XRGB8888,
   };
-static const uint64_t hyperv_modifiers[] = {
-    DRM_FORMAT_MOD_LINEAR,
-    DRM_FORMAT_MOD_INVALID
-};

This constant should rather be used in the call to drm_simple_display_pipe_init(). [1]

Quoted 13 lines

Best regards
Thomas

[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c#n161

Quoted 5 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0 -1
-
   static inline int hyperv_pipe_init(struct hyperv_drm_device *hv)
   {
       int ret;
 

Hi Thomas,

Thanks for your suggestion, I will fix it in v2.

Best regards
Lehui

author
#5 lore raw

PATCH v2 1/1 drm/hyperv: Fix unused const variable 'hyperv_modifiers'

In reply to Pu Lehui

There is a gcc '-Wunused-const-variable' warning:
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
'hyperv_modifiers' defined but not used [-Wunused-const-variable=]

while the variable should be used in drm_simple_display_pipe_init() as suggested by Thomas, let's fix it.

Fixes 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
---
 drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +1 -1
index 02718e3e859e..3aaee4730ec6 100644
@@ -163,7 +163,7 @@ static inline int hyperv_pipe_init(struct hyperv_drm_device *hv)
 					   &hyperv_pipe_funcs,
 					   hyperv_formats,
 					   ARRAY_SIZE(hyperv_formats),
-					   NULL,
+					   hyperv_modifiers,
 					   &hv->connector);
 	if (ret)
 		return ret;
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH v2 -next] drm/hyperv: Fix unused const variable 'hyperv_modifiers'

Hi

Am 15.06.21 um 05:14 schrieb Pu Lehui:

Quoted 6 lines

There is a gcc '-Wunused-const-variable' warning:
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:152:23: warning:
'hyperv_modifiers' defined but not used [-Wunused-const-variable=]

while the variable should be used in drm_simple_display_pipe_init() as suggested by Thomas, let's fix it.

Thanks a lot! I added your patch to drm-misc-next-fixes.

Best regards
Thomas

Quoted 21 lines
Fixes 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
---
  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +1 -1
index 02718e3e859e..3aaee4730ec6 100644
@@ -163,7 +163,7 @@ static inline int hyperv_pipe_init(struct hyperv_drm_device *hv)
  					   &hyperv_pipe_funcs,
  					   hyperv_formats,
  					   ARRAY_SIZE(hyperv_formats),
-					   NULL,
+					   hyperv_modifiers,
  					   &hv->connector);
  	if (ret)
  		return ret;
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