kernel/sys.c: whitespace fixes
Fix minor errors and warning messages in kernel/sys.c. These errors were reported by checkpatch while working with some modifications in sys.c file. Fixing this first will help me to improve my further patches. ERROR: trailing whitespace - 9 ERROR: do not use assignment in if condition - 4 ERROR: spaces required around that '?' (ctx:VxO) - 10 ERROR: switch and case should be at the same indent - 3 total 26 errors & 3 warnings fixed. Signed-off-by: vishnu.ps <vishnu.ps@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
067b722faf
commit
ec94fc3d59
37
kernel/sys.c
37
kernel/sys.c
|
@ -204,10 +204,11 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
|
||||||
user = cred->user;
|
user = cred->user;
|
||||||
if (!who)
|
if (!who)
|
||||||
uid = cred->uid;
|
uid = cred->uid;
|
||||||
else if (!uid_eq(uid, cred->uid) &&
|
else if (!uid_eq(uid, cred->uid)) {
|
||||||
!(user = find_user(uid)))
|
user = find_user(uid);
|
||||||
|
if (!user)
|
||||||
goto out_unlock; /* No processes for this user */
|
goto out_unlock; /* No processes for this user */
|
||||||
|
}
|
||||||
do_each_thread(g, p) {
|
do_each_thread(g, p) {
|
||||||
if (uid_eq(task_uid(p), uid))
|
if (uid_eq(task_uid(p), uid))
|
||||||
error = set_one_prio(p, niceval, error);
|
error = set_one_prio(p, niceval, error);
|
||||||
|
@ -271,10 +272,11 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who)
|
||||||
user = cred->user;
|
user = cred->user;
|
||||||
if (!who)
|
if (!who)
|
||||||
uid = cred->uid;
|
uid = cred->uid;
|
||||||
else if (!uid_eq(uid, cred->uid) &&
|
else if (!uid_eq(uid, cred->uid)) {
|
||||||
!(user = find_user(uid)))
|
user = find_user(uid);
|
||||||
|
if (!user)
|
||||||
goto out_unlock; /* No processes for this user */
|
goto out_unlock; /* No processes for this user */
|
||||||
|
}
|
||||||
do_each_thread(g, p) {
|
do_each_thread(g, p) {
|
||||||
if (uid_eq(task_uid(p), uid)) {
|
if (uid_eq(task_uid(p), uid)) {
|
||||||
niceval = nice_to_rlimit(task_nice(p));
|
niceval = nice_to_rlimit(task_nice(p));
|
||||||
|
@ -637,10 +639,12 @@ SYSCALL_DEFINE3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t _
|
||||||
euid = from_kuid_munged(cred->user_ns, cred->euid);
|
euid = from_kuid_munged(cred->user_ns, cred->euid);
|
||||||
suid = from_kuid_munged(cred->user_ns, cred->suid);
|
suid = from_kuid_munged(cred->user_ns, cred->suid);
|
||||||
|
|
||||||
if (!(retval = put_user(ruid, ruidp)) &&
|
retval = put_user(ruid, ruidp);
|
||||||
!(retval = put_user(euid, euidp)))
|
if (!retval) {
|
||||||
retval = put_user(suid, suidp);
|
retval = put_user(euid, euidp);
|
||||||
|
if (!retval)
|
||||||
|
return put_user(suid, suidp);
|
||||||
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,9 +713,12 @@ SYSCALL_DEFINE3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t _
|
||||||
egid = from_kgid_munged(cred->user_ns, cred->egid);
|
egid = from_kgid_munged(cred->user_ns, cred->egid);
|
||||||
sgid = from_kgid_munged(cred->user_ns, cred->sgid);
|
sgid = from_kgid_munged(cred->user_ns, cred->sgid);
|
||||||
|
|
||||||
if (!(retval = put_user(rgid, rgidp)) &&
|
retval = put_user(rgid, rgidp);
|
||||||
!(retval = put_user(egid, egidp)))
|
if (!retval) {
|
||||||
|
retval = put_user(egid, egidp);
|
||||||
|
if (!retval)
|
||||||
retval = put_user(sgid, sgidp);
|
retval = put_user(sgid, sgidp);
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -1284,7 +1291,6 @@ SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
|
||||||
/*
|
/*
|
||||||
* Back compatibility for getrlimit. Needed for some apps.
|
* Back compatibility for getrlimit. Needed for some apps.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
|
SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
|
||||||
struct rlimit __user *, rlim)
|
struct rlimit __user *, rlim)
|
||||||
{
|
{
|
||||||
|
@ -1527,7 +1533,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
|
||||||
cputime_t tgutime, tgstime, utime, stime;
|
cputime_t tgutime, tgstime, utime, stime;
|
||||||
unsigned long maxrss = 0;
|
unsigned long maxrss = 0;
|
||||||
|
|
||||||
memset((char *) r, 0, sizeof *r);
|
memset((char *)r, 0, sizeof (*r));
|
||||||
utime = stime = 0;
|
utime = stime = 0;
|
||||||
|
|
||||||
if (who == RUSAGE_THREAD) {
|
if (who == RUSAGE_THREAD) {
|
||||||
|
@ -1585,6 +1591,7 @@ out:
|
||||||
|
|
||||||
if (who != RUSAGE_CHILDREN) {
|
if (who != RUSAGE_CHILDREN) {
|
||||||
struct mm_struct *mm = get_task_mm(p);
|
struct mm_struct *mm = get_task_mm(p);
|
||||||
|
|
||||||
if (mm) {
|
if (mm) {
|
||||||
setmax_mm_hiwater_rss(&maxrss, mm);
|
setmax_mm_hiwater_rss(&maxrss, mm);
|
||||||
mmput(mm);
|
mmput(mm);
|
||||||
|
@ -1596,6 +1603,7 @@ out:
|
||||||
int getrusage(struct task_struct *p, int who, struct rusage __user *ru)
|
int getrusage(struct task_struct *p, int who, struct rusage __user *ru)
|
||||||
{
|
{
|
||||||
struct rusage r;
|
struct rusage r;
|
||||||
|
|
||||||
k_getrusage(p, who, &r);
|
k_getrusage(p, who, &r);
|
||||||
return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
|
return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
|
||||||
}
|
}
|
||||||
|
@ -2209,6 +2217,7 @@ SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int cpu = raw_smp_processor_id();
|
int cpu = raw_smp_processor_id();
|
||||||
|
|
||||||
if (cpup)
|
if (cpup)
|
||||||
err |= put_user(cpu, cpup);
|
err |= put_user(cpu, cpup);
|
||||||
if (nodep)
|
if (nodep)
|
||||||
|
|
Loading…
Reference in New Issue