Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449116 > unrolled thread

Re: [PATCH] SCSI-aic94xx: Delete unnecessary checks before the function call "kmem_cache_destroy"

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-07-24 14:00 +0200
Last post2016-07-25 11:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] SCSI-aic94xx: Delete unnecessary checks before the  function call "kmem_cache_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-24 14:00 +0200
    Re: [PATCH] SCSI-aic94xx: Delete unnecessary checks before the  function call "kmem_cache_destroy" Jinpu Wang <jinpu.wang@profitbricks.com> - 2016-07-25 11:00 +0200

#1449116 — Re: [PATCH] SCSI-aic94xx: Delete unnecessary checks before the function call "kmem_cache_destroy"

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-07-24 14:00 +0200
SubjectRe: [PATCH] SCSI-aic94xx: Delete unnecessary checks before the function call "kmem_cache_destroy"
Message-ID<rYqeB-7r0-1@gated-at.bofh.it>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 17 Nov 2015 08:14:52 +0100
> 
> The kmem_cache_destroy() function tests whether its argument is NULL
> and then returns immediately. Thus the test around the calls is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/scsi/aic94xx/aic94xx_init.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
> index 662b232..ab93049 100644
> --- a/drivers/scsi/aic94xx/aic94xx_init.c
> +++ b/drivers/scsi/aic94xx/aic94xx_init.c
> @@ -660,12 +660,9 @@ Err:
>  
>  static void asd_destroy_global_caches(void)
>  {
> -	if (asd_dma_token_cache)
> -		kmem_cache_destroy(asd_dma_token_cache);
> +	kmem_cache_destroy(asd_dma_token_cache);
>  	asd_dma_token_cache = NULL;
> -
> -	if (asd_ascb_cache)
> -		kmem_cache_destroy(asd_ascb_cache);
> +	kmem_cache_destroy(asd_ascb_cache);
>  	asd_ascb_cache = NULL;
>  }
>  
> 

How do you think about to integrate this update suggestion
into another source code repository?

Regards,
Markus

[toc] | [next] | [standalone]


#1449384

FromJinpu Wang <jinpu.wang@profitbricks.com>
Date2016-07-25 11:00 +0200
Message-ID<rYJTX-2qF-19@gated-at.bofh.it>
In reply to#1449116
On Sun, Jul 24, 2016 at 1:51 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Tue, 17 Nov 2015 08:14:52 +0100
> >
> > The kmem_cache_destroy() function tests whether its argument is NULL
> > and then returns immediately. Thus the test around the calls is not needed.
> >
> > This issue was detected by using the Coccinelle software.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> >  drivers/scsi/aic94xx/aic94xx_init.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
> > index 662b232..ab93049 100644
> > --- a/drivers/scsi/aic94xx/aic94xx_init.c
> > +++ b/drivers/scsi/aic94xx/aic94xx_init.c
> > @@ -660,12 +660,9 @@ Err:
> >
> >  static void asd_destroy_global_caches(void)
> >  {
> > -     if (asd_dma_token_cache)
> > -             kmem_cache_destroy(asd_dma_token_cache);
> > +     kmem_cache_destroy(asd_dma_token_cache);
> >       asd_dma_token_cache = NULL;
> > -
> > -     if (asd_ascb_cache)
> > -             kmem_cache_destroy(asd_ascb_cache);
> > +     kmem_cache_destroy(asd_ascb_cache);
> >       asd_ascb_cache = NULL;
> >  }
> >
> >
>
> How do you think about to integrate this update suggestion
> into another source code repository?
>
> Regards,
> Markus


Looks good to me!
Reviewed-by: Jack Wang <jinpu.wang@profitbricks.com>

PS: resend to fix mal-format rejection, sorry!
-- 

Mit freundlichen Grüßen,
Best Regards,

Jack Wang

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web