Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6750932ybc; Thu, 28 Nov 2019 04:57:25 -0800 (PST) X-Google-Smtp-Source: APXvYqws/NO/a8Xb078n0MLgAMwW9nnrr8a1lqhN3k3tUysesWEXCiObzIsbInx5BYBajOMDIGhl X-Received: by 2002:a17:906:c41:: with SMTP id t1mr54166087ejf.282.1574945845576; Thu, 28 Nov 2019 04:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574945845; cv=none; d=google.com; s=arc-20160816; b=DU9Og65R9bZttSXp29n5tlYTdjp+Bz7eTtyde1p9hIwq5gIasSjjf7gzwiBBmMjpAn zQAMOeh2oDG4dOV9YsWAmLy5X0VwjZeZax0X51y3SfZZ5DkXfIG7rerlAOvFj/2l68Ru 9CM1Y9nty9uVmIkIOVt31Wo35HsrQyWxiAA7UcO39wLj6NSCEMT3lANtvTt5T/Tvv5Fm 2RKm1WVta3bcfvXW/mVW7EGa8RJigHusBwFWNxh3zJX1wHd5ihXp9ZbF+WJEgEvsMP83 VJIfNZc6jrerGVrWlK4DHdcuZ1asOX1dj3JOAWk6pm4lfNnqfeWHM5bFZJOUdkaIKN06 qpGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=m3Jr01mJ0u9NGil/O2wJJ3l7AiZZW+JOeM2UUWSFkpA=; b=My+kH/S4iyr7GMY7CWRUKZnj5Tqo1a9UGAnLi41JEkEqsQ8NWhQcRA+IKxyoeJnAd7 CS0q0qJYNNDDlf3LapSs855NjAJThRdGaTfPbftI7EqgQmQKBlAfFyaAR5/X9LHkjvlh HhE7b2PAJzJc3IY/bABrA7i4omOfxTZ0HTkh56dEdvb7iPrt5u3ll+JFmFFF2zDS+giJ chojgO+SvyeJ/IZCZdnR7UCAZkSkLhrXcpKg4UhHHtEMFnVUMvqeWlxBLSB6WcsqMMab hZMzZu/0YSHkt7mKXIysohdhY3WUTyYnZ9s7d7GhK10wHFtIfsVuVKyO5s8aQKO/6ZZ6 jQ6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si895666ejs.314.2019.11.28.04.57.00; Thu, 28 Nov 2019 04:57:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbfK1M4t (ORCPT + 99 others); Thu, 28 Nov 2019 07:56:49 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:47357 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbfK1M4t (ORCPT ); Thu, 28 Nov 2019 07:56:49 -0500 Received: from orion.localdomain ([95.117.37.214]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mj8Vx-1hvDjy246X-00fC0B; Thu, 28 Nov 2019 13:54:35 +0100 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: tim@buttersideup.com, james.morse@arm.com, rrichter@marvell.com, jdelvare@suse.com, linux@roeck-us.net, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pci@vger.kernel.org Subject: [PATCH 4/6] edac: i82443bxgx_edac: use pci_get_device_by_id() Date: Thu, 28 Nov 2019 13:54:04 +0100 Message-Id: <20191128125406.10417-4-info@metux.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191128125406.10417-1-info@metux.net> References: <20191128125406.10417-1-info@metux.net> X-Provags-ID: V03:K1:9EUuGTPFx9yVqpEoKdlnLYODqk9fzt9TtUcFLxUJNQuCt8Dur2J ACsPPHh76A4wFy8Z88Uwcih8Gh0dLZpBgM8CFlKvY0QA8CbpcQLiyPn2pyQvfVC0LvrKJga Cc1aJBxlcwchVkCPVIP3TXc8IMtS9wGQaNQjzGegaEmSeVHuId1bQ7trzN6njcAQpcGXqw0 CyUuKxSGvW13czLk3/woA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:/fn+U6evcp8=:mG00zLE+KR2h6oHqb9009C L0fikJ9nBQgS+pmDUpSajRT4HUgHowXnOvY7nwciAUil9VzSSq5nS6YUn9wUiEJbCmBNMLBBi 9GNdhWPS1tyZZwSwlZKHW8wKz+wikAN8xUu6xrk4YFNN23kXZplI4zmNLc+Lm5NyhRAcNdTIn zy59HI05sybYGVBCSLYg7ZHBT8R1zeYbZwKMqGNW4KS58cEhkWwLinI5jCexhRJ84HZZ+BoN1 G3gCzTOfZgWRYOZCs88AkG/lhETTv0KlMQYhKgL7ekvBt7psZVSXZ/8i3OBWs8nO/GhCTTNyJ zoZAY24hx+Pi36uQKrn26DyHbKnFkAWh/JhYMI+8XYHj3RMrXDJmLGAADEQ8R7udrni5VDqRQ lIUeB02b37i4SJS82xbox6wwsVxwI4Y0yKU7hg41FJkk0yO59QBugIBSQMqoMuC8LwGZhF5Tt ChOYleEqTKERFMWYdnAQpTtmOUQYPTKU/6K02ai1cOGFMYV2JbZk1eMDM/7homG2m5rb9bIIl FtwTTsakh/VyDO4Xv+1wDFd/Ikjme1b8mbIQclCY8siGvzx4CZh0wrQpHYOLhR6tJC17XL3mK IaVxXZbWmn5zjH4JoffpYxppi9setLwa8TImMh23Np222al9COuJD16fmAPMYIbRxoHwrk4HP 8Sd3yluxx5TCu/GorU/8vmVsRwGuRqEDm9KjAC2Cnn94lyTRGo1dVG/xfH+/xJGUfQgeab/lE IAshHFivK66H3YugaZnI3Fi5fIl4E0cFBdikOvm05PGkuNcE6Jv9wBeexKJo7o3NB+eECt7hu 99QB4XBE7inceZX+WISbvRB+ohIstws4Entssak1jqg2wR4RN1TBTWYp/wY0m2rLoAKQCa+x/ B6FZ1HHlOMjNBYVsVT/A== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use the new pci_get_device_by_id() helper in order to reduce a bit of boilerplate. Signed-off-by: Enrico Weigelt, metux IT consult --- drivers/edac/i82443bxgx_edac.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c index a2ca929e2168..c01f51a4848c 100644 --- a/drivers/edac/i82443bxgx_edac.c +++ b/drivers/edac/i82443bxgx_edac.c @@ -407,15 +407,13 @@ static int __init i82443bxgx_edacmc_init(void) goto fail0; if (mci_pdev == NULL) { - const struct pci_device_id *id = &i82443bxgx_pci_tbl[0]; int i = 0; i82443bxgx_registered = 0; - while (mci_pdev == NULL && id->vendor != 0) { - mci_pdev = pci_get_device(id->vendor, - id->device, NULL); + while (mci_pdev == NULL && i82443bxgx_pci_tbl[i].vendor) { + mci_pdev = pci_get_device_by_id( + &i82443bxgx_pci_tbl[i]); i++; - id = &i82443bxgx_pci_tbl[i]; } if (!mci_pdev) { edac_dbg(0, "i82443bxgx pci_get_device fail\n"); -- 2.11.0