All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slab: trivial: cleanup: remove unneeded return
@ 2011-08-26  3:56 Zhao Jin
  2011-08-26  6:30 ` Zhao Jin
  0 siblings, 1 reply; 7+ messages in thread
From: Zhao Jin @ 2011-08-26  3:56 UTC (permalink / raw)
  To: cl, penberg, mpm, trivial; +Cc: linux-kernel

The procedure ends right after the if-statement, so remove ``return'';
also move the last common statement outside.

Signed-off-by: Zhao Jin <cronozhj@gmail.com>
---
 mm/slab.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 6d90a09..82e0a0e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3678,13 +3678,12 @@ static inline void __cache_free(struct
kmem_cache *cachep, void *objp,

 	if (likely(ac->avail < ac->limit)) {
 		STATS_INC_FREEHIT(cachep);
-		ac->entry[ac->avail++] = objp;
-		return;
 	} else {
 		STATS_INC_FREEMISS(cachep);
 		cache_flusharray(cachep, ac);
-		ac->entry[ac->avail++] = objp;
 	}
+
+	ac->entry[ac->avail++] = objp;
 }

 /**
-- 
1.7.4.1

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

* Re: [PATCH] slab: trivial: cleanup: remove unneeded return
  2011-08-26  3:56 [PATCH] slab: trivial: cleanup: remove unneeded return Zhao Jin
@ 2011-08-26  6:30 ` Zhao Jin
  2011-08-26  6:38   ` Zhao Jin
  0 siblings, 1 reply; 7+ messages in thread
From: Zhao Jin @ 2011-08-26  6:30 UTC (permalink / raw)
  To: cl, penberg, mpm, trivial; +Cc: linux-kernel

The line starting with ``@@'' in the patch was wrapped by my text
editor when I copied it.
Please see the following corrected one. Sorry for the trouble.

---
 mm/slab.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 6d90a09..82e0a0e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3678,13 +3678,12 @@ static inline void __cache_free(struct
kmem_cache *cachep, void *objp,

 	if (likely(ac->avail < ac->limit)) {
 		STATS_INC_FREEHIT(cachep);
-		ac->entry[ac->avail++] = objp;
-		return;
 	} else {
 		STATS_INC_FREEMISS(cachep);
 		cache_flusharray(cachep, ac);
-		ac->entry[ac->avail++] = objp;
 	}
+
+	ac->entry[ac->avail++] = objp;
 }

 /**
-- 
1.7.4.1

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

* Re: [PATCH] slab: trivial: cleanup: remove unneeded return
  2011-08-26  6:30 ` Zhao Jin
@ 2011-08-26  6:38   ` Zhao Jin
  2011-08-26  7:39     ` Yong Zhang
  2011-08-26  9:13     ` David Rientjes
  0 siblings, 2 replies; 7+ messages in thread
From: Zhao Jin @ 2011-08-26  6:38 UTC (permalink / raw)
  To: cl, penberg, mpm, trivial; +Cc: linux-kernel

Terribly sorry. It was gmail who wrapped the line.
Please see this following version. Thanks!

---
  mm/slab.c |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 6d90a09..82e0a0e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3678,13 +3678,12 @@ static inline void __cache_free(struct 
kmem_cache *cachep, void *objp,

      if (likely(ac->avail < ac->limit)) {
          STATS_INC_FREEHIT(cachep);
-        ac->entry[ac->avail++] = objp;
-        return;
      } else {
          STATS_INC_FREEMISS(cachep);
          cache_flusharray(cachep, ac);
-        ac->entry[ac->avail++] = objp;
      }
+
+    ac->entry[ac->avail++] = objp;
  }

  /**
-- 
1.7.4.1


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

* Re: [PATCH] slab: trivial: cleanup: remove unneeded return
  2011-08-26  6:38   ` Zhao Jin
@ 2011-08-26  7:39     ` Yong Zhang
  2011-08-26 14:02       ` Zhao Jin
  2011-08-26  9:13     ` David Rientjes
  1 sibling, 1 reply; 7+ messages in thread
From: Yong Zhang @ 2011-08-26  7:39 UTC (permalink / raw)
  To: Zhao Jin; +Cc: cl, penberg, mpm, trivial, linux-kernel

On Fri, Aug 26, 2011 at 02:38:32PM +0800, Zhao Jin wrote:
> Terribly sorry. It was gmail who wrapped the line.
> Please see this following version. Thanks!

You can use git send-email instead or mail client,

Thanks,
Yong
> 
> ---
>  mm/slab.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 6d90a09..82e0a0e 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3678,13 +3678,12 @@ static inline void __cache_free(struct
> kmem_cache *cachep, void *objp,
> 
>      if (likely(ac->avail < ac->limit)) {
>          STATS_INC_FREEHIT(cachep);
> -        ac->entry[ac->avail++] = objp;
> -        return;
>      } else {
>          STATS_INC_FREEMISS(cachep);
>          cache_flusharray(cachep, ac);
> -        ac->entry[ac->avail++] = objp;
>      }
> +
> +    ac->entry[ac->avail++] = objp;
>  }
> 
>  /**
> -- 
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Only stand for myself

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

* Re: [PATCH] slab: trivial: cleanup: remove unneeded return
  2011-08-26  6:38   ` Zhao Jin
  2011-08-26  7:39     ` Yong Zhang
@ 2011-08-26  9:13     ` David Rientjes
  2011-08-26 14:09       ` Zhao Jin
  1 sibling, 1 reply; 7+ messages in thread
From: David Rientjes @ 2011-08-26  9:13 UTC (permalink / raw)
  To: Zhao Jin; +Cc: cl, penberg, mpm, trivial, linux-kernel

On Fri, 26 Aug 2011, Zhao Jin wrote:

> Terribly sorry. It was gmail who wrapped the line.
> Please see this following version. Thanks!
> 

It's still whitespace damaged, please see Documentation/email-clients.txt.  
If it doesn't help, please add to that document with whatever eventually 
works for you, it will help many people in the future!

This probably shouldn't be cc'd to trivial, it's a candidate to go through 
Pekka's slab tree.  And once you get the email client sorted out or Pekka 
decides to do it manually, feel free to add my

	Acked-by: David Rientjes <rientjes@google.com>

even though you forgot the changelog and your own signed-off-by line on 
this one :)

> ---
>  mm/slab.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 6d90a09..82e0a0e 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3678,13 +3678,12 @@ static inline void __cache_free(struct kmem_cache
> *cachep, void *objp,
> 
>      if (likely(ac->avail < ac->limit)) {
>          STATS_INC_FREEHIT(cachep);
> -        ac->entry[ac->avail++] = objp;
> -        return;
>      } else {
>          STATS_INC_FREEMISS(cachep);
>          cache_flusharray(cachep, ac);
> -        ac->entry[ac->avail++] = objp;
>      }
> +
> +    ac->entry[ac->avail++] = objp;
>  }
> 
>  /**

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

* Re: [PATCH] slab: trivial: cleanup: remove unneeded return
  2011-08-26  7:39     ` Yong Zhang
@ 2011-08-26 14:02       ` Zhao Jin
  0 siblings, 0 replies; 7+ messages in thread
From: Zhao Jin @ 2011-08-26 14:02 UTC (permalink / raw)
  To: Yong Zhang; +Cc: cl, penberg, mpm, trivial, linux-kernel

On Fri, 2011-08-26 at 15:39 +0800, Yong Zhang wrote:
> On Fri, Aug 26, 2011 at 02:38:32PM +0800, Zhao Jin wrote:
> > Terribly sorry. It was gmail who wrapped the line.
> > Please see this following version. Thanks!
> 
> You can use git send-email instead or mail client,

Indeed. Thanks a lot for the tip! 

Regards,
zj




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

* Re: [PATCH] slab: trivial: cleanup: remove unneeded return
  2011-08-26  9:13     ` David Rientjes
@ 2011-08-26 14:09       ` Zhao Jin
  0 siblings, 0 replies; 7+ messages in thread
From: Zhao Jin @ 2011-08-26 14:09 UTC (permalink / raw)
  To: David Rientjes; +Cc: cl, penberg, mpm, trivial, linux-kernel

On Fri, 2011-08-26 at 02:13 -0700, David Rientjes wrote:
> On Fri, 26 Aug 2011, Zhao Jin wrote:
> 
> > Terribly sorry. It was gmail who wrapped the line.
> > Please see this following version. Thanks!
> > 
> 
> It's still whitespace damaged, please see Documentation/email-clients.txt.  
> If it doesn't help, please add to that document with whatever eventually 
> works for you, it will help many people in the future!
> 
> This probably shouldn't be cc'd to trivial, it's a candidate to go through 
> Pekka's slab tree.  And once you get the email client sorted out or Pekka 
> decides to do it manually, feel free to add my
> 
> 	Acked-by: David Rientjes <rientjes@google.com>
> 
> even though you forgot the changelog and your own signed-off-by line on 
> this one :)

email-client.txt really helps me a lot. I shall resend the patch.
Many thanks for the kind tip!

Regards,
zhj



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

end of thread, other threads:[~2011-08-26 14:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-26  3:56 [PATCH] slab: trivial: cleanup: remove unneeded return Zhao Jin
2011-08-26  6:30 ` Zhao Jin
2011-08-26  6:38   ` Zhao Jin
2011-08-26  7:39     ` Yong Zhang
2011-08-26 14:02       ` Zhao Jin
2011-08-26  9:13     ` David Rientjes
2011-08-26 14:09       ` Zhao Jin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.