[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210109090921.GA93456@infradead.org>
Date: Sat, 9 Jan 2021 09:09:21 +0000
From: Christoph Hellwig <hch@...radead.org>
To: Lu Baolu <baolu.lu@...ux.intel.com>
Cc: John Garry <john.garry@...wei.com>, joro@...tes.org,
will@...nel.org, iommu@...ts.linux-foundation.org,
robin.murphy@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/6] iommu: Delete iommu_dev_has_feature()
On Thu, Jan 07, 2021 at 09:18:06AM +0800, Lu Baolu wrote:
> The typical use case is
>
> if (iommu_dev_has_feature(dev, IOMMU_DEV_FEAT_AUX)) {
> rc = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_AUX);
> if (rc < 0) {
> dev_warn(dev, "Failed to enable aux-domain: %d\n",
> rc);
> return rc;
> }
> }
>
> So please don't remove it.
This doesn't have an upstream user, and did not have for years! If
new users show up they can add it back. Note that the above API with
a separate has vs enable is horrible anyway - the right way is to just
enable and fail it with a specific error code if not supported.
We have a general rule that APIs should only be introduced with their
users, and this example just confirms the reasons of why that rule is in
place once again.
Powered by blists - more mailing lists