lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] iommu/tegra-smmu: Expend mutex protection range
On Tue, Sep 29, 2020 at 03:17:58AM +0300, Dmitry Osipenko wrote:
> ...
> > static bool tegra_smmu_capable(enum iommu_cap cap)
> > @@ -420,17 +413,21 @@ static int tegra_smmu_as_prepare(struct tegra_smmu *smmu,
> > struct tegra_smmu_as *as)
> > {
> > u32 value;
> > - int err;
> > + int err = 0;
> > +
> > + mutex_lock(&smmu->lock);
> >
> > if (as->use_count > 0) {
> > as->use_count++;
> > - return 0;
> > + goto err_unlock;
>
> This looks a bit odd because it's not a error condition. Perhaps should
> be better to "goto bump_usecount"?
>
> Or make it similar to tegra_smmu_as_unprepare()?

Hmm...I think it's simple to just make it "goto unlock" then.

\
 
 \ /
  Last update: 2020-09-29 03:21    [W:0.033 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site