From 2af7142ab895de8dc14d12855cef1f730ebcb522 Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Wed, 7 Apr 2010 13:52:08 -0400 Subject: [PATCH] --- yaml --- r: 189662 b: refs/heads/master c: 45c4d015a92f72ec47acd0c7557abdc0c8a6499d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/ata.h | 4 ++-- trunk/kernel/sched.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 4cdff08e9abc..a28bc8c1a570 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2aedd192f799c362ccefc3c316f0c4bd5154126b +refs/heads/master: 45c4d015a92f72ec47acd0c7557abdc0c8a6499d diff --git a/trunk/include/linux/ata.h b/trunk/include/linux/ata.h index b4c85e2adef5..700c5b9b3583 100644 --- a/trunk/include/linux/ata.h +++ b/trunk/include/linux/ata.h @@ -1025,8 +1025,8 @@ static inline int ata_ok(u8 status) static inline int lba_28_ok(u64 block, u32 n_block) { - /* check the ending block number */ - return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); + /* check the ending block number: must be LESS THAN 0x0fffffff */ + return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256); } static inline int lba_48_ok(u64 block, u32 n_block) diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 6af210a7de70..a3dff1f3f9b0 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -4903,7 +4903,7 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, int ret; cpumask_var_t mask; - if ((len * BITS_PER_BYTE) < nr_cpu_ids) + if (len < nr_cpu_ids) return -EINVAL; if (len & (sizeof(unsigned long)-1)) return -EINVAL;