]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Staging: lustre: remove assignment in if conditions
authorJon Bernard <jbernard@tuxion.com>
Tue, 17 Sep 2013 01:27:55 +0000 (21:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Sep 2013 23:22:31 +0000 (16:22 -0700)
This is a patch to lvfs_linux.c that removes the use of variable assignment
within an if condition found by checkpatch.pl.

Signed-off-by: Jon Bernard <jbernard@tuxion.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lvfs/lvfs_linux.c

index 18e1b47a1d65aaebf5c3312670e43017232780f8..7b03f4dfd3b0b2f951049f4e8b8440ddfffd7c99 100644 (file)
@@ -80,7 +80,8 @@ static void push_group_info(struct lvfs_run_ctxt *save,
                struct cred *cred;
                task_lock(current);
                save->group_info = current_cred()->group_info;
-               if ((cred = prepare_creds())) {
+               cred = prepare_creds();
+               if (cred) {
                        cred->group_info = ginfo;
                        commit_creds(cred);
                }
@@ -96,7 +97,8 @@ static void pop_group_info(struct lvfs_run_ctxt *save,
        } else {
                struct cred *cred;
                task_lock(current);
-               if ((cred = prepare_creds())) {
+               cred = prepare_creds();
+               if (cred) {
                        cred->group_info = save->group_info;
                        commit_creds(cred);
                }
@@ -137,7 +139,8 @@ void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
                save->luc.luc_fsgid = current_fsgid();
                save->luc.luc_cap = current_cap();
 
-               if ((cred = prepare_creds())) {
+               cred = prepare_creds();
+               if (cred) {
                        cred->uid = uc->luc_uid;
                        cred->gid = uc->luc_gid;
                        cred->fsuid = uc->luc_fsuid;
@@ -180,7 +183,8 @@ void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
        current->fs->umask = saved->luc.luc_umask;
        if (uc) {
                struct cred *cred;
-               if ((cred = prepare_creds())) {
+               cred = prepare_creds();
+               if (cred) {
                        cred->uid = saved->luc.luc_uid;
                        cred->gid = saved->luc.luc_gid;
                        cred->fsuid = saved->luc.luc_fsuid;