linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm:mempool:fixed coding style errors and warnings.
@ 2018-06-25 17:12 Athira-Selvan
  2018-06-26 11:03 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Athira-Selvan @ 2018-06-25 17:12 UTC (permalink / raw)
  To: akpm; +Cc: jthumshirn, tglx, kent.overstreet, linux-mm, thisisathi

This patch fixes checkpatch.pl:
WARNING: Missing a blank line after declarations
ERROR: missing space brfore ','

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

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

* Re: [PATCH] mm:mempool:fixed coding style errors and warnings.
  2018-06-25 17:12 [PATCH] mm:mempool:fixed coding style errors and warnings Athira-Selvan
@ 2018-06-26 11:03 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2018-06-26 11:03 UTC (permalink / raw)
  To: Athira-Selvan; +Cc: akpm, jthumshirn, tglx, kent.overstreet, linux-mm

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

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

end of thread, other threads:[~2018-06-26 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25 17:12 [PATCH] mm:mempool:fixed coding style errors and warnings Athira-Selvan
2018-06-26 11:03 ` Michal Hocko

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