aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-20 13:19:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-20 13:19:03 -0400
commit6496edfce95f943e1da43631c2f437509e56af7f (patch)
tree6b6e3b6bcc74c038b707a2facf45ee98fd61544e /drivers
parentb19a42e3cb9e73cad59e60ab7403e5afe7f4b262 (diff)
parente4afa120c98252e44390067c3a6cc775cde30659 (diff)
Merge tag 'cpumask-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull final removal of deprecated cpus_* cpumask functions from Rusty Russell: "This is the final removal (after several years!) of the obsolete cpus_* functions, prompted by their mis-use in staging. With these function removed, all cpu functions should only iterate to nr_cpu_ids, so we finally only allocate that many bits when cpumasks are allocated offstack" * tag 'cpumask-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (25 commits) cpumask: remove __first_cpu / __next_cpu cpumask: resurrect CPU_MASK_CPU0 linux/cpumask.h: add typechecking to cpumask_test_cpu cpumask: only allocate nr_cpumask_bits. Fix weird uses of num_online_cpus(). cpumask: remove deprecated functions. mips: fix obsolete cpumask_of_cpu usage. x86: fix more deprecated cpu function usage. ia64: remove deprecated cpus_ usage. powerpc: fix deprecated CPU_MASK_CPU0 usage. CPU_MASK_ALL/CPU_MASK_NONE: remove from deprecated region. staging/lustre/o2iblnd: Don't use cpus_weight staging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_ staging/lustre/ptlrpc: Do not use deprecated cpus_* functions blackfin: fix up obsolete cpu function usage. parisc: fix up obsolete cpu function usage. tile: fix up obsolete cpu function usage. arm64: fix up obsolete cpu function usage. mips: fix up obsolete cpu function usage. x86: fix up obsolete cpu function usage. ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clocksource/dw_apb_timer.c3
-rw-r--r--drivers/cpuidle/coupled.c6
-rw-r--r--drivers/crypto/n2_core.c4
-rw-r--r--drivers/irqchip/irq-gic-v3.c2
-rw-r--r--drivers/irqchip/irq-mips-gic.c6
-rw-r--r--drivers/net/ethernet/tile/tilegx.c4
-rw-r--r--drivers/scsi/hpsa.c6
7 files changed, 15 insertions, 16 deletions
diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index f3656a6b0382..35a88097af3c 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -117,7 +117,8 @@ static void apbt_set_mode(enum clock_event_mode mode,
117 unsigned long period; 117 unsigned long period;
118 struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt); 118 struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
119 119
120 pr_debug("%s CPU %d mode=%d\n", __func__, first_cpu(*evt->cpumask), 120 pr_debug("%s CPU %d mode=%d\n", __func__,
121 cpumask_first(evt->cpumask),
121 mode); 122 mode);
122 123
123 switch (mode) { 124 switch (mode) {
diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index 73fe2f8d7f96..7936dce4b878 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -292,7 +292,7 @@ static inline int cpuidle_coupled_get_state(struct cpuidle_device *dev,
292 */ 292 */
293 smp_rmb(); 293 smp_rmb();
294 294
295 for_each_cpu_mask(i, coupled->coupled_cpus) 295 for_each_cpu(i, &coupled->coupled_cpus)
296 if (cpu_online(i) && coupled->requested_state[i] < state) 296 if (cpu_online(i) && coupled->requested_state[i] < state)
297 state = coupled->requested_state[i]; 297 state = coupled->requested_state[i];
298 298
@@ -338,7 +338,7 @@ static void cpuidle_coupled_poke_others(int this_cpu,
338{ 338{
339 int cpu; 339 int cpu;
340 340
341 for_each_cpu_mask(cpu, coupled->coupled_cpus) 341 for_each_cpu(cpu, &coupled->coupled_cpus)
342 if (cpu != this_cpu && cpu_online(cpu)) 342 if (cpu != this_cpu && cpu_online(cpu))
343 cpuidle_coupled_poke(cpu); 343 cpuidle_coupled_poke(cpu);
344} 344}
@@ -638,7 +638,7 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev)
638 if (cpumask_empty(&dev->coupled_cpus)) 638 if (cpumask_empty(&dev->coupled_cpus))
639 return 0; 639 return 0;
640 640
641 for_each_cpu_mask(cpu, dev->coupled_cpus) { 641 for_each_cpu(cpu, &dev->coupled_cpus) {
642 other_dev = per_cpu(cpuidle_devices, cpu); 642 other_dev = per_cpu(cpuidle_devices, cpu);
643 if (other_dev && other_dev->coupled) { 643 if (other_dev && other_dev->coupled) {
644 coupled = other_dev->coupled; 644 coupled = other_dev->coupled;
diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index afd136b45f49..10a9aeff1666 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -1754,7 +1754,7 @@ static int spu_mdesc_walk_arcs(struct mdesc_handle *mdesc,
1754 dev->dev.of_node->full_name); 1754 dev->dev.of_node->full_name);
1755 return -EINVAL; 1755 return -EINVAL;
1756 } 1756 }
1757 cpu_set(*id, p->sharing); 1757 cpumask_set_cpu(*id, &p->sharing);
1758 table[*id] = p; 1758 table[*id] = p;
1759 } 1759 }
1760 return 0; 1760 return 0;
@@ -1776,7 +1776,7 @@ static int handle_exec_unit(struct spu_mdesc_info *ip, struct list_head *list,
1776 return -ENOMEM; 1776 return -ENOMEM;
1777 } 1777 }
1778 1778
1779 cpus_clear(p->sharing); 1779 cpumask_clear(&p->sharing);
1780 spin_lock_init(&p->lock); 1780 spin_lock_init(&p->lock);
1781 p->q_type = q_type; 1781 p->q_type = q_type;
1782 INIT_LIST_HEAD(&p->jobs); 1782 INIT_LIST_HEAD(&p->jobs);
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 4f2fb62e6f37..49875adb6b44 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -567,7 +567,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
567 */ 567 */
568 smp_wmb(); 568 smp_wmb();
569 569
570 for_each_cpu_mask(cpu, *mask) { 570 for_each_cpu(cpu, mask) {
571 u64 cluster_id = cpu_logical_map(cpu) & ~0xffUL; 571 u64 cluster_id = cpu_logical_map(cpu) & ~0xffUL;
572 u16 tlist; 572 u16 tlist;
573 573
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index bc48b7dc89ec..57f09cb54464 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -389,19 +389,19 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
389 int i; 389 int i;
390 390
391 cpumask_and(&tmp, cpumask, cpu_online_mask); 391 cpumask_and(&tmp, cpumask, cpu_online_mask);
392 if (cpus_empty(tmp)) 392 if (cpumask_empty(&tmp))
393 return -EINVAL; 393 return -EINVAL;
394 394
395 /* Assumption : cpumask refers to a single CPU */ 395 /* Assumption : cpumask refers to a single CPU */
396 spin_lock_irqsave(&gic_lock, flags); 396 spin_lock_irqsave(&gic_lock, flags);
397 397
398 /* Re-route this IRQ */ 398 /* Re-route this IRQ */
399 gic_map_to_vpe(irq, first_cpu(tmp)); 399 gic_map_to_vpe(irq, cpumask_first(&tmp));
400 400
401 /* Update the pcpu_masks */ 401 /* Update the pcpu_masks */
402 for (i = 0; i < NR_CPUS; i++) 402 for (i = 0; i < NR_CPUS; i++)
403 clear_bit(irq, pcpu_masks[i].pcpu_mask); 403 clear_bit(irq, pcpu_masks[i].pcpu_mask);
404 set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask); 404 set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask);
405 405
406 cpumask_copy(d->affinity, cpumask); 406 cpumask_copy(d->affinity, cpumask);
407 spin_unlock_irqrestore(&gic_lock, flags); 407 spin_unlock_irqrestore(&gic_lock, flags);
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index a789a2054388..a3f7610002aa 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -1123,7 +1123,7 @@ static int alloc_percpu_mpipe_resources(struct net_device *dev,
1123 addr + i * sizeof(struct tile_net_comps); 1123 addr + i * sizeof(struct tile_net_comps);
1124 1124
1125 /* If this is a network cpu, create an iqueue. */ 1125 /* If this is a network cpu, create an iqueue. */
1126 if (cpu_isset(cpu, network_cpus_map)) { 1126 if (cpumask_test_cpu(cpu, &network_cpus_map)) {
1127 order = get_order(NOTIF_RING_SIZE); 1127 order = get_order(NOTIF_RING_SIZE);
1128 page = homecache_alloc_pages(GFP_KERNEL, order, cpu); 1128 page = homecache_alloc_pages(GFP_KERNEL, order, cpu);
1129 if (page == NULL) { 1129 if (page == NULL) {
@@ -1299,7 +1299,7 @@ static int tile_net_init_mpipe(struct net_device *dev)
1299 int first_ring, ring; 1299 int first_ring, ring;
1300 int instance = mpipe_instance(dev); 1300 int instance = mpipe_instance(dev);
1301 struct mpipe_data *md = &mpipe_data[instance]; 1301 struct mpipe_data *md = &mpipe_data[instance];
1302 int network_cpus_count = cpus_weight(network_cpus_map); 1302 int network_cpus_count = cpumask_weight(&network_cpus_map);
1303 1303
1304 if (!hash_default) { 1304 if (!hash_default) {
1305 netdev_err(dev, "Networking requires hash_default!\n"); 1305 netdev_err(dev, "Networking requires hash_default!\n");
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index a1cfbd3dda47..8eab107b53fb 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6632,14 +6632,12 @@ static void fail_all_outstanding_cmds(struct ctlr_info *h)
6632 6632
6633static void set_lockup_detected_for_all_cpus(struct ctlr_info *h, u32 value) 6633static void set_lockup_detected_for_all_cpus(struct ctlr_info *h, u32 value)
6634{ 6634{
6635 int i, cpu; 6635 int cpu;
6636 6636
6637 cpu = cpumask_first(cpu_online_mask); 6637 for_each_online_cpu(cpu) {
6638 for (i = 0; i < num_online_cpus(); i++) {
6639 u32 *lockup_detected; 6638 u32 *lockup_detected;
6640 lockup_detected = per_cpu_ptr(h->lockup_detected, cpu); 6639 lockup_detected = per_cpu_ptr(h->lockup_detected, cpu);
6641 *lockup_detected = value; 6640 *lockup_detected = value;
6642 cpu = cpumask_next(cpu, cpu_online_mask);
6643 } 6641 }
6644 wmb(); /* be sure the per-cpu variables are out to memory */ 6642 wmb(); /* be sure the per-cpu variables are out to memory */
6645} 6643}