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: <tencent_E59F5CCD55B9EE47D4712F517941BE78A50A@qq.com>
Date: Tue, 25 Mar 2025 09:59:19 +0800
From: xiaopeitux@...mail.com
To: linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org,
	yuanzhichang@...ilicon.com,
	john.g.garry@...cle.com
Cc: Pei Xiao <xiaopei01@...inos.cn>
Subject: [PATCH] logic_pio: Add detailed comments for find_io_range() and logic_pio_trans_cpuaddr()

From: Pei Xiao <xiaopei01@...inos.cn>

As a library file, every function should have comments,so add
comments for any functions that were previously overlooked.

Signed-off-by: Pei Xiao <xiaopei01@...inos.cn>
---
 lib/logic_pio.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/logic_pio.c b/lib/logic_pio.c
index e29496a38d06..3a49f424acc0 100644
--- a/lib/logic_pio.c
+++ b/lib/logic_pio.c
@@ -138,7 +138,15 @@ struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwn
 	return found_range;
 }
 
-/* Return a registered range given an input PIO token */
+/**
+ * find_io_range - find a registered range by PIO
+ * @pio: logical PIO value
+ *
+ * Return a registered range, NULL otherwise.
+ *
+ * Traverse the io_range_list to find the registered node for @pio.
+ * The input PIO should be unique in the whole logical PIO space.
+ */
 static struct logic_pio_hwaddr *find_io_range(unsigned long pio)
 {
 	struct logic_pio_hwaddr *range, *found_range = NULL;
@@ -204,6 +212,12 @@ unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
 	return addr - range->hw_start + range->io_start;
 }
 
+/**
+ * logic_pio_trans_cpuaddr - translate CPU address to logical PIO
+ * @addr: Host-relative CPU address
+ *
+ * Returns Logical PIO value if successful, ~0UL otherwise
+ */
 unsigned long logic_pio_trans_cpuaddr(resource_size_t addr)
 {
 	struct logic_pio_hwaddr *range;
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ