Skip to contentSkip to conversation

drm/nouveau: change base917c_format from global to static

PATCH In review Tom Rix 2 participants 2 messages Apr 18, 2022

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 drm/nouveau: change base917c_format from global to static

Smatch reports this issue
base917c.c:26:1: warning: symbol 'base917c_format'
was not declared. Should it be static?

base917c_format is only used in base917.c. Single file variables should not be global so change base917c_format's storage-class specifier to static.

---
 drivers/gpu/drm/nouveau/dispnv50/base917c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv50/base917c.c +1 -1
index a1baed4fe0e9..ca260509a4f1 100644
@@ -22,7 +22,7 @@
 #include "base.h"
 #include "atom.h"
 
-const u32
+static const u32
 base917c_format[] = {
 	DRM_FORMAT_C8,
 	DRM_FORMAT_XRGB8888,
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Will push this to the appropriate branch in a little bit

Quoted 27 lines · Tom Rix

Smatch reports this issue
base917c.c:26:1: warning: symbol 'base917c_format' was not declared. Should it be static?

base917c_format is only used in base917.c.  Single file variables should not be global so change base917c_format's storage-class specifier to static.

---
 drivers/gpu/drm/nouveau/dispnv50/base917c.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv50/base917c.c +0 -0
index a1baed4fe0e9..ca260509a4f1 100644
@@ -22,7 +22,7 @@
  #include "base.h"
  #include "atom.h"

drivers/gpu/drm/nouveau/dispnv50/base917c.c +1 -1
-const u32
+static const u32

 base917c_format[] = {
        DRM_FORMAT_C8,
        DRM_FORMAT_XRGB8888,

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