All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	qemu-devel@nongnu.org
Cc: Xiao Guangrong <guangrong.xiao@gmail.com>,
	Vadim Rozenfeld <vrozenfe@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v3 2/3] mc146818rtc: Tidy up indentation
Date: Thu, 24 Oct 2019 15:01:47 +0200	[thread overview]
Message-ID: <c4fef2c4-32f1-cb4a-295f-13a03434becd@redhat.com> (raw)
In-Reply-To: <20191024122425.2483-3-philmd@redhat.com>

On 24/10/19 14:24, Philippe Mathieu-Daudé wrote:
> -        * if the periodic timer's update is due to period re-configuration,
> -        * we should count the clock since last interrupt.
> -        */
> -        if (old_period) {
> -            int64_t last_periodic_clock, next_periodic_clock;
> +    /*
> +     * if the periodic timer's update is due to period re-configuration,
> +     * we should count the clock since last interrupt.
> +     */
> +    if (old_period) {
> +        int64_t last_periodic_clock, next_periodic_clock;
>  
> -            next_periodic_clock = muldiv64(s->next_periodic_time,
> -                                    RTC_CLOCK_RATE, NANOSECONDS_PER_SECOND);
> -            last_periodic_clock = next_periodic_clock - old_period;
> -            lost_clock = cur_clock - last_periodic_clock;
> -            assert(lost_clock >= 0);
> +        next_periodic_clock = muldiv64(s->next_periodic_time,
> +                                RTC_CLOCK_RATE, NANOSECONDS_PER_SECOND);
> +        last_periodic_clock = next_periodic_clock - old_period;
> +        lost_clock = cur_clock - last_periodic_clock;
> +        assert(lost_clock >= 0);
>          }
>  
>          /*

Still not entirely tidy, is it?  I understand making Marcelo's fix just
move a brace, but in general you can review with "git show -b" to see
more clearly what's going on.  Therefore, it would make the most sense
to have just two patches, one reversing the if and one fixing the bug
(and both of them having indentation changes).

However, I'm preparing the pull request now so I think I'll just keep
Marcelo's version.

Paolo


  reply	other threads:[~2019-10-24 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 12:24 [PATCH v3 0/3] mc146818rtc: fix timer interrupt reinjection Philippe Mathieu-Daudé
2019-10-24 12:24 ` [PATCH v3 1/3] mc146818rtc: Simplify by reordering if() statement Philippe Mathieu-Daudé
2019-10-24 12:24 ` [PATCH v3 2/3] mc146818rtc: Tidy up indentation Philippe Mathieu-Daudé
2019-10-24 13:01   ` Paolo Bonzini [this message]
2019-10-24 13:21     ` Philippe Mathieu-Daudé
2019-10-24 12:24 ` [PATCH v3 3/3] mc146818rtc: fix timer interrupt reinjection Philippe Mathieu-Daudé

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=c4fef2c4-32f1-cb4a-295f-13a03434becd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=guangrong.xiao@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vrozenfe@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.