x86: Simplify bound checks in the MTRR code
authorArjan van de Ven <arjan@infradead.org>
Sat, 26 Sep 2009 18:51:50 +0000 (20:51 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 2 Oct 2009 17:51:56 +0000 (19:51 +0200)
commit11879ba5d9ab8174af9b9cefbb2396a54dfbf8c1
tree6f33aa93436dbf959e6c9e10f8b113801eca59cb
parent0d18b2e34bd1ad8f5bd3f3a17b5e7df132e511a9
x86: Simplify bound checks in the MTRR code

The current bound checks for copy_from_user in the MTRR driver are
not as obvious as they could be, and gcc agrees with that.

This patch simplifies the boundary checks to the point that gcc can
now prove to itself that the copy_from_user() is never going past
its bounds.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20090926205150.30797709@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/mtrr/if.c