]> asedeno.scripts.mit.edu Git - linux.git/commit
drm: Replace 'format->format' comparisons to just 'format' comparisons
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 18 Nov 2016 19:53:10 +0000 (21:53 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 15 Dec 2016 12:55:34 +0000 (14:55 +0200)
commitdbd4d5761e1f06fd86abe0b256e049b501cea059
tree475751161a79520e7e16f3c660a40e388b6e0dd6
parent438b74a5497c36d6d59baded434002e30267cabe
drm: Replace 'format->format' comparisons to just 'format' comparisons

Rather than compare the format u32s of two format infos, we can direclty
compare the format info pointers themselves. Noramlly all the ->format
pointers all point to somwehere in the big array, so this is a valid
way to test for equality.

Also drivers may want to point ->format at a private format info struct
instead (eg. for special compressed formats with extra planes), so
just comparing the pixel format values wouldn't necessaritly even work.
But comparing the pointers will also take care of that case.

@@
struct drm_framebuffer *a;
struct drm_framebuffer *b;
@@
(
- a->format->format != b->format->format
+ a->format != b->format
|
- a->format->format == b->format->format
+ a->format == b->format
)

@@
struct drm_plane_state *a;
struct drm_plane_state *b;
@@
(
- a->fb->format->format != b->fb->format->format
+ a->fb->format != b->fb->format
|
- a->fb->format->format == b->fb->format->format
+ a->fb->format == b->fb->format
)

@@
struct drm_crtc *crtc;
struct drm_framebuffer *x;
@@
(
- crtc->primary->fb->format->format != x->format->format
+ crtc->primary->fb->format != x->format
|
- x->format->format != crtc->primary->fb->format->format
+ x->format != crtc->primary->fb->format
)

@@
struct drm_mode_set *set;
@@
- set->fb->format->format != set->crtc->primary->fb->format->format
+ set->fb->format != set->crtc->primary->fb->format

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-35-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/armada/armada_crtc.c
drivers/gpu/drm/drm_crtc_helper.c
drivers/gpu/drm/drm_plane.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/imx/ipuv3-plane.c
drivers/gpu/drm/tilcdc/tilcdc_plane.c