Skip to contentSkip to conversation

drm/nouveau/disp/gv100: make gv100_disp_wndw and gv100_disp_wndw_mthd static

PATCH In review Tom Rix 2 participants 2 messages Apr 25, 2022 – Apr 26, 2022

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 drm/nouveau/disp/gv100: make gv100_disp_wndw and gv100_disp_wndw_mthd static

Sparse reports these issues
wndwgv100.c:120:1: warning: symbol 'gv100_disp_wndw_mthd' was not declared. Should it be static? wndwgv100.c:140:1: warning: symbol 'gv100_disp_wndw' was not declared. Should it be static?

These variable are only used in wndwgv100.c. Single file variables should be static. So use static as their storage-class specifiers.

---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c +2 -2
index 5d3b641dbb14..e635247d794f 100644
@@ -116,7 +116,7 @@ gv100_disp_wndw_mthd_base = {
 	}
 };
 
-const struct nv50_disp_chan_mthd
+static const struct nv50_disp_chan_mthd
 gv100_disp_wndw_mthd = {
 	.name = "Window",
 	.addr = 0x001000,
@@ -136,7 +136,7 @@ gv100_disp_wndw_intr(struct nv50_disp_chan *chan, bool en)
 	nvkm_mask(device, 0x611da4, mask, data);
 }
 
-const struct nv50_disp_chan_func
+static const struct nv50_disp_chan_func
 gv100_disp_wndw = {
 	.init = gv100_disp_dmac_init,
 	.fini = gv100_disp_dmac_fini,
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Will push upstream in a moment

Quoted 39 lines · Tom Rix

Sparse reports these issues
wndwgv100.c:120:1: warning: symbol 'gv100_disp_wndw_mthd' was not declared. Should it be static?
wndwgv100.c:140:1: warning: symbol 'gv100_disp_wndw' was not declared. Should it be static?

These variable are only used in wndwgv100.c.  Single file variables should be static.
So use static as their storage-class specifiers.

---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c +0 -0
index 5d3b641dbb14..e635247d794f 100644
@@ -116,7 +116,7 @@ gv100_disp_wndw_mthd_base = {
         }
  };

drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c +1 -1
-const struct nv50_disp_chan_mthd
+static const struct nv50_disp_chan_mthd

 gv100_disp_wndw_mthd = {
        .name = "Window",
        .addr = 0x001000,

drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c +0 -0
@@ -136,7 +136,7 @@ gv100_disp_wndw_intr(struct nv50_disp_chan *chan, bool
 en)
         nvkm_mask(device, 0x611da4, mask, data);
  }

drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c +1 -1
-const struct nv50_disp_chan_func
+static const struct nv50_disp_chan_func

 gv100_disp_wndw = {
        .init = gv100_disp_dmac_init,
        .fini = gv100_disp_dmac_fini,

Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat