nvme: fix sparse warning on effects masking
authorKeith Busch <kbusch@kernel.org>
Fri, 24 Feb 2023 15:34:24 +0000 (07:34 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 27 Feb 2023 13:56:04 +0000 (06:56 -0700)
The log entries are stored in le32, so use appropriate byte swapping
macros.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202302242222.PevBhzvC-lkp@intel.com/
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c

index 25968b25d0ba56afa1f87320f36851dba5741d62..384138f8f04ce496c2265ba7453c8e4be6622014 100644 (file)
@@ -3104,7 +3104,7 @@ static void nvme_init_known_nvm_effects(struct nvme_ctrl *ctrl)
         * Rather than blindly freezing the IO queues for this effect that
         * doesn't even apply to IO, mask it off.
         */
-       log->acs[nvme_admin_security_recv] &= ~NVME_CMD_EFFECTS_CSE_MASK;
+       log->acs[nvme_admin_security_recv] &= cpu_to_le32(~NVME_CMD_EFFECTS_CSE_MASK);
 
        log->iocs[nvme_cmd_write] |= cpu_to_le32(NVME_CMD_EFFECTS_LBCC);
        log->iocs[nvme_cmd_write_zeroes] |= cpu_to_le32(NVME_CMD_EFFECTS_LBCC);