[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGM2reYDLK1dE3RO3AoYNGzHX9HcozAxKvW+jzrgCThvTzjMpw@mail.gmail.com>
Date: Wed, 20 Jun 2018 22:38:02 -0400
From: Pavel Tatashin <pasha.tatashin@...cle.com>
To: osalvador@...hadventures.net
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>,
Vlastimil Babka <vbabka@...e.cz>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>, osalvador@...e.de
Subject: Re: [PATCH 4/4] mm/memory_hotplug: Drop unnecessary checks from register_mem_sect_under_node
On Fri, Jun 1, 2018 at 8:54 AM <osalvador@...hadventures.net> wrote:
>
> From: Oscar Salvador <osalvador@...e.de>
>
> Callers of register_mem_sect_under_node() are always passing a valid
> memory_block (not NULL), so we can safely drop the check for NULL.
>
> In the same way, register_mem_sect_under_node() is only called in case
> the node is online, so we can safely remove that check as well.
>
> Signed-off-by: Oscar Salvador <osalvador@...e.de>
Reviewed-by: Pavel Tatashin <pasha.tatashin@...cle.com>
> ---
> drivers/base/node.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index 248c712e8de5..681be04351bc 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -415,12 +415,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid,
> int ret;
> unsigned long pfn, sect_start_pfn, sect_end_pfn;
>
> - if (!mem_blk)
> - return -EFAULT;
> -
> mem_blk->nid = nid;
> - if (!node_online(nid))
> - return 0;
>
> sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr);
> sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);
> --
> 2.13.6
>
Powered by blists - more mailing lists