lkml.org 
[lkml]   [2010]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:sched/urgent] sched: Use proper type in sched_getaffinity()
Commit-ID:  8bc037fb89bb3104b9ae290d18c877624cd7d9cc
Gitweb: http://git.kernel.org/tip/8bc037fb89bb3104b9ae290d18c877624cd7d9cc
Author: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
AuthorDate: Wed, 17 Mar 2010 09:36:58 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 17 Mar 2010 10:48:49 +0100

sched: Use proper type in sched_getaffinity()

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 <kosaki.motohiro@jp.fujitsu.com>
Cc: torvalds@linux-foundation.org
Cc: travis@sgi.com
Cc: peterz@infradead.org
Cc: drepper@redhat.com
Cc: rja@sgi.com
Cc: sharyath@in.ibm.com
Cc: steiner@sgi.com
LKML-Reference: <20100317090046.4C79.A69D9226@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

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;

\
 
 \ /
  Last update: 2010-03-17 11:07    [W:0.048 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site