* [PATCH] drm/nouveau/kms/nv50: hide unused variables
@ 2023-09-25 15:59 Arnd Bergmann
2023-09-25 22:06 ` [Nouveau] " Danilo Krummrich
2023-09-27 16:07 ` Danilo Krummrich
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-09-25 15:59 UTC (permalink / raw)
To: Karol Herbst, Lyude Paul, David Airlie, Daniel Vetter,
Danilo Krummrich, Ben Skeggs
Cc: Arnd Bergmann, Wayne Lin, dri-devel, nouveau, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 52f1569ee37c1..a0ac8c258d9ff 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -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.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau/kms/nv50: hide unused variables
2023-09-25 15:59 [PATCH] drm/nouveau/kms/nv50: hide unused variables Arnd Bergmann
@ 2023-09-25 22:06 ` Danilo Krummrich
2023-09-27 16:07 ` Danilo Krummrich
1 sibling, 0 replies; 3+ messages in thread
From: Danilo Krummrich @ 2023-09-25 22:06 UTC (permalink / raw)
To: Arnd Bergmann, Karol Herbst, Lyude Paul, David Airlie,
Daniel Vetter
Cc: nouveau, linux-kernel, dri-devel, Arnd Bergmann, Wayne Lin,
Danilo Krummrich
On 9/25/23 17:59, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Danilo Krummrich <dakr@redhat.com>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 52f1569ee37c1..a0ac8c258d9ff 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau/kms/nv50: hide unused variables
2023-09-25 15:59 [PATCH] drm/nouveau/kms/nv50: hide unused variables Arnd Bergmann
2023-09-25 22:06 ` [Nouveau] " Danilo Krummrich
@ 2023-09-27 16:07 ` Danilo Krummrich
1 sibling, 0 replies; 3+ messages in thread
From: Danilo Krummrich @ 2023-09-27 16:07 UTC (permalink / raw)
To: Arnd Bergmann, Karol Herbst, Lyude Paul, David Airlie,
Daniel Vetter, Danilo Krummrich, Ben Skeggs
Cc: nouveau, linux-kernel, dri-devel, Arnd Bergmann, Wayne Lin
On 9/25/23 17:59, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to drm-misc-next, thanks!
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 52f1569ee37c1..a0ac8c258d9ff 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -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)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-27 16:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 15:59 [PATCH] drm/nouveau/kms/nv50: hide unused variables Arnd Bergmann
2023-09-25 22:06 ` [Nouveau] " Danilo Krummrich
2023-09-27 16:07 ` Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).