serial: icom: use list_for_each_entry()
authorJiri Slaby <jslaby@suse.cz>
Thu, 21 Apr 2022 08:58:06 +0000 (10:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Apr 2022 14:19:52 +0000 (16:19 +0200)
commite391e325478f9c4d4cae757ef528f21d605f450a
treef56086104426adca4d0d04c2db427b3132ca20ff
parent8b026d636d4a4a92533b7f28a86e59ffd6d7acad
serial: icom: use list_for_each_entry()

Use list_for_each_entry() helper instead of explicit combo of
list_for_each() and list_entry().

Note that pos is used as a reference point in list_add_tail() in
icom_alloc_adapter(). This functionality remains as with an empty list,
cur_adapter_entry->icom_adapter_entry is still the list head.

This simplifies the code a bit.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220421085808.24152-9-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/icom.c