Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21964764ybl; Mon, 6 Jan 2020 15:07:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzv0DSGyGaMxSRnlwOjXvkboJ/sIXG8Y6ZKIH5kubzYyr0teha+mDNLCG3Zq6yZQK75gzXo X-Received: by 2002:a9d:7d09:: with SMTP id v9mr101994625otn.338.1578352060872; Mon, 06 Jan 2020 15:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578352060; cv=none; d=google.com; s=arc-20160816; b=Iw94O37fsbch6tCAuMuHQHWk/Gyrrqi3FjNy+W2GjPkoI6ZgEcs949kkDmRGCHv41B PLcwDqqJjjV5LvjB0qaFsTVcwbEWbTpeF042u+km+7fCIfe6/RP/MTbaz38eqmoPRUyu rDJPdo+iNZCUeL3s9zXrXiVtQodXuczyMumh1mgPJaZ+X4xCzmtIr84f1UawNjjmv9QF ypOtJynj70UWFHQ+uKA2DsMobIGYU+khqQI1dDQUMmcW1T6yidCuxn0EDqU/Zq1NUz// 1Xw4pCr7HDmmFkPqQNgWMwmaJlotKg4Q6sYdnOvYW3MWZuKlR94pLV5wh29A6fTJH+vZ nYrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YFPtgmu7am1f4EYBfi4KkzbAOi/FXMPKhu8S1KpGb/4=; b=PG1/hhiPCJnu9c/FBxi3igxfMt9kQSaPMmJCZF91N6yjopjlF/I+myIBW3OdhJ9eNo KsxEbfj1d3+nnbKPGkhodlbKqyIpGWYyVsI2mgjkV2pw1Piu/Eu6B6L75hHGuT2ODG4G HbWXffMGa7UTh6MHtTZVmNJx5uVAVBpFvw8U+nZrNC816T1N4ypp8FEmNIynCIPRUXdw kj8PLJ3Ylp+26Jyb9KW5TPS0h9zDjOapqvzyZw1e7oiEZlo12q/8MyDBvfjTxz/bIS+r 1JdBbm5bexwQzNHxChjmAsEniy+/kqdtwTFqcMWe0iEGGzpxNSpCrJ6rwQxcfk8okSZq G3OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aUJR+4Gb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si34791470oih.186.2020.01.06.15.07.28; Mon, 06 Jan 2020 15:07:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aUJR+4Gb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbgAFXFX (ORCPT + 99 others); Mon, 6 Jan 2020 18:05:23 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38120 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbgAFXFR (ORCPT ); Mon, 6 Jan 2020 18:05:17 -0500 Received: by mail-wr1-f66.google.com with SMTP id y17so51809398wrh.5 for ; Mon, 06 Jan 2020 15:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YFPtgmu7am1f4EYBfi4KkzbAOi/FXMPKhu8S1KpGb/4=; b=aUJR+4GbxeThYylY61qSlLQa/j+gyCDHOWZzYTVFfkL0RK++xm94Psbe64jO0Cm3ZY MJbKj2jOr3eNOfv3KewqjyvRvtLA4H3Tr/n1d0pCI/Z3goBsKkLZfM+tLHQO7a6iXmy5 CMzw4bBchTzItKgZxoZmjvnfNubjGupSEospQES7nFYGosxM69MnuPxtl+fQWxAP5+X/ D8Ver0mwlHhyCya8SsAWss6btFwNRwUmY97Xzwq7ooasO6w0sJ2IT3Pf2XzdcfoRvaWF /HostWtyE+6n9RSu7mCIMcemhqU2QJaFV7o2RlCOgfMN5IwVkWrQerOBcH74z4l/h7dw GfqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YFPtgmu7am1f4EYBfi4KkzbAOi/FXMPKhu8S1KpGb/4=; b=DgB8D/DAzU+k6U9p84qxuN/itkSF9iVew36ayF/ulFDz/4F+IicWMiAhKy7lJKNaRv WKCQkeP/9xca924uLVEEoZDxr0wt4eYoR8mmG5w7RuiYippMoIfHTf1t8L5BIuUpID4Y qgkLisuDbm4ZXvyV7PKYUM2C4QzIldVoShGN2Km53M5knaQuMOZSYC7jTjNwBM11T3Ze wIhm6VyO30G/WZMy1lGKkgbMo2TLLCr5Tv4JPrk/iZ2I4o5CWfDM3WWIfGtfUyUMaA5g Ktdt8byJ2+HmLlS7cPe7mppUzJEG003XVIWbGOn2dhrQCMxIvE9s8mlIWRSGkotUqtf5 +QIQ== X-Gm-Message-State: APjAAAUZ1dG3ZLlrPcn9iJhR88SQG9lG4teQBmPpm1p4fHdYxOCthuX3 A1f1B+Ue/5yNe3jn6uIJeRBVm+2eNxBYkfWhf+dSuQ== X-Received: by 2002:a5d:6a0f:: with SMTP id m15mr105033883wru.40.1578351915043; Mon, 06 Jan 2020 15:05:15 -0800 (PST) MIME-Version: 1.0 References: <20200103191852.15357-1-wambui.karugax@gmail.com> In-Reply-To: <20200103191852.15357-1-wambui.karugax@gmail.com> From: Alex Deucher Date: Mon, 6 Jan 2020 18:05:03 -0500 Message-ID: Subject: Re: [PATCH] drm/amd: use list_for_each_entry for list iteration. To: Wambui Karuga Cc: "Deucher, Alexander" , Christian Koenig , Chunming Zhou , Dave Airlie , Daniel Vetter , Maling list - DRI developers , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 3, 2020 at 2:34 PM Wambui Karuga wrote: > > list_for_each() can be replaced by the more concise > list_for_each_entry() here for iteration over the lists. > This change was reported by coccinelle. > > Signed-off-by: Wambui Karuga Applied. Thanks! Alex > --- > .../drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 19 ++++--------------- > 1 file changed, 4 insertions(+), 15 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c > index 64445c4cc4c2..cbcf504f73a5 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c > @@ -111,17 +111,12 @@ static void init_handler_common_data(struct amdgpu_dm_irq_handler_data *hcd, > */ > static void dm_irq_work_func(struct work_struct *work) > { > - struct list_head *entry; > struct irq_list_head *irq_list_head = > container_of(work, struct irq_list_head, work); > struct list_head *handler_list = &irq_list_head->head; > struct amdgpu_dm_irq_handler_data *handler_data; > > - list_for_each(entry, handler_list) { > - handler_data = list_entry(entry, > - struct amdgpu_dm_irq_handler_data, > - list); > - > + list_for_each_entry(handler_data, handler_list, list) { > DRM_DEBUG_KMS("DM_IRQ: work_func: for dal_src=%d\n", > handler_data->irq_source); > > @@ -528,19 +523,13 @@ static void amdgpu_dm_irq_immediate_work(struct amdgpu_device *adev, > enum dc_irq_source irq_source) > { > struct amdgpu_dm_irq_handler_data *handler_data; > - struct list_head *entry; > unsigned long irq_table_flags; > > DM_IRQ_TABLE_LOCK(adev, irq_table_flags); > > - list_for_each( > - entry, > - &adev->dm.irq_handler_list_high_tab[irq_source]) { > - > - handler_data = list_entry(entry, > - struct amdgpu_dm_irq_handler_data, > - list); > - > + list_for_each_entry(handler_data, > + &adev->dm.irq_handler_list_high_tab[irq_source], > + list) { > /* Call a subcomponent which registered for immediate > * interrupt notification */ > handler_data->handler(handler_data->handler_arg); > -- > 2.17.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx