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