Re: [PATCH 02/31] drm/i915: Prefer list_first_entry_or_null

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

 



On Mon, Jul 25, 2016 at 10:55:24AM +0300, Joonas Lahtinen wrote:
> On ma, 2016-07-25 at 08:44 +0100, Chris Wilson wrote:
> > list_first_entry_or_null() can generate better code than using
> > if (!list_empty()) {ptr = list_first_entry()) ..., so put it to use.
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> 
> It looks cleaner, not so sure of the code impact.

After the patch I sent to linux-kernel@ to improve code gneration for
list_first_entry_or_null() is applied we save a few bytes on each
invocation.

There are a few other places where I could have used
list_first_entry_or_null() but I have already sent patches transforming
the code so I didn't bother with the intermediate minor improvement.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux