Re: [PATCH for-next 2/9] RDMA/hns: Add CQ flag instead of independent enable flag

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

 



On 2020/5/26 1:06, Jason Gunthorpe wrote:
> On Wed, May 20, 2020 at 09:53:12PM +0800, Weihang Li wrote:
>> +	roce_set_bit(cq_context->byte_44_db_record,
>> +		     V2_CQC_BYTE_44_DB_RECORD_EN_S,
>> +		     (hr_cq->flags & HNS_ROCE_CQ_FLAG_RECORD_DB) ? 1 : 0);
> 
> It seems like the if expression should be inside the roce_set_bit
> macro (just cast to bool) as something called 'bit' should have that
> safety built in.
> 

Hi Jason

Thanks for your comments, will prepare a patch to modify it.


> Also, if someone wants a project, all this endless stuff should be
> using genmask and field_prep instead of this home grown stuff.
> 
> Jason
> 

I took a look at this macro, FILED_PREP() can indeed simplify lots of
similar codes in the hns driver. I will take a try and maybe prepare a
patch/series to use it in v5.9.

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