[Skiboot] [PATCH] Update comments for bit manipulation macros
Gustavo Romero
gromero at linux.ibm.com
Tue Jul 21 09:16:08 AEST 2020
Bit manipulation code was updated but comments related to it were not.
This commit updates the comments for the main macros, GET/SETFIELD, to
make them match the code.
Signed-off-by: Gustavo Romero <gromero at linux.ibm.com>
---
include/bitutils.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/bitutils.h b/include/bitutils.h
index f6f21c2..ac3af4d 100644
--- a/include/bitutils.h
+++ b/include/bitutils.h
@@ -30,11 +30,11 @@
/* Find left shift from first set bit in mask */
#define MASK_TO_LSH(m) (__builtin_ffsl(m) - 1)
-/* Extract field fname from val */
+/* Extract field from 'v' according to mask 'm' */
#define GETFIELD(m, v) (((v) & (m)) >> MASK_TO_LSH(m))
-/* Set field fname of oval to fval
- * NOTE: oval isn't modified, the combined result is returned
+/* Set field specified by mask 'm' of 'v' to value 'val'
+ * NOTE: 'v' isn't modified, the combined result is returned
*/
#define SETFIELD(m, v, val) \
(((v) & ~(m)) | ((((typeof(v))(val)) << MASK_TO_LSH(m)) & (m)))
--
2.7.4
More information about the Skiboot
mailing list