From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31CA3C433E0 for ; Fri, 5 Jun 2020 14:50:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 129E9206F0 for ; Fri, 5 Jun 2020 14:50:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 129E9206F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 724916E92A; Fri, 5 Jun 2020 14:50:12 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC9976E92A for ; Fri, 5 Jun 2020 14:50:10 +0000 (UTC) IronPort-SDR: z9WwQukdezHC5ijWhTFaaGbEzbQE7YDooX0dmP6GF2FecdCZ7AC9HPbM/7y9INfom9ngo5OKoY yuk/H4MDnFUw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2020 07:50:10 -0700 IronPort-SDR: VzH84+KQZq7CXKTIDmgxiynXFPjeNylKuZEZ0MxcrJExUU/LtY3hhnEWUcHoF6WWW52uikeRUm DS9Butp8bgEw== X-IronPort-AV: E=Sophos;i="5.73,476,1583222400"; d="scan'208";a="445914746" Received: from ogabay-mobl1.ger.corp.intel.com (HELO [10.214.202.54]) ([10.214.202.54]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2020 07:50:09 -0700 To: Chris Wilson , intel-gfx@lists.freedesktop.org References: <20200605095858.28455-1-chris@chris-wilson.co.uk> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc Message-ID: <793dd101-48c9-7344-5291-8e7f5b65ca96@linux.intel.com> Date: Fri, 5 Jun 2020 15:50:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200605095858.28455-1-chris@chris-wilson.co.uk> Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH 1/5] drm/i915: Add list_for_each_entry_safe_continue_reverse X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 05/06/2020 10:58, Chris Wilson wrote: > One more list iterator variant, for when we want to unwind from inside > one list iterator with the intention of restarting from the current > entry as the new head of the list. > > Signed-off-by: Chris Wilson > --- > drivers/gpu/drm/i915/i915_utils.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h > index 03a73d2bd50d..6ebccdd12d4c 100644 > --- a/drivers/gpu/drm/i915/i915_utils.h > +++ b/drivers/gpu/drm/i915/i915_utils.h > @@ -266,6 +266,12 @@ static inline int list_is_last_rcu(const struct list_head *list, > return READ_ONCE(list->next) == head; > } > > +#define list_for_each_entry_safe_continue_reverse(pos, n, head, member) \ > + for (pos = list_prev_entry(pos, member), \ > + n = list_prev_entry(pos, member); \ > + &pos->member != (head); \ > + pos = n, n = list_prev_entry(n, member)) > + > /* > * Wait until the work is finally complete, even if it tries to postpone > * by requeueing itself. Note, that if the worker never cancels itself, > Reviewed-by: Tvrtko Ursulin Regards, Tvrtko _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx