[lkml]   [2021]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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.

 \ /
  Last update: 2021-01-09 10:12    [W:0.057 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site