Re: [PATCH for-next 5/9] RDMA/hns: Initialize variable in the right place

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

 




On 2021/11/20 1:27, Jason Gunthorpe wrote:
> On Fri, Nov 19, 2021 at 10:02:04PM +0800, Wenpeng Liang wrote:
>> From: Haoyue Xu <xuhaoyue1@xxxxxxxxxxxxx>
>>
>> The "ret" should be initialized when it is defined instead of in the loop.
> 
> Why?
> 
> It is a bit weird, but the code is fine as written
> 
> The only suggestion I'd make is
> 
>  	if (hns_roce_cmq_csq_done(hr_dev)) {
>                 ret = 0;
> 		for (i = 0; i < num; i++) {
> 
> Just because the , operator is not so typically used like that
> 
> Jason
> .
> 

Thanks for your suggestion, I will assign ret in the if branch in v2.

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