From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, Pekka Enberg <penberg@kernel.org>,
Tony Luck <tony.luck@intel.com>,
Tang Chen <tangchen@cn.fujitsu.com>,
David Gibson <david@gibson.dropbear.id.au>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/memblock: move memblock_{add,reserve}_region into memblock_{add,reserve}
Date: Mon, 18 Apr 2016 10:11:26 +0200 [thread overview]
Message-ID: <CAKv+Gu-F8bJfg9zpa5oFMT6tj2Wd1mBx8O-ag1asav_HsR0tfw@mail.gmail.com> (raw)
In-Reply-To: <1460920476-14320-1-git-send-email-kuleshovmail@gmail.com>
On 17 April 2016 at 21:14, Alexander Kuleshov <kuleshovmail@gmail.com> wrote:
> From: 0xAX <kuleshovmail@gmail.com>
>
> The memblock_add_region() and memblock_reserve_region do not nothing specific
> before the call of the memblock_add_range(), only print debug output.
>
> We can do the same in the memblock_add() and memblock_reserve() since both
> memblock_add_region() and memblock_reserve_region are not used by anybody
> outside of memblock.c and the memblock_{add,reserve}() have the same set of
> flags and nids.
>
> Since the memblock_add_region() and memblock_reserve_region() anyway will be
> inlined, there will not be functional changes, but will improve code readability
> a little.
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> mm/memblock.c | 28 ++++++----------------------
> 1 file changed, 6 insertions(+), 22 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index b570ddd..3b93daa 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -606,22 +606,14 @@ int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,
> return memblock_add_range(&memblock.memory, base, size, nid, 0);
> }
>
> -static int __init_memblock memblock_add_region(phys_addr_t base,
> - phys_addr_t size,
> - int nid,
> - unsigned long flags)
> +int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
> {
> memblock_dbg("memblock_add: [%#016llx-%#016llx] flags %#02lx %pF\n",
> (unsigned long long)base,
> (unsigned long long)base + size - 1,
> - flags, (void *)_RET_IP_);
> -
> - return memblock_add_range(&memblock.memory, base, size, nid, flags);
> -}
> + 0UL, (void *)_RET_IP_);
>
> -int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
> -{
> - return memblock_add_region(base, size, MAX_NUMNODES, 0);
> + return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0);
> }
>
> /**
> @@ -732,22 +724,14 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
> return memblock_remove_range(&memblock.reserved, base, size);
> }
>
> -static int __init_memblock memblock_reserve_region(phys_addr_t base,
> - phys_addr_t size,
> - int nid,
> - unsigned long flags)
> +int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
> {
> memblock_dbg("memblock_reserve: [%#016llx-%#016llx] flags %#02lx %pF\n",
> (unsigned long long)base,
> (unsigned long long)base + size - 1,
> - flags, (void *)_RET_IP_);
> -
> - return memblock_add_range(&memblock.reserved, base, size, nid, flags);
> -}
> + 0UL, (void *)_RET_IP_);
>
> -int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
> -{
> - return memblock_reserve_region(base, size, MAX_NUMNODES, 0);
> + return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0);
> }
>
> /**
> --
> 2.8.0.rc3.212.g1f992f2.dirty
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2016-04-18 8:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-17 19:14 Alexander Kuleshov
2016-04-18 8:11 ` Ard Biesheuvel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKv+Gu-F8bJfg9zpa5oFMT6tj2Wd1mBx8O-ag1asav_HsR0tfw@mail.gmail.com \
--to=ard.biesheuvel@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=david@gibson.dropbear.id.au \
--cc=kuleshovmail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=penberg@kernel.org \
--cc=tangchen@cn.fujitsu.com \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox