Message ID | 20210913024534.26161-1-tangyizhou@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/memory_hotplug: Add static qualifier for online_policy_to_str | expand |
On Mon, Sep 13, 2021 at 10:26 AM Tang Yizhou <tangyizhou@huawei.com> wrote: > > online_policy_to_str is only used in memory_hotplug.c and should be > defined as static. > > Signed-off-by: Tang Yizhou <tangyizhou@huawei.com> LGTM. Reviewed-by: Muchun Song <songmuchun@bytedance.com>
On 13.09.21 04:45, Tang Yizhou wrote: > online_policy_to_str is only used in memory_hotplug.c and should be > defined as static. > > Signed-off-by: Tang Yizhou <tangyizhou@huawei.com> > --- > mm/memory_hotplug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 0488eed3327c..4ea91c3ff768 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -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 Reviewed-by: David Hildenbrand <david@redhat.com>
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0488eed3327c..4ea91c3ff768 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -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", };
online_policy_to_str is only used in memory_hotplug.c and should be defined as static. Signed-off-by: Tang Yizhou <tangyizhou@huawei.com> --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)