Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e31a726 authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel
Browse files

iommu/vt-d: Remove startup parameter from device_def_domain_type()



It isn't used anywhere. Remove it to make code concise.

Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 4ec066c7
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2946,7 +2946,7 @@ static bool device_is_rmrr_locked(struct device *dev)
 *  - IOMMU_DOMAIN_IDENTITY: device requires an identical mapping domain
 *  - 0: both identity and dynamic domains work for this device
 */
static int device_def_domain_type(struct device *dev, int startup)
static int device_def_domain_type(struct device *dev)
{
	if (dev_is_pci(dev)) {
		struct pci_dev *pdev = to_pci_dev(dev);
@@ -3000,16 +3000,16 @@ static int device_def_domain_type(struct device *dev, int startup)
			IOMMU_DOMAIN_IDENTITY : 0;
}

static inline int iommu_should_identity_map(struct device *dev, int startup)
static inline int iommu_should_identity_map(struct device *dev)
{
	return device_def_domain_type(dev, startup) == IOMMU_DOMAIN_IDENTITY;
	return device_def_domain_type(dev) == IOMMU_DOMAIN_IDENTITY;
}

static int __init dev_prepare_static_identity_mapping(struct device *dev, int hw)
{
	int ret;

	if (!iommu_should_identity_map(dev, 1))
	if (!iommu_should_identity_map(dev))
		return 0;

	ret = domain_add_dev_info(si_domain, dev);
@@ -4570,7 +4570,7 @@ static int device_notifier(struct notifier_block *nb,

		dmar_remove_one_dev_info(dev);
	} else if (action == BUS_NOTIFY_ADD_DEVICE) {
		if (iommu_should_identity_map(dev, 1))
		if (iommu_should_identity_map(dev))
			domain_add_dev_info(si_domain, dev);
	}

@@ -5528,7 +5528,7 @@ static int intel_iommu_add_device(struct device *dev)
	domain = iommu_get_domain_for_dev(dev);
	dmar_domain = to_dmar_domain(domain);
	if (domain->type == IOMMU_DOMAIN_DMA) {
		if (device_def_domain_type(dev, 1) == IOMMU_DOMAIN_IDENTITY) {
		if (device_def_domain_type(dev) == IOMMU_DOMAIN_IDENTITY) {
			ret = iommu_request_dm_for_dev(dev);
			if (ret) {
				dmar_domain->flags |= DOMAIN_FLAG_LOSE_CHILDREN;
@@ -5541,7 +5541,7 @@ static int intel_iommu_add_device(struct device *dev)
			return -ENODEV;
		}
	} else {
		if (device_def_domain_type(dev, 1) == IOMMU_DOMAIN_DMA) {
		if (device_def_domain_type(dev) == IOMMU_DOMAIN_DMA) {
			ret = iommu_request_dma_domain_for_dev(dev);
			if (ret) {
				dmar_domain->flags |= DOMAIN_FLAG_LOSE_CHILDREN;