All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: peter.maydell@linaro.org, jordan.l.justen@intel.com,
	"Gabriel L. Somlo" <somlo@cmu.edu>,
	qemu-devel@nongnu.org, kraxel@redhat.com, pbonzini@redhat.com,
	markmb@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 5/6] fw_cfg: add generic non-DMA read method
Date: Thu, 5 Nov 2015 14:34:51 +0100	[thread overview]
Message-ID: <563B5AFB.5050005@redhat.com> (raw)
In-Reply-To: <874mh0wqn5.fsf@blackfin.pond.sub.org>

On 11/05/15 13:57, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:
> 
>> On 11/04/15 17:35, Gabriel L. Somlo wrote:
> [...]
>>> +    assert(size > 0 && size <= sizeof(value));
>>
>> It's a matter of taste, and I won't insist at all, just mention that I
>> didn't write those two assert()s as separate statements :)
>>
>> Namely, with a conjunction (P1 && P2 && ... && Pn), you have the
>> possibility to spell the assertion as:
>>
>>   assert(P1);
>>   assert(P2);
>>   ...
>>   assert(Pn);
>>
>> And, if any one of those fails, you will know *which one*. Because the
>> line number in the "assertion failed" message will tell you.
> 
> Yes, matter of taste, but that can't stop me having opinions on matters
> of taste ;)
> 
> You pay for the more detailed assertion failure reporting with extra
> source code clutter (as written, it's immediately obvious that it's a
> bounds check, less so if split), and extra object code when NDEBUG is
> off (which it should always be).
> 
> Personally, I'm content to fish details out of a core dump.  YMMV.

The 12 GB core dump that the Launchpad user, reporting the bug from the
other side of the Earth, failed to save? :)

But, I do concede your point. (Line numbers aren't a panacea either, in
situations like the above.) Gabriel, please pick whichever format you
like more.

Thanks
Laszlo

  reply	other threads:[~2015-11-05 13:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 21:40 [Qemu-devel] [PATCH v4 0/6] fw_cfg: spec update, misc. cleanup, optimize read Gabriel L. Somlo
2015-11-03 21:40 ` [Qemu-devel] [PATCH v4 1/6] fw_cfg: move internal function call docs to header file Gabriel L. Somlo
2015-11-03 21:40 ` [Qemu-devel] [PATCH v4 2/6] fw_cfg: amend callback behavior spec to once per select Gabriel L. Somlo
2015-11-03 21:40 ` [Qemu-devel] [PATCH v4 3/6] fw_cfg: remove offset argument from callback prototype Gabriel L. Somlo
2015-11-03 21:40 ` [Qemu-devel] [PATCH v4 4/6] fw_cfg: avoid calculating invalid current entry pointer Gabriel L. Somlo
2015-11-04 14:33   ` Laszlo Ersek
2015-11-03 21:40 ` [Qemu-devel] [PATCH v4 5/6] fw_cfg: add generic non-DMA read method Gabriel L. Somlo
2015-11-04 15:04   ` Laszlo Ersek
2015-11-04 16:35     ` Gabriel L. Somlo
2015-11-05 12:23       ` Laszlo Ersek
2015-11-05 12:57         ` Markus Armbruster
2015-11-05 13:34           ` Laszlo Ersek [this message]
2015-11-05 13:54         ` Gabriel L. Somlo
2015-11-03 21:40 ` [Qemu-devel] [PATCH v4 6/6] fw_cfg: replace ioport data read with generic method Gabriel L. Somlo

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=563B5AFB.5050005@redhat.com \
    --to=lersek@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jordan.l.justen@intel.com \
    --cc=kraxel@redhat.com \
    --cc=markmb@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=somlo@cmu.edu \
    /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.