public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/sg_pool: remove unnecessary null check when free the object
@ 2018-07-31 16:21 zhong jiang
  2018-09-08  9:39 ` zhong jiang
  0 siblings, 1 reply; 6+ messages in thread
From: zhong jiang @ 2018-07-31 16:21 UTC (permalink / raw)
  To: tglx, longman; +Cc: arnd, yang.shi, linux-kernel

kmem_cache_destroy/mempool_destroy has taken null check into account.
so remove the redundant check.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 lib/sg_pool.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/sg_pool.c b/lib/sg_pool.c
index 6dd3061..d1c1e63 100644
--- a/lib/sg_pool.c
+++ b/lib/sg_pool.c
@@ -148,10 +148,9 @@ static __init int sg_pool_init(void)
 cleanup_sdb:
 	for (i = 0; i < SG_MEMPOOL_NR; i++) {
 		struct sg_pool *sgp = sg_pools + i;
-		if (sgp->pool)
-			mempool_destroy(sgp->pool);
-		if (sgp->slab)
-			kmem_cache_destroy(sgp->slab);
+
+		mempool_destroy(sgp->pool);
+		kmem_cache_destroy(sgp->slab);
 	}
 
 	return -ENOMEM;
-- 
1.7.12.4


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

* Re: [PATCH] lib/sg_pool: remove unnecessary null check when free the object
  2018-07-31 16:21 [PATCH] lib/sg_pool: remove unnecessary null check when free the object zhong jiang
@ 2018-09-08  9:39 ` zhong jiang
  2018-09-08  9:46   ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: zhong jiang @ 2018-09-08  9:39 UTC (permalink / raw)
  To: tglx, longman; +Cc: arnd, yang.shi, linux-kernel

Hi,  Thomas

Can you pick up the patch?

Thanks
zhong jiang
On 2018/8/1 0:21, zhong jiang wrote:
> kmem_cache_destroy/mempool_destroy has taken null check into account.
> so remove the redundant check.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  lib/sg_pool.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/lib/sg_pool.c b/lib/sg_pool.c
> index 6dd3061..d1c1e63 100644
> --- a/lib/sg_pool.c
> +++ b/lib/sg_pool.c
> @@ -148,10 +148,9 @@ static __init int sg_pool_init(void)
>  cleanup_sdb:
>  	for (i = 0; i < SG_MEMPOOL_NR; i++) {
>  		struct sg_pool *sgp = sg_pools + i;
> -		if (sgp->pool)
> -			mempool_destroy(sgp->pool);
> -		if (sgp->slab)
> -			kmem_cache_destroy(sgp->slab);
> +
> +		mempool_destroy(sgp->pool);
> +		kmem_cache_destroy(sgp->slab);
>  	}
>  
>  	return -ENOMEM;



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

* Re: [PATCH] lib/sg_pool: remove unnecessary null check when free the object
  2018-09-08  9:39 ` zhong jiang
@ 2018-09-08  9:46   ` Thomas Gleixner
  2018-09-08 10:05     ` zhong jiang
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2018-09-08  9:46 UTC (permalink / raw)
  To: zhong jiang; +Cc: longman, arnd, yang.shi, linux-kernel

On Sat, 8 Sep 2018, zhong jiang wrote:
> Hi,  Thomas
> 
> Can you pick up the patch?

I'm not picking up patches for lib/sg_pool. Why would I?

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

* Re: [PATCH] lib/sg_pool: remove unnecessary null check when free the object
  2018-09-08  9:46   ` Thomas Gleixner
@ 2018-09-08 10:05     ` zhong jiang
  2018-09-08 10:21       ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: zhong jiang @ 2018-09-08 10:05 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: longman, arnd, yang.shi, linux-kernel

On 2018/9/8 17:46, Thomas Gleixner wrote:
> On Sat, 8 Sep 2018, zhong jiang wrote:
>> Hi,  Thomas
>>
>> Can you pick up the patch?
> I'm not picking up patches for lib/sg_pool. Why would I?
>
I am sorry for that. I regard you as maintainer for lib/sg_pool mistakely. 
but I can get maintainer information nothing from get_maintainer.pl
The code is not updated since 2016. 

Thanks
zhong jiang


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

* Re: [PATCH] lib/sg_pool: remove unnecessary null check when free the object
  2018-09-08 10:05     ` zhong jiang
@ 2018-09-08 10:21       ` Thomas Gleixner
  2018-09-08 10:33         ` zhong jiang
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2018-09-08 10:21 UTC (permalink / raw)
  To: zhong jiang; +Cc: longman, arnd, yang.shi, linux-kernel

On Sat, 8 Sep 2018, zhong jiang wrote:

> On 2018/9/8 17:46, Thomas Gleixner wrote:
> > On Sat, 8 Sep 2018, zhong jiang wrote:
> >> Hi,  Thomas
> >>
> >> Can you pick up the patch?
> > I'm not picking up patches for lib/sg_pool. Why would I?
> >
> I am sorry for that. I regard you as maintainer for lib/sg_pool mistakely. 
> but I can get maintainer information nothing from get_maintainer.pl
> The code is not updated since 2016. 

Andrew Morton picks up such things.

Thanks,

	tglx

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

* Re: [PATCH] lib/sg_pool: remove unnecessary null check when free the object
  2018-09-08 10:21       ` Thomas Gleixner
@ 2018-09-08 10:33         ` zhong jiang
  0 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2018-09-08 10:33 UTC (permalink / raw)
  To: Thomas Gleixner, Andrew Morton; +Cc: longman, arnd, yang.shi, linux-kernel

On 2018/9/8 18:21, Thomas Gleixner wrote:
> On Sat, 8 Sep 2018, zhong jiang wrote:
>
>> On 2018/9/8 17:46, Thomas Gleixner wrote:
>>> On Sat, 8 Sep 2018, zhong jiang wrote:
>>>> Hi,  Thomas
>>>>
>>>> Can you pick up the patch?
>>> I'm not picking up patches for lib/sg_pool. Why would I?
>>>
>> I am sorry for that. I regard you as maintainer for lib/sg_pool mistakely. 
>> but I can get maintainer information nothing from get_maintainer.pl
>> The code is not updated since 2016. 
> Andrew Morton picks up such things.
 Thank you for your tips.

 +to Andrew

  Thanks
  zhong jiang
> Thanks,
>
> 	tglx
>
> .
>



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

end of thread, other threads:[~2018-09-08 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31 16:21 [PATCH] lib/sg_pool: remove unnecessary null check when free the object zhong jiang
2018-09-08  9:39 ` zhong jiang
2018-09-08  9:46   ` Thomas Gleixner
2018-09-08 10:05     ` zhong jiang
2018-09-08 10:21       ` Thomas Gleixner
2018-09-08 10:33         ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox