Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18902399ybl; Fri, 3 Jan 2020 11:20:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwsrcqGFIw/ctpVUXSVh8qq06b3KPcQxnFdr4z6R979zXeQjT2Rqrps978vYUiwz8tYYo+3 X-Received: by 2002:a9d:d0b:: with SMTP id 11mr103379759oti.287.1578079224449; Fri, 03 Jan 2020 11:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578079224; cv=none; d=google.com; s=arc-20160816; b=SdqPSe2bcvlwHsMkwAMCzAP+0ZwLfnDA4nWGIR9luNCYyesaLXyOLjuWseVH6dT+jn xtHveTT8q6diz47WbnHri0ySv6JjDdg99otxIRXYVV4Q6ZOx3dRFqf+vPadwBtY/p7bM pYGZolyGkWCf3bsWphnYhto9pkSuTcBtPu0kdxoJtUVDv2QT0uc7DjCd0NXiNNe3sAlQ 5u0kaqwd2I0x3uzY5bQjC5sf1ITMZ1Byf+T/DtB/yQBcXdMDeXZHMCmM7U1MKgRdfXS6 Td5yEDmheRA51xBwPz1QnctcUia5w16pMgydVMHZoqC80TlnWo81bHqpS6dFyX1zhEBp MV3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5dSmFZluAq2raBNcYBXyZnuaNy9LKDAB9e+tRyUJHwo=; b=ifVdbOk7BDkWNJQemTKg0fwfHkJPTH1R7+chpoLInIQeJZ6R35RSzgnGE4RPGkuZlT pJMZRsNEInsvTfhJZz3tig4CFSJFik73HWu1RbpKRMVDvUFacaUSJlZ57RzcbuwTAWGz Ue0+kV3VCMTLENNeAvUfYYNmn52GnESnaLd6N7EXwvDWwi7R9UtfGW/UgT7kz7zyn0Mr QLqjpzHlvGN3rSGCpN9ga8MvQNdH6DTEVgMW+5eVgPFrVdA2fWZt0iPvDdW0+L9YCsjz OERKK4aAd4KyS9TV7CL5e1MZNErrDqtb7LsLvJsxyzRz9ruQpCU4Z+knSKtQAhbrkc8g 50bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gqa1jDSZ; 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 d12si30363610otf.141.2020.01.03.11.20.12; Fri, 03 Jan 2020 11:20:24 -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=gqa1jDSZ; 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 S1728530AbgACTTC (ORCPT + 99 others); Fri, 3 Jan 2020 14:19:02 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41131 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728438AbgACTTB (ORCPT ); Fri, 3 Jan 2020 14:19:01 -0500 Received: by mail-wr1-f67.google.com with SMTP id c9so43385630wrw.8 for ; Fri, 03 Jan 2020 11:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5dSmFZluAq2raBNcYBXyZnuaNy9LKDAB9e+tRyUJHwo=; b=gqa1jDSZE/L2osiIIKIHEf+8Onp0s7+Cl2aUOZUBp+CtkWBbOIKaeR6eus9Vzoj1Vv 6i+XsbG8uR26Xo7qKmLKHQYud4nDhF6fnAXleOx9b44hvqA93sQvv1ARppStS1+x5utU Ric5b3G9qOEMjLILKGf3JERRqYvkuiIjbvGsEENkNX01RxeFU5i8gvuX50GRDK3QzFKX T5Eub4OTbgzNRIfrPlHCa6tGC86MhsizMIpq1Xeq6WapTX8W6hYhjXr23OzZ6o0d+K/k Sj3ncLy9Xy07e1Te1YGN+hj7oCcmZhKl+tiSNeU8wZ8TJRKoTHkwrPAbbX4+drs1YCfi mBmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5dSmFZluAq2raBNcYBXyZnuaNy9LKDAB9e+tRyUJHwo=; b=g4+i+QgkVzEX1nsmpvz3qK8bN42gy33mMDAWZBr/MfpRLFVQPK9gfkxPtyso/mVWlp wi72DfNXV5qUc+0CZmkxnsW5+EQhL9IRHx34yfz2lD/qlfq/GGqo/U5nIR9Iibl4Xiwu lCeK2oCNaP+SWukejz2Fncln0nu0xQAFCG7lU8MJsZJSR165L6bkV9SgMCFjOsX2UfTK z/ukqBJbxaNbRTNTt2DYdw0/+5Nllh+w6PeKm8hqDP0ZKyWKR3GhgDG9j4P9eQrmlAsp MKVyo7N1ET/x/Ka0gX9Tl/lRMCkun5iMsTShbJ50vEPwrZOfTD28yz6+5Rh/Rhpl2iVX FQug== X-Gm-Message-State: APjAAAXmRwdOUTViGLVUJ1kwEjok6L29iuJGR7pkrdNj+sD70Usd93Yc nV5zZtnf4mXthii85/8KVIsi00NHUe8= X-Received: by 2002:adf:a109:: with SMTP id o9mr95675914wro.189.1578079139609; Fri, 03 Jan 2020 11:18:59 -0800 (PST) Received: from localhost.localdomain ([197.254.95.38]) by smtp.googlemail.com with ESMTPSA id w8sm13270262wmm.0.2020.01.03.11.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 11:18:58 -0800 (PST) From: Wambui Karuga To: alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, airlied@linux.ie, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd: use list_for_each_entry for list iteration. Date: Fri, 3 Jan 2020 22:18:52 +0300 Message-Id: <20200103191852.15357-1-wambui.karugax@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- .../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