projects/linux·commit 8bc037fb

sched: Use proper type in sched_getaffinity()

8bc037fb · KOSAKI Motohiro <[email protected]> · 2010-03-17 09:36:58 +09:00

Using the proper type fixes the following compiler warning:

  kernel/sched.c:4850: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: KOSAKI Motohiro <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Commit
8bc037fb89bb3104b9ae290d18c877624cd7d9cc
Parents
c890692b

Changes

1 files changed · +1 −1

FileStatusAddDelContent
kernel/sched.cmodified+1−1View file

kernel/sched.c

View file
diff --git a/kernel/sched.c b/kernel/sched.c
index 82975b5..49d2fa7 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4912,7 +4912,7 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
ret = sched_getaffinity(pid, mask);
if (ret == 0) {
- int retlen = min(len, cpumask_size());
+ size_t retlen = min_t(size_t, len, cpumask_size());
if (copy_to_user(user_mask_ptr, mask, retlen))
ret = -EFAULT;