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: <20651DB6AB935008+20251103030221.18672-1-luoqiu@kylinsec.com.cn>
Date: Mon,  3 Nov 2025 11:02:21 +0800
From: Luo Qiu <luoqiu@...insec.com.cn>
To: Jay Fang <f.fangjian@...wei.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jakub Kicinski <kuba@...nel.org>,
	Christian Brauner <brauner@...nel.org>,
	David Hildenbrand <david@...hat.com>,
	Jens Axboe <axboe@...nel.dk>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] logic_pio: change return type of ins() to void

The ins operation in logic_pio_host_ops should return void instead of u32,
as it performs bulk input operations to a buffer and doesn't need to
return a value. This matches the semantics of the corresponding outs
operation and fixes a type inconsistency with logic_ins{bwl}.

Signed-off-by: Luo Qiu <luoqiu@...insec.com.cn>
---
 drivers/bus/hisi_lpc.c    | 13 +++++--------
 include/linux/logic_pio.h |  4 ++--
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
index 53dd1573e323..a212fd39cf24 100644
--- a/drivers/bus/hisi_lpc.c
+++ b/drivers/bus/hisi_lpc.c
@@ -265,12 +265,9 @@ static void hisi_lpc_comm_out(void *hostdata, unsigned long pio,
  * @buffer: a buffer where read/input data bytes are stored
  * @dwidth: the data width required writing to the target I/O port
  * @count: how many data units whose length is dwidth will be read
- *
- * When success, the data read back is stored in buffer pointed by buffer.
- * Returns 0 on success, -errno otherwise.
  */
-static u32 hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
-			     size_t dwidth, unsigned int count)
+static void hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
+			      size_t dwidth, unsigned int count)
 {
 	struct hisi_lpc_dev *lpcdev = hostdata;
 	unsigned char *buf = buffer;
@@ -278,7 +275,7 @@ static u32 hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
 	unsigned long addr;
 
 	if (!lpcdev || !buf || !count || !dwidth || dwidth > LPC_MAX_DWIDTH)
-		return -EINVAL;
+		return;
 
 	iopara.opflags = 0;
 	if (dwidth > 1)
@@ -292,11 +289,11 @@ static u32 hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
 
 		ret = hisi_lpc_target_in(lpcdev, &iopara, addr, buf, dwidth);
 		if (ret)
-			return ret;
+			return;
 		buf += dwidth;
 	} while (--count);
 
-	return 0;
+	return;
 }
 
 /*
diff --git a/include/linux/logic_pio.h b/include/linux/logic_pio.h
index 8f1a9408302f..9f27d9374f71 100644
--- a/include/linux/logic_pio.h
+++ b/include/linux/logic_pio.h
@@ -31,8 +31,8 @@ struct logic_pio_host_ops {
 	u32 (*in)(void *hostdata, unsigned long addr, size_t dwidth);
 	void (*out)(void *hostdata, unsigned long addr, u32 val,
 		    size_t dwidth);
-	u32 (*ins)(void *hostdata, unsigned long addr, void *buffer,
-		   size_t dwidth, unsigned int count);
+	void (*ins)(void *hostdata, unsigned long addr, void *buffer,
+		    size_t dwidth, unsigned int count);
 	void (*outs)(void *hostdata, unsigned long addr, const void *buffer,
 		     size_t dwidth, unsigned int count);
 };
-- 
2.51.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ