From: Michal Hocko <mhocko@suse.com>
To: Athira-Selvan <thisisathi@gmail.com>
Cc: akpm@linux-foundation.org, jthumshirn@suse.de,
tglx@linutronix.de, kent.overstreet@gmail.com,
linux-mm@kvack.org
Subject: Re: [PATCH] mm:mempool:fixed coding style errors and warnings.
Date: Tue, 26 Jun 2018 13:03:00 +0200 [thread overview]
Message-ID: <20180626110300.GC29102@dhcp22.suse.cz> (raw)
In-Reply-To: <1529946737-7693-1-git-send-email-thisisathi@gmail.com>
On Mon 25-06-18 22:42:17, Athira-Selvan wrote:
> This patch fixes checkpatch.pl:
> WARNING: Missing a blank line after declarations
> ERROR: missing space brfore ','
I am not really sure this improves readability enough to add the churn
into the code. mempool is not the heaviest modified file but still,
making style changes without any further changes in the area are usually
quite weak to justify. They are just adding an additional hop in git
blame tracking without a good reason. Sure sometimes the end code is so
much easier to read that the change is worthwhile but I do not see it
here.
Others might think differently though.
> Signed-off-by: Athira Selvam <thisisathi@gmail.com>
> ---
> mm/mempool.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/mm/mempool.c b/mm/mempool.c
> index b54f2c2..c3a7b7b 100644
> --- a/mm/mempool.c
> +++ b/mm/mempool.c
> @@ -152,6 +152,7 @@ void mempool_exit(mempool_t *pool)
> {
> while (pool->curr_nr) {
> void *element = remove_element(pool, GFP_KERNEL);
> +
> pool->free(element, pool->pool_data);
> }
> kfree(pool->elements);
> @@ -248,7 +249,7 @@ EXPORT_SYMBOL(mempool_init);
> mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
> mempool_free_t *free_fn, void *pool_data)
> {
> - return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data,
> + return mempool_create_node(min_nr, alloc_fn, free_fn, pool_data,
> GFP_KERNEL, NUMA_NO_NODE);
> }
> EXPORT_SYMBOL(mempool_create);
> @@ -500,6 +501,7 @@ EXPORT_SYMBOL(mempool_free);
> void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data)
> {
> struct kmem_cache *mem = pool_data;
> +
> VM_BUG_ON(mem->ctor);
> return kmem_cache_alloc(mem, gfp_mask);
> }
> @@ -508,6 +510,7 @@ EXPORT_SYMBOL(mempool_alloc_slab);
> void mempool_free_slab(void *element, void *pool_data)
> {
> struct kmem_cache *mem = pool_data;
> +
> kmem_cache_free(mem, element);
> }
> EXPORT_SYMBOL(mempool_free_slab);
> @@ -519,6 +522,7 @@ EXPORT_SYMBOL(mempool_free_slab);
> void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data)
> {
> size_t size = (size_t)pool_data;
> +
> return kmalloc(size, gfp_mask);
> }
> EXPORT_SYMBOL(mempool_kmalloc);
> @@ -536,6 +540,7 @@ EXPORT_SYMBOL(mempool_kfree);
> void *mempool_alloc_pages(gfp_t gfp_mask, void *pool_data)
> {
> int order = (int)(long)pool_data;
> +
> return alloc_pages(gfp_mask, order);
> }
> EXPORT_SYMBOL(mempool_alloc_pages);
> @@ -543,6 +548,7 @@ EXPORT_SYMBOL(mempool_alloc_pages);
> void mempool_free_pages(void *element, void *pool_data)
> {
> int order = (int)(long)pool_data;
> +
> __free_pages(element, order);
> }
> EXPORT_SYMBOL(mempool_free_pages);
> --
> 2.7.4
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2018-06-26 11:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 17:12 Athira-Selvan
2018-06-26 11:03 ` Michal Hocko [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=20180626110300.GC29102@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=jthumshirn@suse.de \
--cc=kent.overstreet@gmail.com \
--cc=linux-mm@kvack.org \
--cc=tglx@linutronix.de \
--cc=thisisathi@gmail.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