From nobody Wed Dec 17 05:28:24 2025 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 3E9FFC83F1F for ; Sun, 27 Aug 2023 13:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbjH0NiE (ORCPT ); Sun, 27 Aug 2023 09:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbjH0Nhm (ORCPT ); Sun, 27 Aug 2023 09:37:42 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EFF418D; Sun, 27 Aug 2023 06:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693143458; x=1724679458; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RKVN1bWO+6tJ6WlmxsOXbk1vq7oGMYXcJ+RHQjqKcpI=; b=M1j/VzE2owymIttDRH7CpB18nft2F8ryiP2IJkji3PYzExMRcjAvTxmU dQW8Kndd32OrQ5FOc9dmb8bkE11X1Ma48TOREPh0v28/QEC3B/319yS3C ZagnVz7I/qRhOOC0hLGwXR3CuFFZA32iBRQ1CAqKh3pzk41LV1yyT9hIu yi2IBpHjY1jGQN2ca/QzlaZ38CnYARDRCTemws8nSIks6S2q46T4nTMTn M4tRu8FcYmgFyuCVam0+TLloG323ghzpUscNn8iSceE9j5xTYtgDTfca7 08+D+3zJlqzoCr+ow7b+9UKhF/VIY0u5U6fDh4lRhufZQTyiMrlcb1YB+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="354471018" X-IronPort-AV: E=Sophos;i="6.02,205,1688454000"; d="scan'208";a="354471018" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2023 06:37:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="1068752164" X-IronPort-AV: E=Sophos;i="6.02,205,1688454000"; d="scan'208";a="1068752164" Received: from dplotkin-mobl.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.249.41.231]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2023 06:37:34 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Andi Shyti , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v2 4/8] atm: iphase: Do PCI error checks on own line Date: Sun, 27 Aug 2023 16:37:01 +0300 Message-Id: <20230827133705.12991-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230827133705.12991-1-ilpo.jarvinen@linux.intel.com> References: <20230827133705.12991-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 function changes intended. Signed-off-by: Ilpo J=C3=A4rvinen --- 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 324148686953..9bba8f280a4d 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2291,19 +2291,21 @@ static int get_esi(struct atm_dev *dev) static int reset_sar(struct atm_dev *dev) =20 { =20 IADEV *iadev; =20 - int i, error =3D 1; =20 + int i, error; unsigned int pci[64]; =20 =20 iadev =3D INPH_IA_DEV(dev); =20 - for(i=3D0; i<64; i++) =20 - if ((error =3D pci_read_config_dword(iadev->pci, =20 - i*4, &pci[i])) !=3D PCIBIOS_SUCCESSFUL) =20 - return error; =20 + for (i =3D 0; i < 64; i++) { + error =3D pci_read_config_dword(iadev->pci, i * 4, &pci[i]); + if (error !=3D PCIBIOS_SUCCESSFUL) + return error; + } writel(0, iadev->reg+IPHASE5575_EXT_RESET); =20 - for(i=3D0; i<64; i++) =20 - if ((error =3D pci_write_config_dword(iadev->pci, =20 - i*4, pci[i])) !=3D PCIBIOS_SUCCESSFUL) =20 - return error; =20 + for (i =3D 0; i < 64; i++) { + error =3D pci_write_config_dword(iadev->pci, i * 4, pci[i]); + if (error !=3D PCIBIOS_SUCCESSFUL) + return error; + } udelay(5); =20 return 0; =20 } =20 --=20 2.30.2