Skip to contentSkip to conversation

drm/nouveau/kms/nv50: hide unused variables

PATCH Applied Arnd Bergmann 2 participants 3 messages Sep 25, 2023 – Sep 27, 2023

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

PATCH 1/1 drm/nouveau/kms/nv50: hide unused variables

From: Arnd Bergmann <[email protected]>

After a recent change, two variables are only used in an #ifdef:

drivers/gpu/drm/nouveau/dispnv50/disp.c: In function 'nv50_sor_atomic_disable':
drivers/gpu/drm/nouveau/dispnv50/disp.c:1569:13: error: unused variable 'ret' [-Werror=unused-variable]
1569 | int ret;
| ^~~
drivers/gpu/drm/nouveau/dispnv50/disp.c:1568:28: error: unused variable 'aux' [-Werror=unused-variable]
1568 | struct drm_dp_aux *aux = &nv_connector->aux;
| ^~~

Move them into the same conditional block, along with the nv_connector variable that becomes unused during that fix.

Fixes 757033808c95b ("drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link")
---
 drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -3
index 52f1569ee37c1..a0ac8c258d9ff 100644
@@ -1560,15 +1560,13 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st
 {
 	struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
 	struct nv50_head *head = nv50_head(nv_encoder->crtc);
-	struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder);
 #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
+	struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder);
 	struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
 	struct nouveau_backlight *backlight = nv_connector->backlight;
-#endif
 	struct drm_dp_aux *aux = &nv_connector->aux;
 	int ret;
 
-#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
 	if (backlight && backlight->uses_dpcd) {
 		ret = drm_edp_backlight_disable(aux, &backlight->edp_info);
 		if (ret < 0)
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

After a recent change, two variables are only used in an #ifdef:

drivers/gpu/drm/nouveau/dispnv50/disp.c: In function 'nv50_sor_atomic_disable':
drivers/gpu/drm/nouveau/dispnv50/disp.c:1569:13: error: unused variable 'ret' [-Werror=unused-variable]
1569 | int ret;
| ^~~
drivers/gpu/drm/nouveau/dispnv50/disp.c:1568:28: error: unused variable 'aux' [-Werror=unused-variable]
1568 | struct drm_dp_aux *aux = &nv_connector->aux;
| ^~~

Quoted 5 lines

Move them into the same conditional block, along with the nv_connector variable that becomes unused during that fix.

Fixes 757033808c95b ("drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link")
Quoted 25 lines
---
  drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -3
index 52f1569ee37c1..a0ac8c258d9ff 100644
@@ -1560,15 +1560,13 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st
  {
  	struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
  	struct nv50_head *head = nv50_head(nv_encoder->crtc);
-	struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder);
  #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
+	struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder);
  	struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
  	struct nouveau_backlight *backlight = nv_connector->backlight;
-#endif
  	struct drm_dp_aux *aux = &nv_connector->aux;
  	int ret;
 
-#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
  	if (backlight && backlight->uses_dpcd) {
  		ret = drm_edp_backlight_disable(aux, &backlight->edp_info);
  		if (ret < 0)
#2 lore raw
In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

After a recent change, two variables are only used in an #ifdef:

drivers/gpu/drm/nouveau/dispnv50/disp.c: In function 'nv50_sor_atomic_disable':
drivers/gpu/drm/nouveau/dispnv50/disp.c:1569:13: error: unused variable 'ret' [-Werror=unused-variable]
1569 | int ret;
| ^~~
drivers/gpu/drm/nouveau/dispnv50/disp.c:1568:28: error: unused variable 'aux' [-Werror=unused-variable]
1568 | struct drm_dp_aux *aux = &nv_connector->aux;
| ^~~

Quoted 5 lines

Move them into the same conditional block, along with the nv_connector variable that becomes unused during that fix.

Fixes 757033808c95b ("drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link")

Applied to drm-misc-next, thanks!

Quoted 25 lines
---
  drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -3
index 52f1569ee37c1..a0ac8c258d9ff 100644
@@ -1560,15 +1560,13 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st
  {
  	struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
  	struct nv50_head *head = nv50_head(nv_encoder->crtc);
-	struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder);
  #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
+	struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder);
  	struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
  	struct nouveau_backlight *backlight = nv_connector->backlight;
-#endif
  	struct drm_dp_aux *aux = &nv_connector->aux;
  	int ret;
 
-#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
  	if (backlight && backlight->uses_dpcd) {
  		ret = drm_edp_backlight_disable(aux, &backlight->edp_info);
  		if (ret < 0)