lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250722100904.735395-1-darshan.rathod@siqol.com>
Date: Tue, 22 Jul 2025 15:39:04 +0530
From: Darshan Rathod <darshan.rathod@...ol.com>
To: linusw@...nel.org
Cc: kaloz@...nwrt.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Darshan Rathod <darshan.rathod@...ol.com>,
	Manish Narani <manish.narani@...ol.com>
Subject: [PATCH] soc: ixp4xx: checkpatch fixes done in ixp4xx driver

This patch performs several code cleanups in the ixp4xx-npe driver to improve readability and better align with the kernel's coding style standards

The main changes include:
- Refactoring 'if' statements to separate assignments from the conditional check. This improves clarity and avoids potential confusion with the equality operator.
- Adjusting whitespace by adding spaces after the 'switch' keyword and within type casts.
- Removing unnecessary braces from a single-statement 'if' block.

No functional changes are introduced by this patch.

Reviewed-by: Manish Narani <manish.narani@...ol.com>

Signed-off-by: Darshan Rathod <darshan.rathod@...ol.com>
---
 drivers/soc/ixp4xx/ixp4xx-npe.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c
index 33e2e0366f19..d2494310ffd9 100644
--- a/drivers/soc/ixp4xx/ixp4xx-npe.c
+++ b/drivers/soc/ixp4xx/ixp4xx-npe.c
@@ -466,7 +466,7 @@ int npe_recv_message(struct npe *npe, void *msg, const char *what)
 		}
 	}
 
-	switch(cnt) {
+	switch (cnt) {
 	case 1:
 		debug_msg(npe, "Received [%08X]\n", recv[0]);
 		break;
@@ -491,9 +491,12 @@ int npe_send_recv_message(struct npe *npe, void *msg, const char *what)
 	int result;
 	u32 *send = msg, recv[2];
 
-	if ((result = npe_send_message(npe, msg, what)) != 0)
+	result = npe_send_message(npe, msg, what);
+	if (result != 0)
 		return result;
-	if ((result = npe_recv_message(npe, recv, what)) != 0)
+
+	result = npe_recv_message(npe, recv, what);
+	if (result != 0)
 		return result;
 
 	if ((recv[0] != send[0]) || (recv[1] != send[1])) {
@@ -533,7 +536,8 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev)
 	int i, j, err, data_size, instr_size, blocks, table_end;
 	u32 cmd;
 
-	if ((err = request_firmware(&fw_entry, name, dev)) != 0)
+	err = request_firmware(&fw_entry, name, dev);
+	if (err != 0)
 		return err;
 
 	err = -EINVAL;
@@ -541,7 +545,7 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev)
 		print_npe(KERN_ERR, npe, "incomplete firmware file\n");
 		goto err;
 	}
-	image = (struct dl_image*)fw_entry->data;
+	image = (struct dl_image *)fw_entry->data;
 
 #if DEBUG_FW
 	print_npe(KERN_DEBUG, npe, "firmware: %08X %08X %08X (0x%X bytes)\n",
@@ -624,7 +628,7 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev)
 			goto err;
 		}
 
-		cb = (struct dl_codeblock*)&image->data[blk->offset];
+		cb = (struct dl_codeblock *)&image->data[blk->offset];
 		if (blk->type == FW_BLOCK_TYPE_INSTR) {
 			if (cb->npe_addr + cb->size > instr_size)
 				goto too_big;
@@ -741,15 +745,14 @@ static void ixp4xx_npe_remove(struct platform_device *pdev)
 	int i;
 
 	for (i = 0; i < NPE_COUNT; i++)
-		if (npe_tab[i].regs) {
+		if (npe_tab[i].regs)
 			npe_reset(&npe_tab[i]);
-		}
 }
 
 static const struct of_device_id ixp4xx_npe_of_match[] = {
 	{
 		.compatible = "intel,ixp4xx-network-processing-engine",
-        },
+	},
 	{},
 };
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ