Skip to content

Commit 74ba508

Browse files
committed
userns: Remove unnecessary cast to struct user_struct when copying cred->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 <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
1 parent 39fda8d commit 74ba508

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
209209
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
210210
break;
211211
case PRIO_USER:
212-
user = (struct user_struct *) cred->user;
212+
user = cred->user;
213213
if (!who)
214214
who = cred->uid;
215215
else if ((who != cred->uid) &&
@@ -274,7 +274,7 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who)
274274
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
275275
break;
276276
case PRIO_USER:
277-
user = (struct user_struct *) cred->user;
277+
user = cred->user;
278278
if (!who)
279279
who = cred->uid;
280280
else if ((who != cred->uid) &&

0 commit comments

Comments
 (0)