mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
PATCH v2 1/1 mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
The default value of static variable is zero and bool is false so not need to set it here.
This patch fixes this ERROR in memblock.c
Error found with checkpatch.pl.
---
Changes in v2: Correct the subject line and remove <stdbool.h> which isn't necessary
mm/memblock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/memblock.c +3 -3
@@ -152,10 +152,10 @@ static __refdata struct memblock_type *memblock_memory = &memblock.memory; }while (0 ) static int memblock_debug __initdata_memblock; -static bool system_has_some_mirror __initdata_memblock = false; +static bool system_has_some_mirror __initdata_memblock; static int memblock_can_resize __initdata_memblock; -static int memblock_memory_in_slab __initdata_memblock = 0; -static int memblock_reserved_in_slab __initdata_memblock = 0; +static int memblock_memory_in_slab __initdata_memblock; +static int memblock_reserved_in_slab __initdata_memblock; static enum memblock_flags __init_memblock choose_memblock_flags(void) {
Signature · 1 line
2.25.1
Mike Rapoport
maintainerHi,
Quoted 1 line · Kushal Kothari
Subject: mm: Fix ERROR:do not initialise statics to 0 or NULL in
memblock.c
Please use mm/memblock: or just memblock: prefix for memblock patches. Besides, this patch does not fix a real error, it's only style fixup, so "Fix ERROR" should be omitted here.
Quoted 4 lines
The default value of static variable is zero and bool is false so not need to set it here.
This patch fixes this ERROR inmemblock.c
Error found with checkpatch.pl.
Again, this is not a real error in the code but rather a coding style inconsistency. Please update the changelog text to reflect this.
Quoted 30 lines
Signed-off-by Kushal Kothari <[email protected]>---
Changes in v2: Correct the subject line and remove <
stdbool.h> which isn't necessarymm/memblock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)mm/memblock.c +3
-3@@ -152,10 +152,10 @@ static __refdata struct memblock_type *memblock_memory = &memblock.memory; }while (0 ) static int memblock_debug __initdata_memblock; -static bool system_has_some_mirror __initdata_memblock = false; +static bool system_has_some_mirror __initdata_memblock; static int memblock_can_resize __initdata_memblock; -static int memblock_memory_in_slab __initdata_memblock = 0; -static int memblock_reserved_in_slab __initdata_memblock = 0; +static int memblock_memory_in_slab __initdata_memblock; +static int memblock_reserved_in_slab __initdata_memblock; static enum memblock_flags __init_memblock choose_memblock_flags(void) {Signature · 1 line
2.25.1
Signature · 2 lines
Sincerely yours, Mike.