Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1630742 > unrolled thread

[PATCH -next] auxdisplay: Convert list_for_each to entry variant

Started byWei Yongjun <weiyj.lk@gmail.com>
First post2017-04-25 18:20 +0200
Last post2017-04-25 20:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] auxdisplay: Convert list_for_each to entry variant Wei Yongjun <weiyj.lk@gmail.com> - 2017-04-25 18:20 +0200
    Re: [PATCH -next] auxdisplay: Convert list_for_each to entry variant Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-04-25 20:20 +0200

#1630742 — [PATCH -next] auxdisplay: Convert list_for_each to entry variant

FromWei Yongjun <weiyj.lk@gmail.com>
Date2017-04-25 18:20 +0200
Subject[PATCH -next] auxdisplay: Convert list_for_each to entry variant
Message-ID<tAbm2-70X-17@gated-at.bofh.it>
From: Wei Yongjun <weiyongjun1@huawei.com>

convert list_for_each() to list_for_each_entry() where
applicable.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/auxdisplay/panel.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index e0c014c..7a8b8fb 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -1345,14 +1345,11 @@ static inline void input_state_falling(struct logical_input *input)
 
 static void panel_process_inputs(void)
 {
-	struct list_head *item;
 	struct logical_input *input;
 
 	keypressed = 0;
 	inputs_stable = 1;
-	list_for_each(item, &logical_inputs) {
-		input = list_entry(item, struct logical_input, list);
-
+	list_for_each_entry(input, &logical_inputs, list) {
 		switch (input->state) {
 		case INPUT_ST_LOW:
 			if ((phys_curr & input->mask) != input->value)

[toc] | [next] | [standalone]


#1630851

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-04-25 20:20 +0200
Message-ID<tAdea-88w-15@gated-at.bofh.it>
In reply to#1630742
On Tue, 2017-04-25 at 16:13 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> convert list_for_each() to list_for_each_entry() where
> applicable.
> 

Here it's safe to do.
FWIW: 
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/auxdisplay/panel.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
> index e0c014c..7a8b8fb 100644
> --- a/drivers/auxdisplay/panel.c
> +++ b/drivers/auxdisplay/panel.c
> @@ -1345,14 +1345,11 @@ static inline void input_state_falling(struct
> logical_input *input)
>  
>  static void panel_process_inputs(void)
>  {
> -	struct list_head *item;
>  	struct logical_input *input;
>  
>  	keypressed = 0;
>  	inputs_stable = 1;
> -	list_for_each(item, &logical_inputs) {
> -		input = list_entry(item, struct logical_input, list);
> -
> +	list_for_each_entry(input, &logical_inputs, list) {
>  		switch (input->state) {
>  		case INPUT_ST_LOW:
>  			if ((phys_curr & input->mask) != input-
> >value)
> 

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web