diff mbox series

[04/10] mmc-utils: Add byte offset comments to rpmb_frame structure

Message ID 20250407082833.108616-5-avri.altman@sandisk.com
State New
Headers show
Series mmc-utils: Secure Write Protect Mode Enhancements | expand

Commit Message

Avri Altman April 7, 2025, 8:28 a.m. UTC
Added comments to the `rpmb_frame` structure to document the byte
offsets of each field within the 512-byte packed frame. The
specification defines the frame format in terms of byte offsets, and
these comments make it easier to align the code with the spec and
improve readability.

No functional changes were made.

Signed-off-by: Avri Altman <avri.altman@sandisk.com>
---
 mmc_cmds.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/mmc_cmds.c b/mmc_cmds.c
index d53ed9c..7e3ac7e 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -2101,15 +2101,15 @@  enum rpmb_op_type {
 };
 
 struct rpmb_frame {
-	u_int8_t  stuff[196];
-	u_int8_t  key_mac[32];
-	u_int8_t  data[256];
-	u_int8_t  nonce[16];
-	u_int32_t write_counter;
-	u_int16_t addr;
-	u_int16_t block_count;
-	u_int16_t result;
-	u_int16_t req_resp;
+	u_int8_t  stuff[196];           /* Bytes 511 - 316 */
+	u_int8_t  key_mac[32];          /* Bytes 315 - 284 */
+	u_int8_t  data[256];            /* Bytes 283 - 28 */
+	u_int8_t  nonce[16];            /* Bytes 27 - 12 */
+	u_int32_t write_counter;        /* Bytes 11 - 8 */
+	u_int16_t addr;                 /* Bytes 7 - 6 */
+	u_int16_t block_count;          /* Bytes 5 - 4 */
+	u_int16_t result;               /* Bytes 3 - 2 */
+	u_int16_t req_resp;             /* Bytes 1 - 0 */
 } __attribute__((packed));
 
 static inline void set_single_cmd(struct mmc_ioc_cmd *ioc, __u32 opcode,