From 366006b1d0ef4fa3f48b385cb61eaf67606849d9 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Wed, 16 Feb 2011 23:48:35 +0900 Subject: [PATCH] --- yaml --- r: 234644 b: refs/heads/master c: da1016df85ed67b6f7dbb765532c54bc35ba08d7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/ioport.c | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index 819b8cc1e0bf..bdc8816050d5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b82fef82d56789439e6be638a87a1a5bba1e6e75 +refs/heads/master: da1016df85ed67b6f7dbb765532c54bc35ba08d7 diff --git a/trunk/arch/x86/kernel/ioport.c b/trunk/arch/x86/kernel/ioport.c index 8eec0ec59af2..8c968974253d 100644 --- a/trunk/arch/x86/kernel/ioport.c +++ b/trunk/arch/x86/kernel/ioport.c @@ -14,22 +14,9 @@ #include #include #include +#include #include -/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ -static void set_bitmap(unsigned long *bitmap, unsigned int base, - unsigned int extent, int new_value) -{ - unsigned int i; - - for (i = base; i < base + extent; i++) { - if (new_value) - __set_bit(i, bitmap); - else - __clear_bit(i, bitmap); - } -} - /* * this changes the io permissions bitmap in the current task. */ @@ -69,7 +56,10 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) */ tss = &per_cpu(init_tss, get_cpu()); - set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); + if (turn_on) + bitmap_clear(t->io_bitmap_ptr, from, num); + else + bitmap_set(t->io_bitmap_ptr, from, num); /* * Search for a (possibly new) maximum. This is simple and stupid,