* [PATCH] mm: page_alloc: set sysctl_lowmem_reserve_ratio storage-class-specifier to static
@ 2023-05-18 14:11 Tom Rix
2023-05-19 1:19 ` Kefeng Wang
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-05-18 14:11 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, Tom Rix
smatch reports
mm/page_alloc.c:247:5: warning: symbol
'sysctl_lowmem_reserve_ratio' was not declared. Should it be static?
This variable is only used in its defining file, so it should be static
Signed-off-by: Tom Rix <trix@redhat.com>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 1023f41de2fb..8032fffa425a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -244,7 +244,7 @@ static void __free_pages_ok(struct page *page, unsigned int order,
* TBD: should special case ZONE_DMA32 machines here - in those we normally
* don't need any ZONE_NORMAL reservation
*/
-int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES] = {
+static int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES] = {
#ifdef CONFIG_ZONE_DMA
[ZONE_DMA] = 256,
#endif
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: page_alloc: set sysctl_lowmem_reserve_ratio storage-class-specifier to static
2023-05-18 14:11 [PATCH] mm: page_alloc: set sysctl_lowmem_reserve_ratio storage-class-specifier to static Tom Rix
@ 2023-05-19 1:19 ` Kefeng Wang
0 siblings, 0 replies; 2+ messages in thread
From: Kefeng Wang @ 2023-05-19 1:19 UTC (permalink / raw)
To: Tom Rix, akpm; +Cc: linux-mm, linux-kernel
On 2023/5/18 22:11, Tom Rix wrote:
> smatch reports
> mm/page_alloc.c:247:5: warning: symbol
> 'sysctl_lowmem_reserve_ratio' was not declared. Should it be static?
>
> This variable is only used in its defining file, so it should be static
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> mm/page_alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Missing this one, Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 1023f41de2fb..8032fffa425a 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -244,7 +244,7 @@ static void __free_pages_ok(struct page *page, unsigned int order,
> * TBD: should special case ZONE_DMA32 machines here - in those we normally
> * don't need any ZONE_NORMAL reservation
> */
> -int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES] = {
> +static int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES] = {
> #ifdef CONFIG_ZONE_DMA
> [ZONE_DMA] = 256,
> #endif
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-19 1:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 14:11 [PATCH] mm: page_alloc: set sysctl_lowmem_reserve_ratio storage-class-specifier to static Tom Rix
2023-05-19 1:19 ` Kefeng Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox