[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk device
From: |
Ulrich Drepper |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices |
Date: |
Sat, 19 Jun 2010 03:58:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Lightning/1.0b2pre Thunderbird/3.0.4 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/19/2010 01:24 AM, Blue Swirl wrote:
>> +static inline int serial_sysfs(char *d, char *s, int n)
>> +{
>> + char *di = d;
>
> I'd change this to:
> static inline ssize_t serial_sysfs(char *d, const char *s, ssize_t n)
> {
> const char *di = d;
>
>> +
>> + while (*s && n--)
>> + *d++ = *s++;
>> + return d - di;
I would guess you mean
char *const di = d;
Quite different and doesn't elicit warnings from the compiler.
- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkwcotsACgkQ2ijCOnn/RHQLowCgqmoJCFjfh/ySP4/PQAWKmKJ9
rAwAn1O1L3hb2nzd7altEWT/PXg8oecx
=YkfO
-----END PGP SIGNATURE-----
Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices, Christoph Hellwig, 2010/06/21