linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] security/apparmor: do not define list_entry_next
@ 2015-11-18 12:14 Sergey Senozhatsky
  2015-11-18 18:19 ` John Johansen
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Senozhatsky @ 2015-11-18 12:14 UTC (permalink / raw)
  To: John Johansen
  Cc: Serge E . Hallyn, linux-security-module, linux-kernel,
	Sergey Senozhatsky, Sergey Senozhatsky

Cosmetic.

Do not define list_entry_next() and use list_next_entry()
from list.h.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 security/apparmor/apparmorfs.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index ad4fa49..946e8fd 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -21,6 +21,7 @@
 #include <linux/namei.h>
 #include <linux/capability.h>
 #include <linux/rcupdate.h>
+#include <linux/list.h>
 
 #include "include/apparmor.h"
 #include "include/apparmorfs.h"
@@ -549,9 +550,6 @@ fail2:
 	return error;
 }
 
-
-#define list_entry_next(pos, member) \
-	list_entry(pos->member.next, typeof(*pos), member)
 #define list_entry_is_head(pos, head, member) (&pos->member == (head))
 
 /**
@@ -582,7 +580,7 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root,
 	parent = ns->parent;
 	while (ns != root) {
 		mutex_unlock(&ns->lock);
-		next = list_entry_next(ns, base.list);
+		next = list_next_entry(ns, base.list);
 		if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
 			mutex_lock(&next->lock);
 			return next;
@@ -636,7 +634,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
 	parent = rcu_dereference_protected(p->parent,
 					   mutex_is_locked(&p->ns->lock));
 	while (parent) {
-		p = list_entry_next(p, base.list);
+		p = list_next_entry(p, base.list);
 		if (!list_entry_is_head(p, &parent->base.profiles, base.list))
 			return p;
 		p = parent;
@@ -645,7 +643,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
 	}
 
 	/* is next another profile in the namespace */
-	p = list_entry_next(p, base.list);
+	p = list_next_entry(p, base.list);
 	if (!list_entry_is_head(p, &ns->base.profiles, base.list))
 		return p;
 
-- 
2.6.2.280.g74301d6


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

* Re: [PATCH 3/3] security/apparmor: do not define list_entry_next
  2015-11-18 12:14 [PATCH 3/3] security/apparmor: do not define list_entry_next Sergey Senozhatsky
@ 2015-11-18 18:19 ` John Johansen
  2015-11-19  0:20   ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: John Johansen @ 2015-11-18 18:19 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Serge E . Hallyn, linux-security-module, linux-kernel,
	Sergey Senozhatsky

On 11/18/2015 04:14 AM, Sergey Senozhatsky wrote:
> Cosmetic.
> 
> Do not define list_entry_next() and use list_next_entry()
> from list.h.
> 

two days to late,

Geliang Tang already submitted the same patch in
[PATCH 3/3] apparmor: use list_next_entry instead of list_entry_next

and I've pulled it into my tree

still thank you for your work, it is appreciated

> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> ---
>  security/apparmor/apparmorfs.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index ad4fa49..946e8fd 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -21,6 +21,7 @@
>  #include <linux/namei.h>
>  #include <linux/capability.h>
>  #include <linux/rcupdate.h>
> +#include <linux/list.h>
>  
>  #include "include/apparmor.h"
>  #include "include/apparmorfs.h"
> @@ -549,9 +550,6 @@ fail2:
>  	return error;
>  }
>  
> -
> -#define list_entry_next(pos, member) \
> -	list_entry(pos->member.next, typeof(*pos), member)
>  #define list_entry_is_head(pos, head, member) (&pos->member == (head))
>  
>  /**
> @@ -582,7 +580,7 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root,
>  	parent = ns->parent;
>  	while (ns != root) {
>  		mutex_unlock(&ns->lock);
> -		next = list_entry_next(ns, base.list);
> +		next = list_next_entry(ns, base.list);
>  		if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
>  			mutex_lock(&next->lock);
>  			return next;
> @@ -636,7 +634,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
>  	parent = rcu_dereference_protected(p->parent,
>  					   mutex_is_locked(&p->ns->lock));
>  	while (parent) {
> -		p = list_entry_next(p, base.list);
> +		p = list_next_entry(p, base.list);
>  		if (!list_entry_is_head(p, &parent->base.profiles, base.list))
>  			return p;
>  		p = parent;
> @@ -645,7 +643,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
>  	}
>  
>  	/* is next another profile in the namespace */
> -	p = list_entry_next(p, base.list);
> +	p = list_next_entry(p, base.list);
>  	if (!list_entry_is_head(p, &ns->base.profiles, base.list))
>  		return p;
>  
> 


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

* Re: [PATCH 3/3] security/apparmor: do not define list_entry_next
  2015-11-18 18:19 ` John Johansen
@ 2015-11-19  0:20   ` Sergey Senozhatsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2015-11-19  0:20 UTC (permalink / raw)
  To: John Johansen
  Cc: Sergey Senozhatsky, Serge E . Hallyn, linux-security-module,
	linux-kernel, Sergey Senozhatsky

On (11/18/15 10:19), John Johansen wrote:
> On 11/18/2015 04:14 AM, Sergey Senozhatsky wrote:
> > Cosmetic.
> > 
> > Do not define list_entry_next() and use list_next_entry()
> > from list.h.
> > 
> 
> two days to late,
> 
> Geliang Tang already submitted the same patch in
> [PATCH 3/3] apparmor: use list_next_entry instead of list_entry_next
> 

Oh, wow. sorry for the noise. thanks.

	-ss

> and I've pulled it into my tree
> 
> still thank you for your work, it is appreciated
> 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > ---
> >  security/apparmor/apparmorfs.c | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> > 
> > diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> > index ad4fa49..946e8fd 100644
> > --- a/security/apparmor/apparmorfs.c
> > +++ b/security/apparmor/apparmorfs.c
> > @@ -21,6 +21,7 @@
> >  #include <linux/namei.h>
> >  #include <linux/capability.h>
> >  #include <linux/rcupdate.h>
> > +#include <linux/list.h>
> >  
> >  #include "include/apparmor.h"
> >  #include "include/apparmorfs.h"
> > @@ -549,9 +550,6 @@ fail2:
> >  	return error;
> >  }
> >  
> > -
> > -#define list_entry_next(pos, member) \
> > -	list_entry(pos->member.next, typeof(*pos), member)
> >  #define list_entry_is_head(pos, head, member) (&pos->member == (head))
> >  
> >  /**
> > @@ -582,7 +580,7 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root,
> >  	parent = ns->parent;
> >  	while (ns != root) {
> >  		mutex_unlock(&ns->lock);
> > -		next = list_entry_next(ns, base.list);
> > +		next = list_next_entry(ns, base.list);
> >  		if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
> >  			mutex_lock(&next->lock);
> >  			return next;
> > @@ -636,7 +634,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
> >  	parent = rcu_dereference_protected(p->parent,
> >  					   mutex_is_locked(&p->ns->lock));
> >  	while (parent) {
> > -		p = list_entry_next(p, base.list);
> > +		p = list_next_entry(p, base.list);
> >  		if (!list_entry_is_head(p, &parent->base.profiles, base.list))
> >  			return p;
> >  		p = parent;
> > @@ -645,7 +643,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
> >  	}
> >  
> >  	/* is next another profile in the namespace */
> > -	p = list_entry_next(p, base.list);
> > +	p = list_next_entry(p, base.list);
> >  	if (!list_entry_is_head(p, &ns->base.profiles, base.list))
> >  		return p;
> >  
> > 
> 

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

end of thread, other threads:[~2015-11-19  0:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-18 12:14 [PATCH 3/3] security/apparmor: do not define list_entry_next Sergey Senozhatsky
2015-11-18 18:19 ` John Johansen
2015-11-19  0:20   ` Sergey Senozhatsky

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