Skip to contentSkip to conversation

auxdisplay: Convert list_for_each to entry variant

PATCH In review Wei Yongjun 2 participants 2 messages Apr 25, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 auxdisplay: Convert list_for_each to entry variant

From: Wei Yongjun <[email protected]>

convert list_for_each() to list_for_each_entry() where applicable.

---
 drivers/auxdisplay/panel.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/auxdisplay/panel.c +1 -4
index e0c014c..7a8b8fb 100644
@@ -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)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

convert list_for_each() to list_for_each_entry() where applicable.

Here it's safe to do.
FWIW:

Quoted 28 lines

---
 drivers/auxdisplay/panel.c | 5 +----

 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/auxdisplay/panel.c +0 -0
index e0c014c..7a8b8fb 100644
@@ -1345,14 +1345,11 @@ static inline void input_state_falling(struct
 logical_input *input)


 static void panel_process_inputs(void)
 {

drivers/auxdisplay/panel.c +0 -1
-	struct list_head *item;

  struct logical_input *input;

  keypressed = 0;
  inputs_stable = 1;

drivers/auxdisplay/panel.c +1 -3
-	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-

Quoted 1 line

value)

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy