Re: [PATCH for-next] RDMA/core: Assign the name of device when allocating ib_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020/4/27 16:45, Gal Pressman wrote:
> On 26/04/2020 12:31, Weihang Li wrote:
>> If the name of a device is assigned during ib_register_device(), some
>> drivers have to use dev_*() for printing before register device. Bring
>> assign_name() into ib_alloc_device(), so that drivers can use ibdev_*()
>> anywhere.
>>
>> Signed-off-by: Weihang Li <liweihang@xxxxxxxxxx>
> 
> Reviewed-by: Gal Pressman <galpress@xxxxxxxxxx>
> 
> [...]
> 
>> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> index 2a8c389..5560d79 100644
>> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> @@ -6017,7 +6017,7 @@ static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle)
>>  	struct hns_roce_dev *hr_dev;
>>  	int ret;
>>  
>> -	hr_dev = ib_alloc_device(hns_roce_dev, ib_dev);
>> +	hr_dev = ib_alloc_device(hns_roce_dev, ib_dev, "hns%d");
> 
> This name is missing an underscore.
> As some of the drivers now pass the name in two call sites, it's better to
> define it in one place in order to prevent mistakes like these.
> 

Hi Gal,

Thanks for your reminder :) Will fix it and consider using a macro instead.

Weihang



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux