Skip to contentSkip to conversation

bswap: Fix accessors syntax in comment

PATCH Applied Greg Kurz 4 participants 4 messages Feb 26, 2019 – Mar 6, 2019

lore
Share & tools
lore

Greg Kurz

author
#0 lore raw

PATCH 1/1 bswap: Fix accessors syntax in comment

All accessors that have an endian infix DO have an underscore between {size} and {endian}.

---
 include/qemu/bswap.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/qemu/bswap.h +4 -4
index a684c1a7a298..5a70f78c0ba4 100644
@@ -255,9 +255,9 @@ typedef union {
 /*
  * the generic syntax is:
  *
- * load: ld{type}{sign}{size}{endian}_p(ptr)
+ * load: ld{type}{sign}{size}_{endian}_p(ptr)
  *
- * store: st{type}{size}{endian}_p(ptr, val)
+ * store: st{type}{size}_{endian}_p(ptr, val)
  *
  * Note there are small differences with the softmmu access API!
  *
@@ -293,10 +293,10 @@ typedef union {
  *
  * For cases where the size to be used is not fixed at compile time,
  * there are
- *  stn{endian}_p(ptr, sz, val)
+ *  stn_{endian}_p(ptr, sz, val)
  * which stores @val to @ptr as an @endian-order number @sz bytes in size
  * and
- *  ldn{endian}_p(ptr, sz)
+ *  ldn_{endian}_p(ptr, sz)
  * which loads @sz bytes from @ptr as an unsigned @endian-order number
  * and returns it in a uint64_t.
  */
Reviewed-by on v1 1/1
#2 lore raw
In reply to Greg Kurz
Quoted 4 lines · Greg Kurz

All accessors that have an endian infix DO have an underscore between {size} and {endian}.

Quoted 35 lines
---
 include/qemu/bswap.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/qemu/bswap.h +4 -4
index a684c1a7a298..5a70f78c0ba4 100644
@@ -255,9 +255,9 @@ typedef union {
 /*
  * the generic syntax is:
  *
- * load: ld{type}{sign}{size}{endian}_p(ptr)
+ * load: ld{type}{sign}{size}_{endian}_p(ptr)
  *
- * store: st{type}{size}{endian}_p(ptr, val)
+ * store: st{type}{size}_{endian}_p(ptr, val)
  *
  * Note there are small differences with the softmmu access API!
  *
@@ -293,10 +293,10 @@ typedef union {
  *
  * For cases where the size to be used is not fixed at compile time,
  * there are
- *  stn{endian}_p(ptr, sz, val)
+ *  stn_{endian}_p(ptr, sz, val)
  * which stores @val to @ptr as an @endian-order number @sz bytes in size
  * and
- *  ldn{endian}_p(ptr, sz)
+ *  ldn_{endian}_p(ptr, sz)
  * which loads @sz bytes from @ptr as an unsigned @endian-order number
  * and returns it in a uint64_t.
  */
#3 lore raw
In reply to Greg Kurz
Quoted 29 lines · Greg Kurz

All accessors that have an endian infix DO have an underscore between {size} and {endian}.

---
 include/qemu/bswap.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/qemu/bswap.h +2 -2
index a684c1a7a298..5a70f78c0ba4 100644
@@ -255,9 +255,9 @@ typedef union {
 /*
  * the generic syntax is:
  *
- * load: ld{type}{sign}{size}{endian}_p(ptr)
+ * load: ld{type}{sign}{size}_{endian}_p(ptr)
  *
- * store: st{type}{size}{endian}_p(ptr, val)
+ * store: st{type}{size}_{endian}_p(ptr, val)
  *
  * Note there are small differences with the softmmu access API!
  *
@@ -293,10 +293,10 @@ typedef union {
  *
  * For cases where the size to be used is not fixed at compile time,

include/qemu/bswap.h typedef union { · line 302

Quoted 10 lines
include/qemu/bswap.h +2 -2
  * there are
- *  stn{endian}_p(ptr, sz, val)
+ *  stn_{endian}_p(ptr, sz, val)
  * which stores @val to @ptr as an @endian-order number @sz bytes in size
  * and
- *  ldn{endian}_p(ptr, sz)
+ *  ldn_{endian}_p(ptr, sz)
  * which loads @sz bytes from @ptr as an unsigned @endian-order number
  * and returns it in a uint64_t.
  */

Applied to my trivial-patches branch.

Thanks,
Laurent