mm: remove redundant static variable initializations
Subsystems (3)
cover mm: remove redundant static variable initializations
This series removes explicit initializations of static bool variables to false within the mm/ subsystem. In C, static variables without explicit initialization are implicitly placed in the .bss section and initialized to zero/false by default. Removing these explicit initializations follows the Linux kernel coding style and avoids cluttering the data section.
Igor Putko (2):
mm/kasan: remove redundant initialization for kasan_flag_write_only mm/memory-failure: remove redundant initialization for
hw_memory_failure
mm/kasan/hw_tags.c | 2 +- mm/memory-failure.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 mm/kasan: remove redundant initialization for kasan_flag_write_only
The static variable 'kasan_flag_write_only' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.
--- mm/kasan/hw_tags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kasan/hw_tags.c +1 -1
@@ -61,7 +61,7 @@ DEFINE_STATIC_KEY_FALSE(kasan_flag_vmalloc);EXPORT_SYMBOL_GPL (kasan_flag_vmalloc);/* Whether to check write accesses only. */ -static bool kasan_flag_write_only = false; +static bool kasan_flag_write_only;#define PAGE_ALLOC_SAMPLE_DEFAULT 1#define PAGE_ALLOC_SAMPLE_ORDER_DEFAULT 3
Signature · 1 line
2.34.1
Re: [PATCH 1/2] mm/kasan: remove redundant initialization for kasan_flag_write_only
Quoted 5 lines · On Tue, 23 Jun 2026 14:47:42 +0300 Igor Putko <[email protected]> wrote:
The static variable '
kasan_flag_write_only' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.Signed-off-by Igor Putko <[email protected]>
Thanks,
SJ
[...]
Re: [PATCH 1/2] mm/kasan: remove redundant initialization for kasan_flag_write_only
In reply to Igor PutkoQuoted 6 lines · Igor Putko
The static variable '
kasan_flag_write_only' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.Signed-off-by Igor Putko <[email protected]>---
Thanks.
PATCH 2/2 mm/memory-failure: remove redundant initialization for hw_memory_failure
In reply to Igor PutkoThe static variable 'hw_memory_failure' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.
--- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory-failure.c +1 -1
@@ -76,7 +76,7 @@ static int sysctl_enable_soft_offline __read_mostly = 1;atomic_long_t num_poisoned_pages__read_mostly =ATOMIC_LONG_INIT (0 ); -static bool hw_memory_failure__read_mostly = false; +static bool hw_memory_failure__read_mostly ;static DEFINE_MUTEX (mf_mutex);
Signature · 1 line
2.34.1
Re: [PATCH 2/2] mm/memory-failure: remove redundant initialization for hw_memory_failure
Quoted 5 lines · On Tue, 23 Jun 2026 14:47:43 +0300 Igor Putko <[email protected]> wrote:
The static variable '
hw_memory_failure' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.Signed-off-by Igor Putko <[email protected]>
Thanks,
SJ
[...]
Re: [PATCH 2/2] mm/memory-failure: remove redundant initialization for hw_memory_failure
In reply to Igor PutkoQuoted 6 lines · Igor Putko
The static variable '
hw_memory_failure' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.Signed-off-by Igor Putko <[email protected]>---
Thanks.
Re: [PATCH 2/2] mm/memory-failure: remove redundant initialization for hw_memory_failure
In reply to Igor PutkoQuoted 5 lines · Igor Putko
The static variable '
hw_memory_failure' is implicitly initialized to false. Remove the explicit initialization to follow the Linux kernel coding style.Signed-off-by Igor Putko <[email protected]>
Thanks.
.