Re: [PATCH 10/11] drm/msm/dpu: Further cleanups for static inline functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 19, 2018 at 12:06:20AM +0200, Sam Ravnborg wrote:
> Hi Jordan.
> 
> On Thu, Oct 18, 2018 at 01:58:35PM -0600, Jordan Crouse wrote:
> > Remove more static inline functions that are lightly used and/or
> > very simple and easy to build into the calling functions.
> 
> Please explain the background/analysis that resulted in
> dropping dpu_crtc_get_client_type(), assuming is was always
> the same.

Sure. This would be a good chance to get my story straight.

The original code was:

	struct dpu_crtc_state *cstate =
		crtc ? to_dpu_crtc_state(crtc->state) : NULL;

	if (!cstate)
		return NRT_CLIENT;

	return RT_CLIENT;

And then Sean Paul improved it to:

	return crtc && crtc->state ? RT_CLIENT : NRT_CLIENT;

So I figured that since crtc is known good for all current callers and the
original code assumed that if crtc was good, then crtc->state was good (because
cstate could never be NULL coming from a container_of()) then essentially this
function always returned RT_CLIENT wherever it was used.

My understanding might be flawed if crtc->state can legitimately be NULL when
this function was called.  This might be one of those situations where it
doesn't hurt to check, but removing this function does manage to get rid of
a static inline plus make a few if statements less hairy so I think its a net
win if it can go.

Jordan
-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux