From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: kernel test robot <lkp@intel.com>,
<oe-kbuild-all@lists.linux.dev>,
"Eric Auger" <eric.auger@redhat.com>
Subject: Re: [jgunthorpe:smmuv3_nesting 11/17] drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c:141:21: sparse: sparse: incorrect type in assignment (different base types)
Date: Mon, 21 Oct 2024 14:02:39 -0700 [thread overview]
Message-ID: <ZxbBb6QrSI9ZPpzG@Asurada-Nvidia> (raw)
In-Reply-To: <20241021124125.GA3576661@ziepe.ca>
On Mon, Oct 21, 2024 at 09:41:25AM -0300, Jason Gunthorpe wrote:
> > arm_vsmmu_convert_user_cmd(struct arm_vsmmu *vsmmu,
> > - struct iommu_viommu_arm_smmuv3_invalidate *cmd)
> > + struct vsmmu_invalidation_cmd *cmd)
> > {
> > cmd->cmd[0] = le64_to_cpu(cmd->cmd[0]);
> > cmd->cmd[1] = le64_to_cpu(cmd->cmd[1]);
>
> That's going to make spare complain here though :\
>
> You need a union to quiet it.. Or probably just a __force and a
> comment is fine
Oh, right... I did __force, and confirmed with sparse:
- cmd->cmd[0] = le64_to_cpu(cmd->cmd[0]);
- cmd->cmd[1] = le64_to_cpu(cmd->cmd[1]);
+ /* Commands are le64 stored in u64 */
+ cmd->cmd[0] = le64_to_cpu((__force __le64)cmd->cmd[0]);
+ cmd->cmd[1] = le64_to_cpu((__force __le64)cmd->cmd[1]);
Thanks
Nicolin
prev parent reply other threads:[~2024-10-21 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 20:34 [jgunthorpe:smmuv3_nesting 11/17] drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c:141:21: sparse: sparse: incorrect type in assignment (different base types) kernel test robot
2024-10-19 22:05 ` Nicolin Chen
2024-10-21 12:41 ` Jason Gunthorpe
2024-10-21 21:02 ` Nicolin Chen [this message]
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=ZxbBb6QrSI9ZPpzG@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=eric.auger@redhat.com \
--cc=jgg@ziepe.ca \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.