From mboxrd@z Thu Jan 1 00:00:00 1970 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 Message-ID: <4C1CA2DB.2080502@redhat.com> References: <1276886283-1571-1-git-send-email-ryanh@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Ryan Harper , virtualization@lists.linux-foundation.org, john cooper , Rusty Russell , qemu-devel@nongnu.org, kvm@vger.kernel.org To: Blue Swirl Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12126 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755402Ab0FSK6x (ORCPT ); Sat, 19 Jun 2010 06:58:53 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: -----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 =3D d; >=20 > I'd change this to: > static inline ssize_t serial_sysfs(char *d, const char *s, ssize_t n) > { > const char *di =3D d; >=20 >> + >> + while (*s && n--) >> + *d++ =3D *s++; >> + return d - di; I would guess you mean char *const di =3D d; Quite different and doesn't elicit warnings from the compiler. - --=20 =E2=9E=A7 Ulrich Drepper =E2=9E=A7 Red Hat, Inc. =E2=9E=A7 444 Castro S= t =E2=9E=A7 Mountain View, CA =E2=9D=96 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkwcotsACgkQ2ijCOnn/RHQLowCgqmoJCFjfh/ySP4/PQAWKmKJ9 rAwAn1O1L3hb2nzd7altEWT/PXg8oecx =3DYkfO -----END PGP SIGNATURE-----