Skip to content
Commit 0d152523 authored by Sanjana Sanikommu's avatar Sanjana Sanikommu Committed by Greg Kroah-Hartman
Browse files

staging: media: imx: Replace list_entry with list_for_each_entry_safe



Challenge suggested by coccinelle.
Replace use of the combination of list_empty() and list_entry() with
list_for_each_entry_safe() to simplify the code.

Issue found using below Coccinelle script.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: default avatarSanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 643cd0a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment