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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Dec 2015 16:45:29 +0800
From:	Xiubo Li <lixiubo@...s.chinamobile.com>
To:	broonie@...nel.org
Cc:	linux-kernel@...r.kernel.org,
	Xiubo Li <lixiubo@...s.chinamobile.com>
Subject: [PATCH 2/3] regcache: Introduce the index parsing API

Here introduces regcache_get_index() for regmap cache, which uses
the register stride order and bit rotation.

Signed-off-by: Xiubo Li <lixiubo@...s.chinamobile.com>
---
 drivers/base/regmap/internal.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index d43784e..60699e6 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -270,4 +270,10 @@ static inline unsigned int regmap_get_offset(const struct regmap *map,
 	return index << map->reg_stride_order;
 }
 
+static inline unsigned int regcache_get_index(const struct regmap *map,
+					    unsigned int reg)
+{
+	return reg >> map->reg_stride_order;
+}
+
 #endif
-- 
1.8.3.1



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ