Re: [PATCH rdma-core 5/7] libhns: Fix wrong type of variables and fields

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

 




On 2021/11/23 22:13, Jason Gunthorpe wrote:
> On Tue, Nov 09, 2021 at 08:41:01PM +0800, Wenpeng Liang wrote:
>> From: Xinhao Liu <liuxinhao5@xxxxxxxxxxxxx>
>>
>> Some variables and fields should be in type of unsigned instead of signed.
>>
>> Signed-off-by: Xinhao Liu <liuxinhao5@xxxxxxxxxxxxx>
>> Signed-off-by: Wenpeng Liang <liangwenpeng@xxxxxxxxxx>
>>  providers/hns/hns_roce_u.h       |  6 +++---
>>  providers/hns/hns_roce_u_hw_v1.c |  6 +++---
>>  providers/hns/hns_roce_u_hw_v2.c | 11 +++++------
>>  3 files changed, 11 insertions(+), 12 deletions(-)
>>
>> diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h
>> index 0d7abd81..d5963941 100644
>> +++ b/providers/hns/hns_roce_u.h
>> @@ -99,7 +99,7 @@
>>  #define roce_set_bit(origin, shift, val) \
>>  	roce_set_field((origin), (1ul << (shift)), (shift), (val))
>>  
>> -#define hr_ilog32(n)		ilog32((n) - 1)
>> +#define hr_ilog32(n)		ilog32((unsigned int)(n) - 1)
> 
> This should be a static inline function not a macro, then it can have
> the correct type.
> 
> Also please send this series as a PR on the github
> 
> Thanks,
> Jason
> .
> 

I submitted a PR on the github:

https://github.com/linux-rdma/rdma-core/pull/1090

Thanks
Wenpeng



[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