Re: [PATCH] mspro_block: Fix an error code in mspro_block_issue_req()

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

 




Am 10.05.2019 15:23, schrieb Dan Carpenter:
> On Fri, May 10, 2019 at 03:11:45PM +0200, walter harms wrote:
>> If i see this correcly everybody leaving the loop making the function return something.
>> I do not know how would do that but IMHO is better to be defensive and end the function
>> with a propper return code (perhaps 0).
>>
> 
> It's a forever loop.  If we add another break statement without adding
> at return then GCC will complain.
> 
> I feel like maybe you're saying that you don't like forever loops?  That
> becomes a pretty complicated position to take...
> 

No, not really,
but after several years of programming i have learned that forever() is never
forever and a break statement is easily added (in future).

Also it also looks strange to have a function returning int but the last thing
is not returning something.

just my 2 cents,

re,
 wh

ps: you could easily do
 	memstick_new_req(card->host);
  	break;
  }
return 0;




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux