Skip to contentSkip to conversation

mm/memory_hotplug: Add static qualifier for online_policy_to_str

PATCH Applied Tang Yizhou 3 participants 3 messages Sep 13, 2021

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

PATCH 1/1 mm/memory_hotplug: Add static qualifier for online_policy_to_str

online_policy_to_str is only used in memory_hotplug.c and should be defined as static.

---
 mm/memory_hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory_hotplug.c +1 -1
index 0488eed3327c..4ea91c3ff768 100644
@@ -57,7 +57,7 @@ enum {
 	ONLINE_POLICY_AUTO_MOVABLE,
 };
 
-const char *online_policy_to_str[] = {
+static const char * const online_policy_to_str[] = {
 	[ONLINE_POLICY_CONTIG_ZONES] = "contig-zones",
 	[ONLINE_POLICY_AUTO_MOVABLE] = "auto-movable",
 };
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Tang Yizhou
Quoted 14 lines · Tang Yizhou

online_policy_to_str is only used in memory_hotplug.c and should be defined as static.

---
  mm/memory_hotplug.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory_hotplug.c +0 -0
index 0488eed3327c..4ea91c3ff768 100644

mm/memory_hotplug.c enum { · line 63

Quoted 8 lines
mm/memory_hotplug.c +1 -1
@@ -57,7 +57,7 @@ enum {
  	ONLINE_POLICY_AUTO_MOVABLE,
  };
 
-const char *online_policy_to_str[] = {
+static const char * const online_policy_to_str[] = {
  	[ONLINE_POLICY_CONTIG_ZONES] = "contig-zones",
  	[ONLINE_POLICY_AUTO_MOVABLE] = "auto-movable",
  };

Indeed, thanks

Signature · 3 lines
Thanks,

David / dhildenb