Skip to content

Commit 37c8041

Browse files
Longpeng(Mike)joergroedel
authored andcommitted
iommu/vt-d: Convert the return type of first_pte_in_page to bool
The first_pte_in_page() returns true or false, so let's convert its return type to bool. In addition, use 'IS_ALIGNED' to make the code more readable and neater. Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com> Link: https://lore.kernel.org/r/20211008000433.1115-1-longpeng2@huawei.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20211014053839.727419-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 00ecd54 commit 37c8041

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/intel-iommu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,9 @@ static inline bool dma_pte_superpage(struct dma_pte *pte)
705705
return (pte->val & DMA_PTE_LARGE_PAGE);
706706
}
707707

708-
static inline int first_pte_in_page(struct dma_pte *pte)
708+
static inline bool first_pte_in_page(struct dma_pte *pte)
709709
{
710-
return !((unsigned long)pte & ~VTD_PAGE_MASK);
710+
return IS_ALIGNED((unsigned long)pte, VTD_PAGE_SIZE);
711711
}
712712

713713
extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);

0 commit comments

Comments
 (0)