aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGustavo Romero <gromero@linux.ibm.com>2020-07-20 19:16:08 -0400
committerOliver O'Halloran <oohall@gmail.com>2020-08-07 16:00:20 +1000
commit6840dd826341d9315e4d78681693441e6dd7db60 (patch)
treebf8351dc20c92646e90b3a286939dfa700325d27 /include
parentea62e75605f6d6446f03c1b9522c9dff46abe2e3 (diff)
downloadskiboot-6840dd826341d9315e4d78681693441e6dd7db60.zip
skiboot-6840dd826341d9315e4d78681693441e6dd7db60.tar.gz
skiboot-6840dd826341d9315e4d78681693441e6dd7db60.tar.bz2
Update comments for bit manipulation macros
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@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/bitutils.h6
1 files 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)))