All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mspro_block: Fix an error code in mspro_block_issue_req()
Date: Fri, 10 May 2019 15:29:07 +0000	[thread overview]
Message-ID: <5CD598C3.9090003@bfs.de> (raw)
In-Reply-To: <20190510112440.GA22858@mwanda>



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;

  parent reply	other threads:[~2019-05-10 15:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 11:24 [PATCH] mspro_block: Fix an error code in mspro_block_issue_req() Dan Carpenter
2019-05-10 13:11 ` walter harms
2019-05-10 13:23 ` Dan Carpenter
2019-05-10 15:29 ` walter harms [this message]
2019-05-11  9:36 ` Dan Carpenter
2019-05-28  8:52 ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5CD598C3.9090003@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.