Skip to content

Commit 16735d0

Browse files
Wolfram Sangtorvalds
authored andcommitted
tree-wide: use reinit_completion instead of INIT_COMPLETION
Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c32f74a commit 16735d0

86 files changed

Lines changed: 138 additions & 138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/mach-tegra/apbio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int do_dma_transfer(unsigned long apb_add,
114114
dma_desc->callback = apb_dma_complete;
115115
dma_desc->callback_param = NULL;
116116

117-
INIT_COMPLETION(tegra_apb_wait);
117+
reinit_completion(&tegra_apb_wait);
118118

119119
dmaengine_submit(dma_desc);
120120
dma_async_issue_pending(tegra_apb_dma_chan);

‎arch/powerpc/platforms/powermac/low_i2c.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
452452
*/
453453
if (use_irq) {
454454
/* Clear completion */
455-
INIT_COMPLETION(host->complete);
455+
reinit_completion(&host->complete);
456456
/* Ack stale interrupts */
457457
kw_write_reg(reg_isr, kw_read_reg(reg_isr));
458458
/* Arm timeout */
@@ -717,7 +717,7 @@ static int pmu_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
717717
return -EINVAL;
718718
}
719719

720-
INIT_COMPLETION(comp);
720+
reinit_completion(&comp);
721721
req->data[0] = PMU_I2C_CMD;
722722
req->reply[0] = 0xff;
723723
req->nbytes = sizeof(struct pmu_i2c_hdr) + 1;
@@ -748,7 +748,7 @@ static int pmu_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
748748

749749
hdr->bus = PMU_I2C_BUS_STATUS;
750750

751-
INIT_COMPLETION(comp);
751+
reinit_completion(&comp);
752752
req->data[0] = PMU_I2C_CMD;
753753
req->reply[0] = 0xff;
754754
req->nbytes = 2;

‎arch/powerpc/platforms/pseries/suspend.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int pseries_prepare_late(void)
106106
atomic_set(&suspend_data.done, 0);
107107
atomic_set(&suspend_data.error, 0);
108108
suspend_data.complete = &suspend_work;
109-
INIT_COMPLETION(suspend_work);
109+
reinit_completion(&suspend_work);
110110
return 0;
111111
}
112112

‎crypto/af_alg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ int af_alg_wait_for_completion(int err, struct af_alg_completion *completion)
434434
case -EINPROGRESS:
435435
case -EBUSY:
436436
wait_for_completion(&completion->completion);
437-
INIT_COMPLETION(completion->completion);
437+
reinit_completion(&completion->completion);
438438
err = completion->err;
439439
break;
440440
};

‎crypto/tcrypt.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static inline int do_one_ahash_op(struct ahash_request *req, int ret)
493493
ret = wait_for_completion_interruptible(&tr->completion);
494494
if (!ret)
495495
ret = tr->err;
496-
INIT_COMPLETION(tr->completion);
496+
reinit_completion(&tr->completion);
497497
}
498498
return ret;
499499
}
@@ -721,7 +721,7 @@ static inline int do_one_acipher_op(struct ablkcipher_request *req, int ret)
721721
ret = wait_for_completion_interruptible(&tr->completion);
722722
if (!ret)
723723
ret = tr->err;
724-
INIT_COMPLETION(tr->completion);
724+
reinit_completion(&tr->completion);
725725
}
726726

727727
return ret;

‎crypto/testmgr.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static int do_one_async_hash_op(struct ahash_request *req,
179179
ret = wait_for_completion_interruptible(&tr->completion);
180180
if (!ret)
181181
ret = tr->err;
182-
INIT_COMPLETION(tr->completion);
182+
reinit_completion(&tr->completion);
183183
}
184184
return ret;
185185
}
@@ -336,7 +336,7 @@ static int __test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,
336336
ret = wait_for_completion_interruptible(
337337
&tresult.completion);
338338
if (!ret && !(ret = tresult.err)) {
339-
INIT_COMPLETION(tresult.completion);
339+
reinit_completion(&tresult.completion);
340340
break;
341341
}
342342
/* fall through */
@@ -543,7 +543,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
543543
ret = wait_for_completion_interruptible(
544544
&result.completion);
545545
if (!ret && !(ret = result.err)) {
546-
INIT_COMPLETION(result.completion);
546+
reinit_completion(&result.completion);
547547
break;
548548
}
549549
case -EBADMSG:
@@ -697,7 +697,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
697697
ret = wait_for_completion_interruptible(
698698
&result.completion);
699699
if (!ret && !(ret = result.err)) {
700-
INIT_COMPLETION(result.completion);
700+
reinit_completion(&result.completion);
701701
break;
702702
}
703703
case -EBADMSG:
@@ -983,7 +983,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
983983
ret = wait_for_completion_interruptible(
984984
&result.completion);
985985
if (!ret && !((ret = result.err))) {
986-
INIT_COMPLETION(result.completion);
986+
reinit_completion(&result.completion);
987987
break;
988988
}
989989
/* fall through */
@@ -1086,7 +1086,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
10861086
ret = wait_for_completion_interruptible(
10871087
&result.completion);
10881088
if (!ret && !((ret = result.err))) {
1089-
INIT_COMPLETION(result.completion);
1089+
reinit_completion(&result.completion);
10901090
break;
10911091
}
10921092
/* fall through */

‎drivers/ata/libata-eh.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,7 @@ static inline void ata_eh_pull_park_action(struct ata_port *ap)
30173017
* ourselves at the beginning of each pass over the loop.
30183018
*
30193019
* Additionally, all write accesses to &ap->park_req_pending
3020-
* through INIT_COMPLETION() (see below) or complete_all()
3020+
* through reinit_completion() (see below) or complete_all()
30213021
* (see ata_scsi_park_store()) are protected by the host lock.
30223022
* As a result we have that park_req_pending.done is zero on
30233023
* exit from this function, i.e. when ATA_EH_PARK actions for
@@ -3031,7 +3031,7 @@ static inline void ata_eh_pull_park_action(struct ata_port *ap)
30313031
*/
30323032

30333033
spin_lock_irqsave(ap->lock, flags);
3034-
INIT_COMPLETION(ap->park_req_pending);
3034+
reinit_completion(&ap->park_req_pending);
30353035
ata_for_each_link(link, ap, EDGE) {
30363036
ata_for_each_dev(dev, link, ALL) {
30373037
struct ata_eh_info *ehi = &link->eh_info;

‎drivers/base/power/main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ void dpm_resume(pm_message_t state)
757757
async_error = 0;
758758

759759
list_for_each_entry(dev, &dpm_suspended_list, power.entry) {
760-
INIT_COMPLETION(dev->power.completion);
760+
reinit_completion(&dev->power.completion);
761761
if (is_async(dev)) {
762762
get_device(dev);
763763
async_schedule(async_resume, dev);
@@ -1237,7 +1237,7 @@ static void async_suspend(void *data, async_cookie_t cookie)
12371237

12381238
static int device_suspend(struct device *dev)
12391239
{
1240-
INIT_COMPLETION(dev->power.completion);
1240+
reinit_completion(&dev->power.completion);
12411241

12421242
if (pm_async_enabled && dev->power.async_suspend) {
12431243
get_device(dev);

‎drivers/block/amiflop.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static int fd_motor_on(int nr)
343343
unit[nr].motor = 1;
344344
fd_select(nr);
345345

346-
INIT_COMPLETION(motor_on_completion);
346+
reinit_completion(&motor_on_completion);
347347
motor_on_timer.data = nr;
348348
mod_timer(&motor_on_timer, jiffies + HZ/2);
349349

‎drivers/block/cciss.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,7 @@ static int sendcmd_withirq_core(ctlr_info_t *h, CommandList_struct *c,
28082808
/* erase the old error information */
28092809
memset(c->err_info, 0, sizeof(ErrorInfo_struct));
28102810
return_status = IO_OK;
2811-
INIT_COMPLETION(wait);
2811+
reinit_completion(&wait);
28122812
goto resend_cmd2;
28132813
}
28142814

@@ -3669,7 +3669,7 @@ static int add_to_scan_list(struct ctlr_info *h)
36693669
}
36703670
}
36713671
if (!found && !h->busy_scanning) {
3672-
INIT_COMPLETION(h->scan_wait);
3672+
reinit_completion(&h->scan_wait);
36733673
list_add_tail(&h->scan_list, &scan_q);
36743674
ret = 1;
36753675
}

0 commit comments

Comments
 (0)