From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58C52315B3 for ; Tue, 7 Nov 2023 15:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JXvA69Ug" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D34C433CC; Tue, 7 Nov 2023 15:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699372343; bh=69BpB42a+Uhc1LwWwPzW3d6ynRqk0g1AebpJiCPFhMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JXvA69Ug0U7mKflxjmn8KeuzziC70RtPr+DPZ5/bEgc23panv0lsOTJrdHcrZCfc1 aQT4pAMi6cH+N9rP1cc/dOE+4ivF3VCpKREahLug8DSIT2WHwM37FZkechR6EKUL6y UuF0O6a3Hu+3tGTY/op+H3+3/+8Q8+dXfbguvTlfxG8m0JL2DoT0FVzaAXJumi6kqx ZBGEZo4HRDaTJg9KKFRJZfnAD1kwTQ4qiTj72DTZbySwKQ9oao2lLS20OV2+WcgIAH lmP6edqCUR4hVMJk7CAChNHFWSiyymwEcs8jhhnxuKkPeDpblumQQ1HA8PbwryaNhU mPfokvHdHuD8g== 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 5.15 14/22] atm: iphase: Do PCI error checks on own line Date: Tue, 7 Nov 2023 10:51:23 -0500 Message-ID: <20231107155146.3767610-14-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231107155146.3767610-1-sashal@kernel.org> References: <20231107155146.3767610-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.137 Content-Transfer-Encoding: 8bit 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 bc8e8d9f176b2..ce56306eeb6ce 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2293,19 +2293,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