Skip to content

Commit b31064f

Browse files
TinaZhangZWjoergroedel
authored andcommitted
iommu/vt-d: Make size of operands same in bitwise operations
This addresses the following issue reported by klocwork tool: - operands of different size in bitwise operations Suggested-by: Yongwei Ma <yongwei.ma@intel.com> Signed-off-by: Tina Zhang <tina.zhang@intel.com> Link: https://lore.kernel.org/r/20230406065944.2773296-2-tina.zhang@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 113a031 commit b31064f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/iommu/intel/dmar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ static void __dmar_enable_qi(struct intel_iommu *iommu)
16891689
* is present.
16901690
*/
16911691
if (ecap_smts(iommu->ecap))
1692-
val |= (1 << 11) | 1;
1692+
val |= BIT_ULL(11) | BIT_ULL(0);
16931693

16941694
raw_spin_lock_irqsave(&iommu->register_lock, flags);
16951695

drivers/iommu/intel/iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ context_set_sm_rid2pasid(struct context_entry *context, unsigned long pasid)
18701870
*/
18711871
static inline void context_set_sm_dte(struct context_entry *context)
18721872
{
1873-
context->lo |= (1 << 2);
1873+
context->lo |= BIT_ULL(2);
18741874
}
18751875

18761876
/*
@@ -1879,7 +1879,7 @@ static inline void context_set_sm_dte(struct context_entry *context)
18791879
*/
18801880
static inline void context_set_sm_pre(struct context_entry *context)
18811881
{
1882-
context->lo |= (1 << 4);
1882+
context->lo |= BIT_ULL(4);
18831883
}
18841884

18851885
/* Convert value to context PASID directory size field coding. */

0 commit comments

Comments
 (0)