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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7B45C04A68 for ; Tue, 7 Nov 2023 16:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344084AbjKGQEa (ORCPT ); Tue, 7 Nov 2023 11:04:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344421AbjKGQD7 (ORCPT ); Tue, 7 Nov 2023 11:03:59 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BCFC3C3A; Tue, 7 Nov 2023 07:54:56 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61EC5C433CA; Tue, 7 Nov 2023 15:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699372496; bh=MzMoMqCGgKbcz50+gvc/58uGjIc/GmjVeBYUOW2NIFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q6y50N8KEsfoFgLFaT1Ht4IJzn4cpNwDjkH7CUKWnvGvPqe6wBaETCJuZE3W9K++J EGJLW30CryA57mGhNALNg9G1t5swf4ucsjnTXhZfYqCCtmQUpekFjxyPeYLFrtwN0O 1bsPQELhsGclMIO20aklNICv6BST3UhEGqEeNWtt1B/vMETuYDzvb9wt0bydwORK/J JBfakoMGKEKBQR37eC1i6C9jJCeReAbPzq5vPavKe5zJ+/Tk1xFkYP1hGvZYWvOTR+ pcVkMVrh9naojBQOB94DbjmXFBYflY1QNvM7L86gMJ82rQZ3MWM1l+Vy72FKCxHep9 +VWyhXTdJflZA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Bjorn Helgaas , Sasha Levin , 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 09/11] atm: iphase: Do PCI error checks on own line Date: Tue, 7 Nov 2023 10:54:17 -0500 Message-ID: <20231107155430.3768779-9-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231107155430.3768779-1-sashal@kernel.org> References: <20231107155430.3768779-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 4.19.297 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilpo Järvinen [ Upstream commit c28742447ca9879b52fbaf022ad844f0ffcd749c ] In get_esi() PCI errors are checked inside line-split "if" conditions (in addition to the file not following the coding style). To make the code in get_esi() more readable, fix the coding style and use the usual error handling pattern with a separate variable. In addition, initialization of 'error' variable at declaration is not needed. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/atm/iphase.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 827c6d5e61774..b6d8c2660e4a0 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2290,19 +2290,21 @@ static int get_esi(struct atm_dev *dev) static int reset_sar(struct atm_dev *dev) { IADEV *iadev; - int i, error = 1; + int i, error; unsigned int pci[64]; iadev = INPH_IA_DEV(dev); - for(i=0; i<64; i++) - if ((error = pci_read_config_dword(iadev->pci, - i*4, &pci[i])) != PCIBIOS_SUCCESSFUL) - return error; + for (i = 0; i < 64; i++) { + error = pci_read_config_dword(iadev->pci, i * 4, &pci[i]); + if (error != PCIBIOS_SUCCESSFUL) + return error; + } writel(0, iadev->reg+IPHASE5575_EXT_RESET); - for(i=0; i<64; i++) - if ((error = pci_write_config_dword(iadev->pci, - i*4, pci[i])) != PCIBIOS_SUCCESSFUL) - return error; + for (i = 0; i < 64; i++) { + error = pci_write_config_dword(iadev->pci, i * 4, pci[i]); + if (error != PCIBIOS_SUCCESSFUL) + return error; + } udelay(5); return 0; } -- 2.42.0