Skip to content

Commit 092550e

Browse files
Libing Zhoujoergroedel
authored andcommitted
iommu/amd: Remove double zero check
The free_pages() does zero check, therefore remove double zero check here. Signed-off-by: Libing Zhou <libing.zhou@nokia-sbell.com> Link: https://lore.kernel.org/r/20200722064450.GA63618@hzling02.china.nsn-net.net Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 70fcd35 commit 092550e

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

drivers/iommu/amd/init.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -720,21 +720,14 @@ static void iommu_enable_ppr_log(struct amd_iommu *iommu)
720720

721721
static void __init free_ppr_log(struct amd_iommu *iommu)
722722
{
723-
if (iommu->ppr_log == NULL)
724-
return;
725-
726723
free_pages((unsigned long)iommu->ppr_log, get_order(PPR_LOG_SIZE));
727724
}
728725

729726
static void free_ga_log(struct amd_iommu *iommu)
730727
{
731728
#ifdef CONFIG_IRQ_REMAP
732-
if (iommu->ga_log)
733-
free_pages((unsigned long)iommu->ga_log,
734-
get_order(GA_LOG_SIZE));
735-
if (iommu->ga_log_tail)
736-
free_pages((unsigned long)iommu->ga_log_tail,
737-
get_order(8));
729+
free_pages((unsigned long)iommu->ga_log, get_order(GA_LOG_SIZE));
730+
free_pages((unsigned long)iommu->ga_log_tail, get_order(8));
738731
#endif
739732
}
740733

0 commit comments

Comments
 (0)