Skip to content

Commit

Permalink
userns: Remove unnecessary cast to struct user_struct when copying cr…
Browse files Browse the repository at this point in the history
…ed->user.

In struct cred the user member is and has always been declared struct user_struct *user.
At most a constant struct cred will have a constant pointer to non-constant user_struct
so remove this unnecessary cast.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Apr 7, 2012
1 parent 39fda8d commit 74ba508
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
break;
case PRIO_USER:
user = (struct user_struct *) cred->user;
user = cred->user;
if (!who)
who = cred->uid;
else if ((who != cred->uid) &&
Expand Down Expand Up @@ -274,7 +274,7 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who)
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
break;
case PRIO_USER:
user = (struct user_struct *) cred->user;
user = cred->user;
if (!who)
who = cred->uid;
else if ((who != cred->uid) &&
Expand Down

0 comments on commit 74ba508

Please sign in to comment.