]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1d0446cc3090a7d83e2edb1499313f3c08838723
treef56086104426adca4d0d04c2db427b3132ca20ff
parentb4050b3c0c60b3e16e34c05f796584a939bdfeac
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