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

From: Andy Shevchenko
Date: Tue Apr 25 2017 - 14:15:25 EST


On Tue, 2017-04-25 at 16:13 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
>
> convert list_for_each() to list_for_each_entry() where
> applicable.
>

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

> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> ---
> Â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@xxxxxxxxxxxxxxx>
Intel Finland Oy