linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
@ 2021-11-03 12:45 Kushal Kothari
  2021-11-03 17:11 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Kushal Kothari @ 2021-11-03 12:45 UTC (permalink / raw)
  To: rppt, akpm, linux-mm, linux-kernel, mike.rapoport, kushalkothari2850
  Cc: Kushal Kothari

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.

Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
---

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(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 5c3503c98b2f..9e2b7c1dbd03 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -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)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
  2021-11-03 12:45 [PATCH v2] mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c Kushal Kothari
@ 2021-11-03 17:11 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2021-11-03 17:11 UTC (permalink / raw)
  To: Kushal Kothari
  Cc: akpm, linux-mm, linux-kernel, mike.rapoport, kushalkothari2850

Hi,

On Wed, Nov 03, 2021 at 06:15:23PM +0530, Kushal Kothari wrote:
> 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.

> 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.

Again, this is not a real error in the code but rather a coding style
inconsistency. Please update the changelog text to reflect this.
 
> Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
> ---
> 
> 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(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 5c3503c98b2f..9e2b7c1dbd03 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -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)
>  {
> -- 
> 2.25.1
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-03 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 12:45 [PATCH v2] mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c Kushal Kothari
2021-11-03 17:11 ` Mike Rapoport

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).