linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
@ 2021-11-01 10:17 Kushal Kothari
  2021-11-01 14:39 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Kushal Kothari @ 2021-11-01 10:17 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

Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
---
 mm/memblock.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 5c3503c98b2f..57b9153b2278 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -16,7 +16,7 @@
 #include <linux/kmemleak.h>
 #include <linux/seq_file.h>
 #include <linux/memblock.h>
-
+#include<stdbool.h>
 #include <asm/sections.h>
 #include <linux/io.h>
 
@@ -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] 3+ messages in thread

* Re: [PATCH] staging: mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
  2021-11-01 10:17 [PATCH] staging: mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c Kushal Kothari
@ 2021-11-01 14:39 ` Matthew Wilcox
  2021-11-03 12:42   ` kushal kothari
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2021-11-01 14:39 UTC (permalink / raw)
  To: Kushal Kothari
  Cc: rppt, akpm, linux-mm, linux-kernel, mike.rapoport, kushalkothari2850

On Mon, Nov 01, 2021 at 03:47:19PM +0530, Kushal Kothari wrote:
> 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

Why does the subject line say "staging"?  What tool reports this as an
"ERROR"?

> Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
> ---
>  mm/memblock.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 5c3503c98b2f..57b9153b2278 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -16,7 +16,7 @@
>  #include <linux/kmemleak.h>
>  #include <linux/seq_file.h>
>  #include <linux/memblock.h>
> -
> +#include<stdbool.h>

Why are you including stdbool here?  Why do you not justify it in the
changelog?



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

* Re: [PATCH] staging: mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c
  2021-11-01 14:39 ` Matthew Wilcox
@ 2021-11-03 12:42   ` kushal kothari
  0 siblings, 0 replies; 3+ messages in thread
From: kushal kothari @ 2021-11-03 12:42 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: rppt, akpm, linux-mm, linux-kernel, Mike Rapoport, kushalkothari2850

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

>Why does the subject line say "staging"?  What tool reports this as an
>"ERROR"?

Sorry. I made a mistake there while writing the subject line and adding
<stdbool.h>.
I am fixing it in v2.
I ran the checkpatch.pl script which reported this error.


On Mon, Nov 1, 2021 at 8:10 PM Matthew Wilcox <willy@infradead.org> wrote:

> On Mon, Nov 01, 2021 at 03:47:19PM +0530, Kushal Kothari wrote:
> > 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
>
> Why does the subject line say "staging"?  What tool reports this as an
> "ERROR"?
>
> > Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
> > ---
> >  mm/memblock.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/mm/memblock.c b/mm/memblock.c
> > index 5c3503c98b2f..57b9153b2278 100644
> > --- a/mm/memblock.c
> > +++ b/mm/memblock.c
> > @@ -16,7 +16,7 @@
> >  #include <linux/kmemleak.h>
> >  #include <linux/seq_file.h>
> >  #include <linux/memblock.h>
> > -
> > +#include<stdbool.h>
>
> Why are you including stdbool here?  Why do you not justify it in the
> changelog?
>
>

[-- Attachment #2: Type: text/html, Size: 1926 bytes --]

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 10:17 [PATCH] staging: mm: Fix ERROR:do not initialise statics to 0 or NULL in memblock.c Kushal Kothari
2021-11-01 14:39 ` Matthew Wilcox
2021-11-03 12:42   ` kushal kothari

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