From: Bart Van Assche <bvanassche@acm.org>
To: Bean Huo <beanhuo@iokpp.de>,
avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, can.guo@oss.qualcomm.com,
ulf.hansson@linaro.org, jens.wiklander@linaro.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
mikebi@micron.com, lporzio@micron.com,
Bean Huo <beanhuo@micron.com>
Subject: Re: [RFC PATCH v1 1/2] rpmb: move rpmb_frame struct and constants to common header
Date: Mon, 15 Sep 2025 14:54:21 -0700 [thread overview]
Message-ID: <eef5d4c5-c2b4-47e4-bd29-3cd6faa39dc9@acm.org> (raw)
In-Reply-To: <20250915214614.179313-2-beanhuo@iokpp.de>
On 9/15/25 2:46 PM, Bean Huo wrote:
> + * @stuff : stuff bytes
The above sounds vague to me ...
> +struct rpmb_frame {
> + u8 stuff[196];
> + u8 key_mac[32];
> + u8 data[256];
> + u8 nonce[16];
> + __be32 write_counter;
> + __be16 addr;
> + __be16 block_count;
> + __be16 result;
> + __be16 req_resp;
> +} __packed;
Applying __packed to a data structure in its entirety is a bad practice
because it prevents the compiler from generating optimal code for
accessing multi-byte members on architectures that do not support
unaligned accesses. Please only apply __packed to the members that need
it and consider checking the size of the data structure with
static_assert().
Thanks,
Bart.
next prev parent reply other threads:[~2025-09-15 21:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 21:46 [RFC PATCH v1 0/2] Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-09-15 21:46 ` [RFC PATCH v1 1/2] rpmb: move rpmb_frame struct and constants to common header Bean Huo
2025-09-15 21:54 ` Bart Van Assche [this message]
2025-09-15 21:46 ` [RFC PATCH v1 2/2] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-09-15 22:06 ` Bart Van Assche
2025-09-16 13:27 ` Bean Huo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eef5d4c5-c2b4-47e4-bd29-3cd6faa39dc9@acm.org \
--to=bvanassche@acm.org \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@iokpp.de \
--cc=beanhuo@micron.com \
--cc=can.guo@oss.qualcomm.com \
--cc=jejb@linux.ibm.com \
--cc=jens.wiklander@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lporzio@micron.com \
--cc=martin.petersen@oracle.com \
--cc=mikebi@micron.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox