From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Levente Kurusa <lkurusa@redhat.com>,
kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
christoffer dall <christoffer.dall@linaro.org>,
pbonzini@redhat.com
Subject: Re: [PATCH v7 08/14] Introduce chr-testdev
Date: Tue, 22 Jul 2014 20:06:06 +0200 [thread overview]
Message-ID: <20140722180606.GA12651@potion.brq.redhat.com> (raw)
In-Reply-To: <20140716093312.GA14882@hawk.usersys.redhat.com>
2014-07-16 11:33+0200, Andrew Jones:
> On Wed, Jul 16, 2014 at 05:31:33AM -0400, Levente Kurusa wrote:
> > ----- Original Message -----
> > > [...]
> > > +void chr_testdev_exit(int code)
> > > +{
> > > + char buf[8];
> > > + int len;
> > > +
> > > + snprintf(buf, sizeof(buf), "%dq", code);
> > > + len = strlen(buf);
> >
> > AFAIK, snprintf returns the number of characters written, so
> > these two statements can be merged into one.
>
> You are correct. I'll do this for v8 (if a v8 is needed).
snprintf returns the number of characters that would be written without
truncation, so it wouldn't handle a very long code ;)
I'd prefer the obvious v7, to finding a minimum with 'sizeof(buf) - 1'.
next prev parent reply other threads:[~2014-07-22 18:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 8:47 [PATCH v7 00/14] kvm-unit-tests/arm: initial drop Andrew Jones
2014-07-16 8:47 ` [PATCH v7 02/14] add support for Linux device trees Andrew Jones
2014-07-16 8:47 ` [PATCH v7 03/14] Introduce asm-generic/*.h files Andrew Jones
2014-07-16 8:47 ` [PATCH v7 04/14] Introduce lib/alloc Andrew Jones
2014-07-16 8:47 ` [PATCH v7 05/14] add minimal virtio support for devtree virtio-mmio Andrew Jones
2014-07-16 8:47 ` [PATCH v7 06/14] lib/asm-generic: add page.h and virt_to_phys/phys_to_virt Andrew Jones
2014-07-16 8:47 ` [PATCH v7 07/14] virtio: add minimal support for virtqueues Andrew Jones
2014-07-16 8:47 ` [PATCH v7 08/14] Introduce chr-testdev Andrew Jones
2014-07-16 9:31 ` Levente Kurusa
2014-07-16 9:33 ` Andrew Jones
2014-07-22 18:06 ` Radim Krčmář [this message]
2014-07-16 8:47 ` [PATCH v7 09/14] arm: initial drop Andrew Jones
2014-07-16 9:22 ` Paolo Bonzini
2014-07-16 9:39 ` Andrew Jones
2014-07-16 10:59 ` Paolo Bonzini
2014-07-16 8:47 ` [PATCH v7 10/14] arm: Add spinlock implementation Andrew Jones
2014-07-16 8:47 ` [PATCH v7 11/14] arm: Add IO accessors to avoid register-writeback Andrew Jones
2014-07-16 8:47 ` [PATCH v7 12/14] arm: Add arch-specific asm/page.h and __va/__pa Andrew Jones
2014-07-16 8:47 ` [PATCH v7 13/14] arm: add useful headers from the Linux kernel Andrew Jones
2014-07-16 8:47 ` [PATCH v7 14/14] arm: vectors support Andrew Jones
2014-08-22 18:51 ` [PATCH v7 00/14] kvm-unit-tests/arm: initial drop Paolo Bonzini
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=20140722180606.GA12651@potion.brq.redhat.com \
--to=rkrcmar@redhat.com \
--cc=christoffer.dall@linaro.org \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=lkurusa@redhat.com \
--cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox