All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] nfsd: use swap() in sort_pacl_range()
@ 2015-06-12 16:58 Fabian Frederick
  2015-06-16 15:27 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-06-12 16:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Julia Lawall, Fabian Frederick, J. Bruce Fields, linux-nfs

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/nfsd/nfs4acl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 7e10e2a..eb5accf 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -372,7 +372,6 @@ pace_gt(struct posix_acl_entry *pace1, struct posix_acl_entry *pace2)
 static void
 sort_pacl_range(struct posix_acl *pacl, int start, int end) {
 	int sorted = 0, i;
-	struct posix_acl_entry tmp;
 
 	/* We just do a bubble sort; easy to do in place, and we're not
 	 * expecting acl's to be long enough to justify anything more. */
@@ -382,9 +381,8 @@ sort_pacl_range(struct posix_acl *pacl, int start, int end) {
 			if (pace_gt(&pacl->a_entries[i],
 				    &pacl->a_entries[i+1])) {
 				sorted = 0;
-				tmp = pacl->a_entries[i];
-				pacl->a_entries[i] = pacl->a_entries[i+1];
-				pacl->a_entries[i+1] = tmp;
+				swap(pacl->a_entries[i],
+				     pacl->a_entries[i + 1]);
 			}
 		}
 	}
-- 
2.4.2


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

* Re: [PATCH 1/1 linux-next] nfsd: use swap() in sort_pacl_range()
  2015-06-12 16:58 [PATCH 1/1 linux-next] nfsd: use swap() in sort_pacl_range() Fabian Frederick
@ 2015-06-16 15:27 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2015-06-16 15:27 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Julia Lawall, linux-nfs

Applying, thanks.--b.

On Fri, Jun 12, 2015 at 06:58:57PM +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
> 
> Thanks to Julia Lawall for Coccinelle scripting support.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/nfsd/nfs4acl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> index 7e10e2a..eb5accf 100644
> --- a/fs/nfsd/nfs4acl.c
> +++ b/fs/nfsd/nfs4acl.c
> @@ -372,7 +372,6 @@ pace_gt(struct posix_acl_entry *pace1, struct posix_acl_entry *pace2)
>  static void
>  sort_pacl_range(struct posix_acl *pacl, int start, int end) {
>  	int sorted = 0, i;
> -	struct posix_acl_entry tmp;
>  
>  	/* We just do a bubble sort; easy to do in place, and we're not
>  	 * expecting acl's to be long enough to justify anything more. */
> @@ -382,9 +381,8 @@ sort_pacl_range(struct posix_acl *pacl, int start, int end) {
>  			if (pace_gt(&pacl->a_entries[i],
>  				    &pacl->a_entries[i+1])) {
>  				sorted = 0;
> -				tmp = pacl->a_entries[i];
> -				pacl->a_entries[i] = pacl->a_entries[i+1];
> -				pacl->a_entries[i+1] = tmp;
> +				swap(pacl->a_entries[i],
> +				     pacl->a_entries[i + 1]);
>  			}
>  		}
>  	}
> -- 
> 2.4.2

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

end of thread, other threads:[~2015-06-16 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-12 16:58 [PATCH 1/1 linux-next] nfsd: use swap() in sort_pacl_range() Fabian Frederick
2015-06-16 15:27 ` J. Bruce Fields

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.