diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-03-06 21:06:47 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-10 19:26:05 -0800 |
commit | d93f27b732062bbd7f93275613fc3f4081cda381 (patch) | |
tree | f54ab5f6ef7cb2efd8738d43aa65538357e56acd /drivers | |
parent | 7b50908a5eee25125023e22c5fed93f659bddd00 (diff) | |
download | linux-d93f27b732062bbd7f93275613fc3f4081cda381.tar.bz2 |
Staging: most: Use list_first_entry instead of list_entry
This patch replaces list_entry with list_first_entry as it makes the
code more clear.
Done using coccinelle:
@@
expression e;
@@
(
- list_entry(e->next,
+ list_first_entry(e,
...)
|
- list_entry(e->prev,
+ list_last_entry(e,
...)
)
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/most/hdm-dim2/dim2_hdm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/most/hdm-dim2/dim2_hdm.c index caff5b209c9b..0dc86add7161 100644 --- a/drivers/staging/most/hdm-dim2/dim2_hdm.c +++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c @@ -251,7 +251,7 @@ static int try_start_dim_transfer(struct hdm_channel *hdm_ch) return -EAGAIN; } - mbo = list_entry(head->next, struct mbo, list); + mbo = list_first_entry(head, struct mbo, list); buf_size = mbo->buffer_length; BUG_ON(mbo->bus_address == 0); @@ -362,7 +362,7 @@ static void service_done_flag(struct dim2_hdm *dev, int ch_idx) break; } - mbo = list_entry(head->next, struct mbo, list); + mbo = list_first_entry(head, struct mbo, list); list_del(head->next); spin_unlock_irqrestore(&dim_lock, flags); @@ -495,7 +495,7 @@ static void complete_all_mbos(struct list_head *head) break; } - mbo = list_entry(head->next, struct mbo, list); + mbo = list_first_entry(head, struct mbo, list); list_del(head->next); spin_unlock_irqrestore(&dim_lock, flags); |