X86 platform drivers
 help / color / mirror / Atom feed
From: Vadim Pasternak <vadimp@nvidia.com>
To: <hdegoede@redhat.com>, <ilpo.jarvinen@linux.intel.com>
Cc: <michaelsh@nvidia.com>, <crajank@nvidia.com>,
	<fradensky@nvidia.com>, <oleksandrs@nvidia.com>,
	<platform-driver-x86@vger.kernel.org>,
	"Vadim Pasternak" <vadimp@nvidia.com>
Subject: [PATCH v6 6/9] platform: mellanox: Cosmetic changes to improve code style
Date: Tue, 11 Feb 2025 11:19:09 +0200	[thread overview]
Message-ID: <20250211091912.36787-7-vadimp@nvidia.com> (raw)
In-Reply-To: <20250211091912.36787-1-vadimp@nvidia.com>

Replace in 'for' loop - /i >= 0 ; i--/i >= 0 ;i--/.
Replace in 'while' loop - /(--i >= 0)/(i--)/.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
v5->v6
Comments pointed out by Ilpo:
- Fix 'while' loop in erro flow.
---
 drivers/platform/mellanox/mlx-platform.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c
index dc1dd704f8a9..bb50db717baf 100644
--- a/drivers/platform/mellanox/mlx-platform.c
+++ b/drivers/platform/mellanox/mlx-platform.c
@@ -7849,7 +7849,7 @@ static int mlxplat_platdevs_init(struct mlxplat_priv *priv)
 	while (i--)
 		platform_device_unregister(priv->pdev_dpu[i]);
 fail_platform_wd_register:
-	while (--i >= 0)
+	while (i--)
 		platform_device_unregister(priv->pdev_wd[i]);
 fail_platform_fan_register:
 	if (mlxplat_regs_io)
@@ -7870,7 +7870,7 @@ static void mlxplat_platdevs_exit(struct mlxplat_priv *priv)
 
 	for (i = MLXPLAT_CPLD_DPU_MAX_DEVS - 1; i >= 0; i--)
 		platform_device_unregister(priv->pdev_dpu[i]);
-	for (i = MLXPLAT_CPLD_WD_MAX_DEVS - 1; i >= 0 ; i--)
+	for (i = MLXPLAT_CPLD_WD_MAX_DEVS - 1; i >= 0; i--)
 		platform_device_unregister(priv->pdev_wd[i]);
 	if (priv->pdev_fan)
 		platform_device_unregister(priv->pdev_fan);
@@ -7915,7 +7915,7 @@ static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv)
 	return mlxplat_i2c_mux_complition_notify(priv, NULL, NULL);
 
 fail_platform_mux_register:
-	while (--i >= 0)
+	while (i--)
 		platform_device_unregister(priv->pdev_mux[i]);
 	return err;
 }
@@ -7924,7 +7924,7 @@ static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv)
 {
 	int i;
 
-	for (i = mlxplat_mux_num - 1; i >= 0 ; i--) {
+	for (i = mlxplat_mux_num - 1; i >= 0; i--) {
 		if (priv->pdev_mux[i])
 			platform_device_unregister(priv->pdev_mux[i]);
 	}
-- 
2.44.0


  parent reply	other threads:[~2025-02-11  9:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11  9:19 [PATCH v6 0/9] Add support for new systems, amendments Vadim Pasternak
2025-02-11  9:19 ` [PATCH v6 1/9] platform_data/mlxreg: Add capability mask fields Vadim Pasternak
2025-02-11 14:49   ` Ilpo Järvinen
2025-02-11  9:19 ` [PATCH v6 2/9] platform/mellanox mlxreg-hotplug: Add support for new flavor of capability registers Vadim Pasternak
2025-03-04 13:25   ` Ilpo Järvinen
2025-03-17 16:16     ` Vadim Pasternak
2025-02-11  9:19 ` [PATCH v6 3/9] platform/mellanox: Rename field to improve code readability Vadim Pasternak
2025-02-11  9:19 ` [PATCH v6 4/9] platform/mellanox: mlxreg-dpu: Add initial support for Nvidia DPU Vadim Pasternak
2025-02-11  9:19 ` [PATCH v6 5/9] platform: mellanox: Introduce support of Nvidia smart switch Vadim Pasternak
2025-02-11 14:52   ` Ilpo Järvinen
2025-02-11  9:19 ` Vadim Pasternak [this message]
2025-02-11  9:19 ` [PATCH v6 7/9] platform: mellanox: mlx-platform: Add support for new Nvidia system Vadim Pasternak
2025-02-11  9:19 ` [PATCH v6 8/9] platform: mellanox: nvsw-sn2200: Add support for new system flavour Vadim Pasternak
2025-02-11  9:19 ` [PATCH v6 9/9] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Vadim Pasternak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250211091912.36787-7-vadimp@nvidia.com \
    --to=vadimp@nvidia.com \
    --cc=crajank@nvidia.com \
    --cc=fradensky@nvidia.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=michaelsh@nvidia.com \
    --cc=oleksandrs@nvidia.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox