You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
c32f74ab28
commit
16735d022f
@@ -114,7 +114,7 @@ static int do_dma_transfer(unsigned long apb_add,
|
||||
dma_desc->callback = apb_dma_complete;
|
||||
dma_desc->callback_param = NULL;
|
||||
|
||||
INIT_COMPLETION(tegra_apb_wait);
|
||||
reinit_completion(&tegra_apb_wait);
|
||||
|
||||
dmaengine_submit(dma_desc);
|
||||
dma_async_issue_pending(tegra_apb_dma_chan);
|
||||
|
||||
@@ -452,7 +452,7 @@ static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
|
||||
*/
|
||||
if (use_irq) {
|
||||
/* Clear completion */
|
||||
INIT_COMPLETION(host->complete);
|
||||
reinit_completion(&host->complete);
|
||||
/* Ack stale interrupts */
|
||||
kw_write_reg(reg_isr, kw_read_reg(reg_isr));
|
||||
/* Arm timeout */
|
||||
@@ -717,7 +717,7 @@ static int pmu_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
INIT_COMPLETION(comp);
|
||||
reinit_completion(&comp);
|
||||
req->data[0] = PMU_I2C_CMD;
|
||||
req->reply[0] = 0xff;
|
||||
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,
|
||||
|
||||
hdr->bus = PMU_I2C_BUS_STATUS;
|
||||
|
||||
INIT_COMPLETION(comp);
|
||||
reinit_completion(&comp);
|
||||
req->data[0] = PMU_I2C_CMD;
|
||||
req->reply[0] = 0xff;
|
||||
req->nbytes = 2;
|
||||
|
||||
@@ -106,7 +106,7 @@ static int pseries_prepare_late(void)
|
||||
atomic_set(&suspend_data.done, 0);
|
||||
atomic_set(&suspend_data.error, 0);
|
||||
suspend_data.complete = &suspend_work;
|
||||
INIT_COMPLETION(suspend_work);
|
||||
reinit_completion(&suspend_work);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -434,7 +434,7 @@ int af_alg_wait_for_completion(int err, struct af_alg_completion *completion)
|
||||
case -EINPROGRESS:
|
||||
case -EBUSY:
|
||||
wait_for_completion(&completion->completion);
|
||||
INIT_COMPLETION(completion->completion);
|
||||
reinit_completion(&completion->completion);
|
||||
err = completion->err;
|
||||
break;
|
||||
};
|
||||
|
||||
+2
-2
@@ -493,7 +493,7 @@ static inline int do_one_ahash_op(struct ahash_request *req, int ret)
|
||||
ret = wait_for_completion_interruptible(&tr->completion);
|
||||
if (!ret)
|
||||
ret = tr->err;
|
||||
INIT_COMPLETION(tr->completion);
|
||||
reinit_completion(&tr->completion);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -721,7 +721,7 @@ static inline int do_one_acipher_op(struct ablkcipher_request *req, int ret)
|
||||
ret = wait_for_completion_interruptible(&tr->completion);
|
||||
if (!ret)
|
||||
ret = tr->err;
|
||||
INIT_COMPLETION(tr->completion);
|
||||
reinit_completion(&tr->completion);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
+6
-6
@@ -179,7 +179,7 @@ static int do_one_async_hash_op(struct ahash_request *req,
|
||||
ret = wait_for_completion_interruptible(&tr->completion);
|
||||
if (!ret)
|
||||
ret = tr->err;
|
||||
INIT_COMPLETION(tr->completion);
|
||||
reinit_completion(&tr->completion);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -336,7 +336,7 @@ static int __test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,
|
||||
ret = wait_for_completion_interruptible(
|
||||
&tresult.completion);
|
||||
if (!ret && !(ret = tresult.err)) {
|
||||
INIT_COMPLETION(tresult.completion);
|
||||
reinit_completion(&tresult.completion);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
@@ -543,7 +543,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
|
||||
ret = wait_for_completion_interruptible(
|
||||
&result.completion);
|
||||
if (!ret && !(ret = result.err)) {
|
||||
INIT_COMPLETION(result.completion);
|
||||
reinit_completion(&result.completion);
|
||||
break;
|
||||
}
|
||||
case -EBADMSG:
|
||||
@@ -697,7 +697,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
|
||||
ret = wait_for_completion_interruptible(
|
||||
&result.completion);
|
||||
if (!ret && !(ret = result.err)) {
|
||||
INIT_COMPLETION(result.completion);
|
||||
reinit_completion(&result.completion);
|
||||
break;
|
||||
}
|
||||
case -EBADMSG:
|
||||
@@ -983,7 +983,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
|
||||
ret = wait_for_completion_interruptible(
|
||||
&result.completion);
|
||||
if (!ret && !((ret = result.err))) {
|
||||
INIT_COMPLETION(result.completion);
|
||||
reinit_completion(&result.completion);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
@@ -1086,7 +1086,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
|
||||
ret = wait_for_completion_interruptible(
|
||||
&result.completion);
|
||||
if (!ret && !((ret = result.err))) {
|
||||
INIT_COMPLETION(result.completion);
|
||||
reinit_completion(&result.completion);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
|
||||
@@ -3017,7 +3017,7 @@ static inline void ata_eh_pull_park_action(struct ata_port *ap)
|
||||
* ourselves at the beginning of each pass over the loop.
|
||||
*
|
||||
* Additionally, all write accesses to &ap->park_req_pending
|
||||
* through INIT_COMPLETION() (see below) or complete_all()
|
||||
* through reinit_completion() (see below) or complete_all()
|
||||
* (see ata_scsi_park_store()) are protected by the host lock.
|
||||
* As a result we have that park_req_pending.done is zero on
|
||||
* 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)
|
||||
*/
|
||||
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
INIT_COMPLETION(ap->park_req_pending);
|
||||
reinit_completion(&ap->park_req_pending);
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
struct ata_eh_info *ehi = &link->eh_info;
|
||||
|
||||
@@ -757,7 +757,7 @@ void dpm_resume(pm_message_t state)
|
||||
async_error = 0;
|
||||
|
||||
list_for_each_entry(dev, &dpm_suspended_list, power.entry) {
|
||||
INIT_COMPLETION(dev->power.completion);
|
||||
reinit_completion(&dev->power.completion);
|
||||
if (is_async(dev)) {
|
||||
get_device(dev);
|
||||
async_schedule(async_resume, dev);
|
||||
@@ -1237,7 +1237,7 @@ static void async_suspend(void *data, async_cookie_t cookie)
|
||||
|
||||
static int device_suspend(struct device *dev)
|
||||
{
|
||||
INIT_COMPLETION(dev->power.completion);
|
||||
reinit_completion(&dev->power.completion);
|
||||
|
||||
if (pm_async_enabled && dev->power.async_suspend) {
|
||||
get_device(dev);
|
||||
|
||||
@@ -343,7 +343,7 @@ static int fd_motor_on(int nr)
|
||||
unit[nr].motor = 1;
|
||||
fd_select(nr);
|
||||
|
||||
INIT_COMPLETION(motor_on_completion);
|
||||
reinit_completion(&motor_on_completion);
|
||||
motor_on_timer.data = nr;
|
||||
mod_timer(&motor_on_timer, jiffies + HZ/2);
|
||||
|
||||
|
||||
@@ -2808,7 +2808,7 @@ resend_cmd2:
|
||||
/* erase the old error information */
|
||||
memset(c->err_info, 0, sizeof(ErrorInfo_struct));
|
||||
return_status = IO_OK;
|
||||
INIT_COMPLETION(wait);
|
||||
reinit_completion(&wait);
|
||||
goto resend_cmd2;
|
||||
}
|
||||
|
||||
@@ -3669,7 +3669,7 @@ static int add_to_scan_list(struct ctlr_info *h)
|
||||
}
|
||||
}
|
||||
if (!found && !h->busy_scanning) {
|
||||
INIT_COMPLETION(h->scan_wait);
|
||||
reinit_completion(&h->scan_wait);
|
||||
list_add_tail(&h->scan_list, &scan_q);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ static int timeriomem_rng_data_read(struct hwrng *rng, u32 *data)
|
||||
priv->expires = cur + delay;
|
||||
priv->present = 0;
|
||||
|
||||
INIT_COMPLETION(priv->completion);
|
||||
reinit_completion(&priv->completion);
|
||||
mod_timer(&priv->timer, priv->expires);
|
||||
|
||||
return 4;
|
||||
|
||||
@@ -268,7 +268,7 @@ static int aes_start_crypt(struct tegra_aes_dev *dd, u32 in_addr, u32 out_addr,
|
||||
aes_writel(dd, value, TEGRA_AES_SECURE_INPUT_SELECT);
|
||||
|
||||
aes_writel(dd, out_addr, TEGRA_AES_SECURE_DEST_ADDR);
|
||||
INIT_COMPLETION(dd->op_complete);
|
||||
reinit_completion(&dd->op_complete);
|
||||
|
||||
for (i = 0; i < AES_HW_MAX_ICQ_LENGTH - 1; i++) {
|
||||
do {
|
||||
|
||||
@@ -477,7 +477,7 @@ void fw_send_phy_config(struct fw_card *card,
|
||||
phy_config_packet.header[1] = data;
|
||||
phy_config_packet.header[2] = ~data;
|
||||
phy_config_packet.generation = generation;
|
||||
INIT_COMPLETION(phy_config_done);
|
||||
reinit_completion(&phy_config_done);
|
||||
|
||||
card->driver->send_request(card, &phy_config_packet);
|
||||
wait_for_completion_timeout(&phy_config_done, timeout);
|
||||
|
||||
@@ -99,7 +99,7 @@ static int xfer_read(struct i2c_adapter *adap, struct i2c_msg *pmsg)
|
||||
i2c_dev->status = I2C_STAT_INIT;
|
||||
i2c_dev->msg = pmsg;
|
||||
i2c_dev->buf_offset = 0;
|
||||
INIT_COMPLETION(i2c_dev->complete);
|
||||
reinit_completion(&i2c_dev->complete);
|
||||
|
||||
/* Enable I2C transaction */
|
||||
temp = ((pmsg->len) << 20) | HI2C_EDID_READ | HI2C_ENABLE_TRANSACTION;
|
||||
|
||||
@@ -327,7 +327,7 @@ static inline void wiimote_cmd_acquire_noint(struct wiimote_data *wdata)
|
||||
static inline void wiimote_cmd_set(struct wiimote_data *wdata, int cmd,
|
||||
__u32 opt)
|
||||
{
|
||||
INIT_COMPLETION(wdata->state.ready);
|
||||
reinit_completion(&wdata->state.ready);
|
||||
wdata->state.cmd = cmd;
|
||||
wdata->state.opt = opt;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ static ssize_t jz4740_hwmon_read_adcin(struct device *dev,
|
||||
|
||||
mutex_lock(&hwmon->lock);
|
||||
|
||||
INIT_COMPLETION(*completion);
|
||||
reinit_completion(completion);
|
||||
|
||||
enable_irq(hwmon->irq);
|
||||
hwmon->cell->enable(to_platform_device(dev));
|
||||
|
||||
@@ -371,7 +371,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
|
||||
dev_dbg(dev->dev, "transfer: %s %d bytes.\n",
|
||||
(dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len);
|
||||
|
||||
INIT_COMPLETION(dev->cmd_complete);
|
||||
reinit_completion(&dev->cmd_complete);
|
||||
dev->transfer_status = 0;
|
||||
|
||||
if (!dev->buf_len) {
|
||||
|
||||
@@ -151,7 +151,7 @@ static int bcm2835_i2c_xfer_msg(struct bcm2835_i2c_dev *i2c_dev,
|
||||
|
||||
i2c_dev->msg_buf = msg->buf;
|
||||
i2c_dev->msg_buf_remaining = msg->len;
|
||||
INIT_COMPLETION(i2c_dev->completion);
|
||||
reinit_completion(&i2c_dev->completion);
|
||||
|
||||
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR);
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
|
||||
|
||||
davinci_i2c_write_reg(dev, DAVINCI_I2C_CNT_REG, dev->buf_len);
|
||||
|
||||
INIT_COMPLETION(dev->cmd_complete);
|
||||
reinit_completion(&dev->cmd_complete);
|
||||
dev->cmd_err = 0;
|
||||
|
||||
/* Take I2C out of reset and configure it as master */
|
||||
|
||||
@@ -613,7 +613,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
|
||||
mutex_lock(&dev->lock);
|
||||
pm_runtime_get_sync(dev->dev);
|
||||
|
||||
INIT_COMPLETION(dev->cmd_complete);
|
||||
reinit_completion(&dev->cmd_complete);
|
||||
dev->msgs = msgs;
|
||||
dev->msgs_num = num;
|
||||
dev->cmd_err = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user