From: "Kumar, Udit" <u-kumar1@ti.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, Avri Altman <avri.altman@wdc.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Bao D . Nguyen" <quic_nguyenb@quicinc.com>,
Eric Biggers <ebiggers@google.com>, Bean Huo <beanhuo@micron.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Can Guo <quic_cang@quicinc.com>,
Manivannan Sadhasivam <mani@kernel.org>,
Asutosh Das <quic_asutoshd@quicinc.com>,
Po-Wen Kao <powen.kao@mediatek.com>,
Yang Li <yang.lee@linux.alibaba.com>,
Arthur Simchaev <Arthur.Simchaev@wdc.com>,
Kiwoong Kim <kwmad.kim@samsung.com>, Nishanth Menon <nm@ti.com>,
<d-gole@ti.com>, <linux-next@vger.kernel.org>, <u-kumar1@ti.com>
Subject: Re: [PATCH v2 11/12] scsi: ufs: Simplify transfer request header initialization
Date: Wed, 2 Aug 2023 16:55:01 +0530 [thread overview]
Message-ID: <97281aba-a78c-7f75-fc15-af43e4df4907@ti.com> (raw)
In-Reply-To: <20230727194457.3152309-12-bvanassche@acm.org>
Hi Bart,
On 7/28/2023 1:11 AM, Bart Van Assche wrote:
> Make the code that initializes UTP transfer request headers easier to
> read by using bitfields instead of __le32 where appropriate.
>
> Cc: Bao D. Nguyen <quic_nguyenb@quicinc.com>
> Cc: Eric Biggers <ebiggers@google.com>
> Cc: Avri Altman <avri.altman@wdc.com>
> Cc: Bean Huo <beanhuo@micron.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> [...]
>
> +static void ufshcd_check_header_layout(void)
> +{
> + BUILD_BUG_ON(((u8 *)&(struct request_desc_header){
> + .cci = 3})[0] != 3);
> +
> + BUILD_BUG_ON(((u8 *)&(struct request_desc_header){
> + .ehs_length = 2})[1] != 2);
> +
> + BUILD_BUG_ON(((u8 *)&(struct request_desc_header){
> + .enable_crypto = 1})[2]
> + != 0x80);
> +
> + BUILD_BUG_ON((((u8 *)&(struct request_desc_header){
> + .command_type = 5,
> + .data_direction = 3,
> + .interrupt = 1,
> + })[3]) != ((5 << 4) | (3 << 1) | 1));
> +
> + BUILD_BUG_ON(((__le32 *)&(struct request_desc_header){
> + .dunl = cpu_to_le32(0xdeadbeef)})[1] !=
> + cpu_to_le32(0xdeadbeef));
> +
> + BUILD_BUG_ON(((u8 *)&(struct request_desc_header){
> + .ocs = 4})[8] != 4);
> +
> + BUILD_BUG_ON(((u8 *)&(struct request_desc_header){
> + .cds = 5})[9] != 5);
> +
> + BUILD_BUG_ON(((__le32 *)&(struct request_desc_header){
> + .dunu = cpu_to_le32(0xbadcafe)})[3] !=
> + cpu_to_le32(0xbadcafe));
> +}
> +
While building next-20230801 for ARM64 architecture,
this patch is giving compilation error
In function ‘ufshcd_check_header_layout’,
inlined from ‘ufshcd_core_init’ at drivers/ufs/core/ufshcd.c:10629:2:
././include/linux/compiler_types.h:397:38: error: call to
‘__compiletime_assert_554’ declared with attribute error: BUILD_BUG_ON
failed: ((u8 *)&(struct request_desc_header){ .enable_crypto = 1})[2] !=
0x80
397 | _compiletime_assert(condition, msg, __compiletime_assert_,
__COUNTER__)
compiler information
wget
https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
tar -Jxvf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
Build steps
make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- Image
> [...]
next parent reply other threads:[~2023-08-02 11:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230727194457.3152309-1-bvanassche@acm.org>
[not found] ` <20230727194457.3152309-12-bvanassche@acm.org>
2023-08-02 11:25 ` Kumar, Udit [this message]
2023-08-02 16:05 ` [PATCH v2 11/12] scsi: ufs: Simplify transfer request header initialization Bart Van Assche
2023-08-02 16:44 ` Kumar, Udit
2023-08-02 16:46 ` Bart Van Assche
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=97281aba-a78c-7f75-fc15-af43e4df4907@ti.com \
--to=u-kumar1@ti.com \
--cc=Arthur.Simchaev@wdc.com \
--cc=adrian.hunter@intel.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=d-gole@ti.com \
--cc=ebiggers@google.com \
--cc=jejb@linux.ibm.com \
--cc=kwmad.kim@samsung.com \
--cc=linux-next@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nm@ti.com \
--cc=powen.kao@mediatek.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=stanley.chu@mediatek.com \
--cc=yang.lee@linux.alibaba.com \
/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;
as well as URLs for NNTP newsgroup(s).