diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-03-01 14:45:47 -0500 | 
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-03-01 14:45:47 -0500 | 
| commit | d2dbaad8555b9a078830ac1aab7ef7a37461c640 (patch) | |
| tree | 6d455666df51db6a24834e6551e246e0c0d0d078 /arch/i386/kernel/microcode.c | |
| parent | cccc65a3b60edaf721cdee5a14f68ba009341822 (diff) | |
| parent | 71efa38c0eef581c69c221ceb8645f61d1e93270 (diff) | |
Merge branch 'master'
Diffstat (limited to 'arch/i386/kernel/microcode.c')
| -rw-r--r-- | arch/i386/kernel/microcode.c | 15 | 
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index d3fdf0057d8..5390b521aca 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -74,6 +74,7 @@  #include <linux/kernel.h>  #include <linux/init.h>  #include <linux/sched.h> +#include <linux/cpumask.h>  #include <linux/module.h>  #include <linux/slab.h>  #include <linux/vmalloc.h> @@ -250,8 +251,8 @@ static int find_matching_ucodes (void)  			error = -EINVAL;  			goto out;  		} -		 -		for (cpu_num = 0; cpu_num < num_online_cpus(); cpu_num++) { + +		for_each_online_cpu(cpu_num) {  			struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;  			if (uci->err != MC_NOTFOUND) /* already found a match or not an online cpu*/  				continue; @@ -293,7 +294,7 @@ static int find_matching_ucodes (void)  					error = -EFAULT;  					goto out;  				} -				for (cpu_num = 0; cpu_num < num_online_cpus(); cpu_num++) { +				for_each_online_cpu(cpu_num) {  					struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;  					if (uci->err != MC_NOTFOUND) /* already found a match or not an online cpu*/  						continue; @@ -304,7 +305,9 @@ static int find_matching_ucodes (void)  			}  		}  		/* now check if any cpu has matched */ -		for (cpu_num = 0, allocated_flag = 0, sum = 0; cpu_num < num_online_cpus(); cpu_num++) { +		allocated_flag = 0; +		sum = 0; +		for_each_online_cpu(cpu_num) {  			if (ucode_cpu_info[cpu_num].err == MC_MARKED) {   				struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;  				if (!allocated_flag) { @@ -415,12 +418,12 @@ static int do_microcode_update (void)  	}  out_free: -	for (i = 0; i < num_online_cpus(); i++) { +	for_each_online_cpu(i) {  		if (ucode_cpu_info[i].mc) {  			int j;  			void *tmp = ucode_cpu_info[i].mc;  			vfree(tmp); -			for (j = i; j < num_online_cpus(); j++) { +			for_each_online_cpu(j) {  				if (ucode_cpu_info[j].mc == tmp)  					ucode_cpu_info[j].mc = NULL;  			}  | 
