lkml.org 
[lkml]   [2017]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 2/7] perf/amd/iommu: Modify functions to query max banks and counters
From
Date


On 1/10/17 21:43, Joerg Roedel wrote:
> On Mon, Jan 09, 2017 at 09:33:42PM -0600, Suthikulpanit, Suravee wrote:
>> +static struct amd_iommu *get_amd_iommu(uint idx)
>> +{
>> + uint i = 0;
>> + struct amd_iommu *iommu = NULL;
>> +
>> + for_each_iommu(iommu) {
>> + if (i == idx)
>> + break;
>> + i++;
>> + }
>> + return iommu;
>> +}
>
> Sorry for missing that in the last review, but this function returns
> just the last iommu in the list when there are less iommus than the
> requested index.
>
> Is that intentional? The following code checks for !iommu, so I guess
> not. It should look more like this then:
>
> static struct amd_iommu *get_amd_iommu(uint idx)
> {
> uint i = 0;
> struct amd_iommu *iommu, *ret = NULL;
>
> for_each_iommu(iommu)
> if (i++ == idx) {
> ret = iommu;
> break;
> }
> return ret;
> }
>
>
> Regards,
>
> Joerg

Right.... Thanks for catching this. Do you want me to send out V8 with
this fix?

Suravee

\
 
 \ /
  Last update: 2017-01-11 04:04    [W:0.109 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site