linux-sg2042/drivers/gpu/drm/tinydrm
Harsha Sharma b7fa1bdb10 drm/tinydrm: Replace list_for_each with list_for_each_entry
Replace use of list_for_each with list_for_each_entry to simplify the
code and remove variables that are used only in list_for_each.
Done with following coccinelle patch:

@r@
identifier fn,i,f,p;
expression e;
iterator name list_for_each, list_for_each_entry;
type T;
@@

fn(...) {
++ T *i;
  <+...
- list_for_each(p,e)
+ list_for_each_entry(i,e,f)
  {
              ...
-   T *i = list_entry(p,T,f);
                  ...
   }
   ...+>
}

@@
identifier r.fn,r.p;
@@

fn(...) {
  ...
- struct list_head *p;
  ... when != p
}

@@
identifier r.fn,r.i,r.f;
expression r.e;
statement S;
@@

fn(...) {
  <...
  list_for_each_entry(i,e,f)
- {
  S
- }
  ...>
}

@s@
identifier i,f,p;
expression e;
type T;
@@

- list_for_each(p,e)
+ list_for_each_entry(i,e,f)
  {
    ... when != T *i;
-   i = list_entry(p,T,f);
    ...
  }

@@
identifier s.p;
@@

- struct list_head *p;
  ... when != p

@@
identifier s.i,s.f;
expression s.e;
statement S;
@@

  list_for_each_entry(i,e,f)
- {
  S
- }

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171014202823.29230-1-harshasharmaiitr@gmail.com
2017-10-21 16:28:41 +02:00
..
core drm/tinydrm: Replace list_for_each with list_for_each_entry 2017-10-21 16:28:41 +02:00
Kconfig drm/tinydrm: add support for LEGO MINDSTORMS EV3 LCD 2017-08-11 18:30:19 +02:00
Makefile drm/tinydrm: add support for LEGO MINDSTORMS EV3 LCD 2017-08-11 18:30:19 +02:00
mi0283qt.c drm/tinydrm: Replace dev_error with DRM_DEV_ERROR 2017-10-13 17:34:42 +02:00
mipi-dbi.c drm/tinydrm: Use drm_gem_framebuffer_helper 2017-10-01 16:59:49 +02:00
repaper.c drm/tinydrm: Replace dev_error with DRM_DEV_ERROR 2017-10-13 17:34:42 +02:00
st7586.c drm/tinydrm: Replace dev_error with DRM_DEV_ERROR 2017-10-13 17:34:42 +02:00