Skip to content

Commit

Permalink
tree-wide: use reinit_completion instead of INIT_COMPLETION
Browse files Browse the repository at this point in the history
Use this new function to make code more comprehensible, since we are
reinitialzing the completion, not initializing.

[[email protected]: linux-next resyncs]
Signed-off-by: Wolfram Sang <[email protected]>
Acked-by: Linus Walleij <[email protected]> (personally at LCE13)
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Wolfram Sang authored and torvalds committed Nov 15, 2013
1 parent c32f74a commit 16735d0
Show file tree
Hide file tree
Showing 86 changed files with 138 additions and 138 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-tegra/apbio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/powermac/low_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion crypto/af_alg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/amiflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2808,7 +2808,7 @@ static int sendcmd_withirq_core(ctlr_info_t *h, CommandList_struct *c,
/* 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;
}

Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hw_random/timeriomem-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/crypto/tegra-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion drivers/firewire/core-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/hid/hid-wiimote.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/jz4740-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-designware-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-ismt.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
desc->dptr_high = upper_32_bits(dma_addr);
}

INIT_COMPLETION(priv->cmp);
reinit_completion(&priv->cmp);

/* Add the descriptor */
ismt_submit_desc(priv);
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
return err;
}
} else {
INIT_COMPLETION(i2c->cmd_complete);
reinit_completion(&i2c->cmd_complete);
ret = mxs_i2c_dma_setup_xfer(adap, msg, flags);
if (ret)
return ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
w |= OMAP_I2C_BUF_RXFIF_CLR | OMAP_I2C_BUF_TXFIF_CLR;
omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG, w);

INIT_COMPLETION(dev->cmd_complete);
reinit_completion(&dev->cmd_complete);
dev->cmd_err = 0;

w = OMAP_I2C_CON_EN | OMAP_I2C_CON_MST | OMAP_I2C_CON_STT;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
i2c_dev->msg_buf_remaining = msg->len;
i2c_dev->msg_err = I2C_ERR_NONE;
i2c_dev->msg_read = (msg->flags & I2C_M_RD);
INIT_COMPLETION(i2c_dev->msg_complete);
reinit_completion(&i2c_dev->msg_complete);

packet_header = (0 << PACKET_HEADER0_HEADER_SIZE_SHIFT) |
PACKET_HEADER0_PROTOCOL_I2C |
Expand Down
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-wmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static int wmt_i2c_write(struct i2c_adapter *adap, struct i2c_msg *pmsg,
writew(val, i2c_dev->base + REG_CR);
}

INIT_COMPLETION(i2c_dev->complete);
reinit_completion(&i2c_dev->complete);

if (i2c_dev->mode == I2C_MODE_STANDARD)
tcr_val = TCR_STANDARD_MODE;
Expand Down Expand Up @@ -247,7 +247,7 @@ static int wmt_i2c_read(struct i2c_adapter *adap, struct i2c_msg *pmsg,
writew(val, i2c_dev->base + REG_CR);
}

INIT_COMPLETION(i2c_dev->complete);
reinit_completion(&i2c_dev->complete);

if (i2c_dev->mode == I2C_MODE_STANDARD)
tcr_val = TCR_STANDARD_MODE;
Expand Down
6 changes: 3 additions & 3 deletions drivers/iio/adc/ad_sigma_delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,

spi_bus_lock(sigma_delta->spi->master);
sigma_delta->bus_locked = true;
INIT_COMPLETION(sigma_delta->completion);
reinit_completion(&sigma_delta->completion);

ret = ad_sigma_delta_set_mode(sigma_delta, mode);
if (ret < 0)
Expand Down Expand Up @@ -259,7 +259,7 @@ int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev,

spi_bus_lock(sigma_delta->spi->master);
sigma_delta->bus_locked = true;
INIT_COMPLETION(sigma_delta->completion);
reinit_completion(&sigma_delta->completion);

ad_sigma_delta_set_mode(sigma_delta, AD_SD_MODE_SINGLE);

Expand Down Expand Up @@ -343,7 +343,7 @@ static int ad_sd_buffer_postdisable(struct iio_dev *indio_dev)
{
struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev);

INIT_COMPLETION(sigma_delta->completion);
reinit_completion(&sigma_delta->completion);
wait_for_completion_timeout(&sigma_delta->completion, HZ);

if (!sigma_delta->irq_dis) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/adc/nau7802.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static int nau7802_read_irq(struct iio_dev *indio_dev,
struct nau7802_state *st = iio_priv(indio_dev);
int ret;

INIT_COMPLETION(st->value_ok);
reinit_completion(&st->value_ok);
enable_irq(st->client->irq);

nau7802_sync(st);
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/cyttsp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static int cyttsp_soft_reset(struct cyttsp *ts)
int retval;

/* wait for interrupt to set ready completion */
INIT_COMPLETION(ts->bl_ready);
reinit_completion(&ts->bl_ready);
ts->state = CY_BL_STATE;

enable_irq(ts->irq);
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ static int crypt_convert(struct crypt_config *cc,
/* async */
case -EBUSY:
wait_for_completion(&ctx->restart);
INIT_COMPLETION(ctx->restart);
reinit_completion(&ctx->restart);
/* fall through*/
case -EINPROGRESS:
this_cc->req = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/blackfin/bfin_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
return ret;
}

INIT_COMPLETION(bcap_dev->comp);
reinit_completion(&bcap_dev->comp);
bcap_dev->stop = false;
return 0;
}
Expand Down
Loading

0 comments on commit 16735d0

Please sign in to comment.