All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Cc: "Kiszka, Jan" <jan.kiszka@siemens.com>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] [PATCH 1/2] Refactor ipipe_select_timers
Date: Sun, 30 Sep 2012 22:50:28 +0200	[thread overview]
Message-ID: <5068B094.3070607@xenomai.org> (raw)
In-Reply-To: <506560B4.3010703@siemens.com>

On 09/28/2012 10:32 AM, Wolfgang Mauerer wrote:

> On 27/09/12 20:33, Gilles Chanteperdrix wrote:
>> On 09/27/2012 02:47 PM, Wolfgang Mauerer wrote:
>>
>>> On 27/09/12 14:04, Gilles Chanteperdrix wrote:
>>>> On 09/27/2012 10:28 AM, Wolfgang Mauerer wrote:
>>>>> On 26/09/12 23:28, Gilles Chanteperdrix wrote:
>>>>>> On 09/26/2012 03:16 PM, Wolfgang Mauerer wrote:
>>> (...)
>>>
>>>>>> Talking about readability, I find a goto with a clear label name much
>>>>>> more readable than a flag. So, NACK this patch, please keep the goto.
>>>>>  
>>>>> So you're against the refactoring, or only against using the flag?
>>>>> Keeping the goto leads to something like
>>>>>
>>>>> 	if (install_pcpu_timer(cpu, hrclock_freq, t))
>>>>> 		goto found
>>>>> (...)
>>>>> found:    ;
>>>>>
>>>>> since we need a statement for the label, but nothing is left to do.
>>>>> I find this fairly ugly, but if you prefer it over a flag, then
>>>>> so be it.
>>>>
>>>> Then use return instead of goto...
>>>
>>> Won't work -- that skips the rest of the enclosing per_cpu loop and
>>> the second part of the function introduced in the follow-up commit
>>> that does the actual bugfixing.
>>>
>>> Since I take the flag is the issue and not the refactoring as such, 
>>> please find an updated patch with a goto below.
>>
>>
>> Oh boy, you love functions, do you? What I would do is: keep the test
> sure() :)
>> for evtdev->mode outside of the install_pcpu_timer function so that we
>> clearly see in the loop that it is the only reason for continuing the
>> loop. Then use the goto found, and at the found label, call the now void
>> function install_pcpu_timer. Ok for you?
>>
> okay, changed the code as desired to introduce more labels and use the 
> preprocessor more often. Please pick 23b2de46314 and b738a3b624 from 
> https://github.com/siemens/ipipe core-3.5_for-upstream (apply also
> cleanly to core-4).


Ok. Applied to my for-core-4 branch, thanks.

-- 
                                                                Gilles.


  reply	other threads:[~2012-09-30 20:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 14:11 [Xenomai] [GIT PULL] core-5 for x86 Wolfgang Mauerer
2012-09-18 14:25 ` Gilles Chanteperdrix
2012-09-18 15:27   ` Wolfgang Mauerer
2012-09-18 19:36     ` Gilles Chanteperdrix
2012-09-19 12:15       ` Wolfgang Mauerer
2012-09-19 12:36         ` Gilles Chanteperdrix
2012-09-20 16:11         ` Gilles Chanteperdrix
2012-09-25 14:45           ` Wolfgang Mauerer
2012-09-25 14:57             ` Gilles Chanteperdrix
2012-09-25 14:58               ` Wolfgang Mauerer
2012-09-26 14:41               ` Wolfgang Mauerer
2012-09-26 13:16                 ` [Xenomai] [PATCH 1/2] Refactor ipipe_select_timers Wolfgang Mauerer
2012-09-26 21:28                   ` Gilles Chanteperdrix
2012-09-27  8:28                     ` Wolfgang Mauerer
2012-09-27 12:04                       ` Gilles Chanteperdrix
2012-09-27 12:47                         ` Wolfgang Mauerer
2012-09-27 12:54                           ` Gilles Chanteperdrix
2012-09-27 12:56                             ` Wolfgang Mauerer
2012-09-27 18:33                           ` Gilles Chanteperdrix
2012-09-28  8:32                             ` Wolfgang Mauerer
2012-09-30 20:50                               ` Gilles Chanteperdrix [this message]
2012-09-26 13:16                 ` [Xenomai] [PATCH 2/2] Register high-res timer irq for non-ipipe timers if necessary Wolfgang Mauerer
2012-09-27 18:39                   ` Gilles Chanteperdrix

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=5068B094.3070607@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@siemens.com \
    --cc=wolfgang.mauerer@siemens.com \
    --cc=xenomai@xenomai.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.