Skip to content

Commit f201903

Browse files
kosakidavem330
authored andcommitted
convert old cpumask API into new one
Adapt new API. Signed-off-by: KOSAKI Motohiro <[email protected]> Signed-off-by: Frank Blaschka <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9f6298a commit f201903

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

net/iucv/iucv.c

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ struct iucv_irq_list {
128128
};
129129

130130
static struct iucv_irq_data *iucv_irq_data[NR_CPUS];
131-
static cpumask_t iucv_buffer_cpumask = CPU_MASK_NONE;
132-
static cpumask_t iucv_irq_cpumask = CPU_MASK_NONE;
131+
static cpumask_t iucv_buffer_cpumask = { CPU_BITS_NONE };
132+
static cpumask_t iucv_irq_cpumask = { CPU_BITS_NONE };
133133

134134
/*
135135
* Queue of interrupt buffers lock for delivery via the tasklet
@@ -406,7 +406,7 @@ static void iucv_allow_cpu(void *data)
406406
parm->set_mask.ipmask = 0xf8;
407407
iucv_call_b2f0(IUCV_SETCONTROLMASK, parm);
408408
/* Set indication that iucv interrupts are allowed for this cpu. */
409-
cpu_set(cpu, iucv_irq_cpumask);
409+
cpumask_set_cpu(cpu, &iucv_irq_cpumask);
410410
}
411411

412412
/**
@@ -426,7 +426,7 @@ static void iucv_block_cpu(void *data)
426426
iucv_call_b2f0(IUCV_SETMASK, parm);
427427

428428
/* Clear indication that iucv interrupts are allowed for this cpu. */
429-
cpu_clear(cpu, iucv_irq_cpumask);
429+
cpumask_clear_cpu(cpu, &iucv_irq_cpumask);
430430
}
431431

432432
/**
@@ -451,7 +451,7 @@ static void iucv_block_cpu_almost(void *data)
451451
iucv_call_b2f0(IUCV_SETCONTROLMASK, parm);
452452

453453
/* Clear indication that iucv interrupts are allowed for this cpu. */
454-
cpu_clear(cpu, iucv_irq_cpumask);
454+
cpumask_clear_cpu(cpu, &iucv_irq_cpumask);
455455
}
456456

457457
/**
@@ -466,7 +466,7 @@ static void iucv_declare_cpu(void *data)
466466
union iucv_param *parm;
467467
int rc;
468468

469-
if (cpu_isset(cpu, iucv_buffer_cpumask))
469+
if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask))
470470
return;
471471

472472
/* Declare interrupt buffer. */
@@ -499,9 +499,9 @@ static void iucv_declare_cpu(void *data)
499499
}
500500

501501
/* Set indication that an iucv buffer exists for this cpu. */
502-
cpu_set(cpu, iucv_buffer_cpumask);
502+
cpumask_set_cpu(cpu, &iucv_buffer_cpumask);
503503

504-
if (iucv_nonsmp_handler == 0 || cpus_empty(iucv_irq_cpumask))
504+
if (iucv_nonsmp_handler == 0 || cpumask_empty(&iucv_irq_cpumask))
505505
/* Enable iucv interrupts on this cpu. */
506506
iucv_allow_cpu(NULL);
507507
else
@@ -520,7 +520,7 @@ static void iucv_retrieve_cpu(void *data)
520520
int cpu = smp_processor_id();
521521
union iucv_param *parm;
522522

523-
if (!cpu_isset(cpu, iucv_buffer_cpumask))
523+
if (!cpumask_test_cpu(cpu, &iucv_buffer_cpumask))
524524
return;
525525

526526
/* Block iucv interrupts. */
@@ -531,7 +531,7 @@ static void iucv_retrieve_cpu(void *data)
531531
iucv_call_b2f0(IUCV_RETRIEVE_BUFFER, parm);
532532

533533
/* Clear indication that an iucv buffer exists for this cpu. */
534-
cpu_clear(cpu, iucv_buffer_cpumask);
534+
cpumask_clear_cpu(cpu, &iucv_buffer_cpumask);
535535
}
536536

537537
/**
@@ -546,8 +546,8 @@ static void iucv_setmask_mp(void)
546546
get_online_cpus();
547547
for_each_online_cpu(cpu)
548548
/* Enable all cpus with a declared buffer. */
549-
if (cpu_isset(cpu, iucv_buffer_cpumask) &&
550-
!cpu_isset(cpu, iucv_irq_cpumask))
549+
if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask) &&
550+
!cpumask_test_cpu(cpu, &iucv_irq_cpumask))
551551
smp_call_function_single(cpu, iucv_allow_cpu,
552552
NULL, 1);
553553
put_online_cpus();
@@ -564,9 +564,9 @@ static void iucv_setmask_up(void)
564564
int cpu;
565565

566566
/* Disable all cpu but the first in cpu_irq_cpumask. */
567-
cpumask = iucv_irq_cpumask;
568-
cpu_clear(first_cpu(iucv_irq_cpumask), cpumask);
569-
for_each_cpu_mask_nr(cpu, cpumask)
567+
cpumask_copy(&cpumask, &iucv_irq_cpumask);
568+
cpumask_clear_cpu(cpumask_first(&iucv_irq_cpumask), &cpumask);
569+
for_each_cpu(cpu, &cpumask)
570570
smp_call_function_single(cpu, iucv_block_cpu, NULL, 1);
571571
}
572572

@@ -593,7 +593,7 @@ static int iucv_enable(void)
593593
rc = -EIO;
594594
for_each_online_cpu(cpu)
595595
smp_call_function_single(cpu, iucv_declare_cpu, NULL, 1);
596-
if (cpus_empty(iucv_buffer_cpumask))
596+
if (cpumask_empty(&iucv_buffer_cpumask))
597597
/* No cpu could declare an iucv buffer. */
598598
goto out;
599599
put_online_cpus();
@@ -675,15 +675,16 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self,
675675
case CPU_DOWN_PREPARE_FROZEN:
676676
if (!iucv_path_table)
677677
break;
678-
cpumask = iucv_buffer_cpumask;
679-
cpu_clear(cpu, cpumask);
680-
if (cpus_empty(cpumask))
678+
cpumask_copy(&cpumask, &iucv_buffer_cpumask);
679+
cpumask_clear_cpu(cpu, &cpumask);
680+
if (cpumask_empty(&cpumask))
681681
/* Can't offline last IUCV enabled cpu. */
682682
return notifier_from_errno(-EINVAL);
683683
smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 1);
684-
if (cpus_empty(iucv_irq_cpumask))
685-
smp_call_function_single(first_cpu(iucv_buffer_cpumask),
686-
iucv_allow_cpu, NULL, 1);
684+
if (cpumask_empty(&iucv_irq_cpumask))
685+
smp_call_function_single(
686+
cpumask_first(&iucv_buffer_cpumask),
687+
iucv_allow_cpu, NULL, 1);
687688
break;
688689
}
689690
return NOTIFY_OK;
@@ -866,7 +867,7 @@ int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
866867
int rc;
867868

868869
local_bh_disable();
869-
if (cpus_empty(iucv_buffer_cpumask)) {
870+
if (cpumask_empty(&iucv_buffer_cpumask)) {
870871
rc = -EIO;
871872
goto out;
872873
}
@@ -915,7 +916,7 @@ int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
915916

916917
spin_lock_bh(&iucv_table_lock);
917918
iucv_cleanup_queue();
918-
if (cpus_empty(iucv_buffer_cpumask)) {
919+
if (cpumask_empty(&iucv_buffer_cpumask)) {
919920
rc = -EIO;
920921
goto out;
921922
}
@@ -975,7 +976,7 @@ int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16])
975976
int rc;
976977

977978
local_bh_disable();
978-
if (cpus_empty(iucv_buffer_cpumask)) {
979+
if (cpumask_empty(&iucv_buffer_cpumask)) {
979980
rc = -EIO;
980981
goto out;
981982
}
@@ -1007,7 +1008,7 @@ int iucv_path_resume(struct iucv_path *path, u8 userdata[16])
10071008
int rc;
10081009

10091010
local_bh_disable();
1010-
if (cpus_empty(iucv_buffer_cpumask)) {
1011+
if (cpumask_empty(&iucv_buffer_cpumask)) {
10111012
rc = -EIO;
10121013
goto out;
10131014
}
@@ -1036,7 +1037,7 @@ int iucv_path_sever(struct iucv_path *path, u8 userdata[16])
10361037
int rc;
10371038

10381039
preempt_disable();
1039-
if (cpus_empty(iucv_buffer_cpumask)) {
1040+
if (cpumask_empty(&iucv_buffer_cpumask)) {
10401041
rc = -EIO;
10411042
goto out;
10421043
}
@@ -1070,7 +1071,7 @@ int iucv_message_purge(struct iucv_path *path, struct iucv_message *msg,
10701071
int rc;
10711072

10721073
local_bh_disable();
1073-
if (cpus_empty(iucv_buffer_cpumask)) {
1074+
if (cpumask_empty(&iucv_buffer_cpumask)) {
10741075
rc = -EIO;
10751076
goto out;
10761077
}
@@ -1162,7 +1163,7 @@ int __iucv_message_receive(struct iucv_path *path, struct iucv_message *msg,
11621163
if (msg->flags & IUCV_IPRMDATA)
11631164
return iucv_message_receive_iprmdata(path, msg, flags,
11641165
buffer, size, residual);
1165-
if (cpus_empty(iucv_buffer_cpumask)) {
1166+
if (cpumask_empty(&iucv_buffer_cpumask)) {
11661167
rc = -EIO;
11671168
goto out;
11681169
}
@@ -1235,7 +1236,7 @@ int iucv_message_reject(struct iucv_path *path, struct iucv_message *msg)
12351236
int rc;
12361237

12371238
local_bh_disable();
1238-
if (cpus_empty(iucv_buffer_cpumask)) {
1239+
if (cpumask_empty(&iucv_buffer_cpumask)) {
12391240
rc = -EIO;
12401241
goto out;
12411242
}
@@ -1274,7 +1275,7 @@ int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg,
12741275
int rc;
12751276

12761277
local_bh_disable();
1277-
if (cpus_empty(iucv_buffer_cpumask)) {
1278+
if (cpumask_empty(&iucv_buffer_cpumask)) {
12781279
rc = -EIO;
12791280
goto out;
12801281
}
@@ -1324,7 +1325,7 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
13241325
union iucv_param *parm;
13251326
int rc;
13261327

1327-
if (cpus_empty(iucv_buffer_cpumask)) {
1328+
if (cpumask_empty(&iucv_buffer_cpumask)) {
13281329
rc = -EIO;
13291330
goto out;
13301331
}
@@ -1411,7 +1412,7 @@ int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
14111412
int rc;
14121413

14131414
local_bh_disable();
1414-
if (cpus_empty(iucv_buffer_cpumask)) {
1415+
if (cpumask_empty(&iucv_buffer_cpumask)) {
14151416
rc = -EIO;
14161417
goto out;
14171418
}
@@ -1888,7 +1889,7 @@ static int iucv_pm_freeze(struct device *dev)
18881889
printk(KERN_WARNING "iucv_pm_freeze\n");
18891890
#endif
18901891
if (iucv_pm_state != IUCV_PM_FREEZING) {
1891-
for_each_cpu_mask_nr(cpu, iucv_irq_cpumask)
1892+
for_each_cpu(cpu, &iucv_irq_cpumask)
18921893
smp_call_function_single(cpu, iucv_block_cpu_almost,
18931894
NULL, 1);
18941895
cancel_work_sync(&iucv_work);
@@ -1928,7 +1929,7 @@ static int iucv_pm_thaw(struct device *dev)
19281929
if (rc)
19291930
goto out;
19301931
}
1931-
if (cpus_empty(iucv_irq_cpumask)) {
1932+
if (cpumask_empty(&iucv_irq_cpumask)) {
19321933
if (iucv_nonsmp_handler)
19331934
/* enable interrupts on one cpu */
19341935
iucv_allow_cpu(NULL);
@@ -1961,7 +1962,7 @@ static int iucv_pm_restore(struct device *dev)
19611962
pr_warning("Suspending Linux did not completely close all IUCV "
19621963
"connections\n");
19631964
iucv_pm_state = IUCV_PM_RESTORING;
1964-
if (cpus_empty(iucv_irq_cpumask)) {
1965+
if (cpumask_empty(&iucv_irq_cpumask)) {
19651966
rc = iucv_query_maxconn();
19661967
rc = iucv_enable();
19671968
if (rc)

0 commit comments

Comments
 (0)