Am 28.06.2016 um 22:09 schrieb Alex Williamson:
> On Tue, 28 Jun 2016 20:40:37 +0200
> Heiner Kallweit <[email protected]> wrote:
> 
>> The init function ensures that iommu_group_kset can't be NULL.
>> Therefore this check isn't needed.
> 
> Have you seen your previous patch?  Wasn't this claim that the init
> function ensures iommu_group_kset more true when iommu_init() called
> BUG_ON(!iommu_group_kset) than it is when we can get by with just
> returning -ENOMEM?  Thanks,
> 
Uh, you're right. I was in "module mode" where initcall retvals are
assessed. Here the initcall retval is ignored.
If we leave the BUG_ON in however then the check is actually unneeded
as the system is halted after the BUG_ON.

By the way:
This check is in iommu_group_get_by_id() and this function doesn't seem
to have any user in the kernel. It was added about three years ago.
Is the original intention of this function obsolete meanwhile?

Thanks, Heiner

> Alex
> 
>> Signed-off-by: Heiner Kallweit <[email protected]>
>> ---
>>  drivers/iommu/iommu.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index b36ec9c..b36e24d 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -235,9 +235,6 @@ struct iommu_group *iommu_group_get_by_id(int id)
>>      struct iommu_group *group;
>>      const char *name;
>>  
>> -    if (!iommu_group_kset)
>> -            return NULL;
>> -
>>      name = kasprintf(GFP_KERNEL, "%d", id);
>>      if (!name)
>>              return NULL;
> 
> 

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to