All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: Andy Walls <awalls@radix.net>
Cc: mchehab@redhat.com, linux-input@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 4/4] Add RC6 support to ir-core
Date: Sun, 11 Apr 2010 00:23:19 +0200	[thread overview]
Message-ID: <20100410222319.GA10473@hardeman.nu> (raw)
In-Reply-To: <1270861928.3038.153.camel@palomino.walls.org>

On Fri, Apr 09, 2010 at 09:12:08PM -0400, Andy Walls wrote:
> On Fri, 2010-04-09 at 01:04 +0200, David Härdeman wrote:
> > +again:
> > +	IR_dprintk(2, "RC6 decode started at state %i (%i units, %ius)\n",
> > +		   data->state, u, TO_US(duration));
> > +
> > +	if (DURATION(u) == 0 && data->state != STATE_FINISHED)
> > +		return 0;
> 
> Isn't there a better way to structure the logic to break up two adjacent
> pulse units than with goto's out of the switch back up to here?
> 
> A do {} while() loop would have been much clearer.

I just tried it, and I'm not convinced. The main problem is that you'll 
end up with:

do {
	switch(b) {
	case c:
		if (x)
			break;
		else if (y)
			continue;
while(a);

Where the break statement will affect the switch() and the continue 
statement will affect the do-while() loop which is kinda confusing.

Especially if you're so far down in the function body that the 
do-while() and switch() statements aren't visible any more.


-- 
David Härdeman

      parent reply	other threads:[~2010-04-10 22:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 23:04 [PATCH 0/4] ir-core: one-line bugfix, add RC5x, NECx, RC6 David Härdeman
2010-04-08 23:04 ` [PATCH 1/4] Fix the drivers/media/dvb/ttpci/budget-ci.c conversion to ir-core David Härdeman
2010-04-08 23:04   ` David Härdeman
2010-04-08 23:11   ` Mauro Carvalho Chehab
2010-04-08 23:11     ` Mauro Carvalho Chehab
2010-04-08 23:04 ` [PATCH 2/4] Add RC5x support " David Härdeman
2010-04-08 23:04   ` David Härdeman
2010-04-08 23:04 ` [PATCH 3/4] Add NECx " David Härdeman
2010-04-08 23:04 ` [PATCH 4/4] Add RC6 " David Härdeman
2010-04-09  8:17   ` Andreas Oberritter
2010-04-09  8:17     ` Andreas Oberritter
2010-04-09  8:31     ` David Härdeman
2010-04-09 12:43       ` Mauro Carvalho Chehab
2010-04-09 12:43         ` Mauro Carvalho Chehab
2010-04-10  1:12   ` Andy Walls
2010-04-10 19:52     ` David Härdeman
2010-04-10 21:19       ` Andy Walls
2010-04-10 21:19         ` Andy Walls
2010-04-10 22:23     ` David Härdeman [this message]

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=20100410222319.GA10473@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=awalls@radix.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /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.