Skip to content

Commit

Permalink
iommu/amd: Remove double zero check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Libing Zhou authored and Joerg Roedel committed Jul 22, 2020
1 parent 70fcd35 commit 092550e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/iommu/amd/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,21 +720,14 @@ static void iommu_enable_ppr_log(struct amd_iommu *iommu)

static void __init free_ppr_log(struct amd_iommu *iommu)
{
if (iommu->ppr_log == NULL)
return;

free_pages((unsigned long)iommu->ppr_log, get_order(PPR_LOG_SIZE));
}

static void free_ga_log(struct amd_iommu *iommu)
{
#ifdef CONFIG_IRQ_REMAP
if (iommu->ga_log)
free_pages((unsigned long)iommu->ga_log,
get_order(GA_LOG_SIZE));
if (iommu->ga_log_tail)
free_pages((unsigned long)iommu->ga_log_tail,
get_order(8));
free_pages((unsigned long)iommu->ga_log, get_order(GA_LOG_SIZE));
free_pages((unsigned long)iommu->ga_log_tail, get_order(8));
#endif
}

Expand Down

0 comments on commit 092550e

Please sign in to comment.