Re: [PATCH v2 for-next 2/9] RDMA/hns: Add type check in get/set hw field

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

 



On 2020/9/18 21:49, Jason Gunthorpe wrote:
> On Wed, Sep 09, 2020 at 04:57:27PM +0800, Weihang Li wrote:
>> From: Lang Cheng <chenglang@xxxxxxxxxx>
>>
>> roce_get_field() and roce_set_field() are only used to set variables in
>> type of __le32, add checks for type to avoid inappropriate assignments.
>>
>> Signed-off-by: Lang Cheng <chenglang@xxxxxxxxxx>
>> Signed-off-by: Weihang Li <liweihang@xxxxxxxxxx>
>> ---
>>  drivers/infiniband/hw/hns/hns_roce_common.h | 14 ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> I'm skeptical this actually works. __le32 and u32 are the same thing
> unless using sparse, and sparse will already catch mis-uses as-is.
> 
> Jason
> 

Umm...You are right. I will drop this one.

Thank you
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