* [PATCH] mm/memory_hotplug: Add static qualifier for online_policy_to_str
@ 2021-09-13 2:45 Tang Yizhou
2021-09-13 3:20 ` Muchun Song
2021-09-13 8:39 ` David Hildenbrand
0 siblings, 2 replies; 3+ messages in thread
From: Tang Yizhou @ 2021-09-13 2:45 UTC (permalink / raw)
To: david; +Cc: osalvador, mhocko, akpm, linux-mm, linux-kernel, tangyizhou
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",
};
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/memory_hotplug: Add static qualifier for online_policy_to_str
2021-09-13 2:45 [PATCH] mm/memory_hotplug: Add static qualifier for online_policy_to_str Tang Yizhou
@ 2021-09-13 3:20 ` Muchun Song
2021-09-13 8:39 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2021-09-13 3:20 UTC (permalink / raw)
To: Tang Yizhou
Cc: David Hildenbrand, Oscar Salvador, Michal Hocko, Andrew Morton,
Linux Memory Management List, LKML
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/memory_hotplug: Add static qualifier for online_policy_to_str
2021-09-13 2:45 [PATCH] mm/memory_hotplug: Add static qualifier for online_policy_to_str Tang Yizhou
2021-09-13 3:20 ` Muchun Song
@ 2021-09-13 8:39 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2021-09-13 8:39 UTC (permalink / raw)
To: Tang Yizhou; +Cc: osalvador, mhocko, akpm, linux-mm, linux-kernel
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>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-13 8:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 2:45 [PATCH] mm/memory_hotplug: Add static qualifier for online_policy_to_str Tang Yizhou
2021-09-13 3:20 ` Muchun Song
2021-09-13 8:39 ` David Hildenbrand
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).