From: "Jan Beulich" Subject: Re: [PATCH URGENT] common/vsprintf: Fix signed->unsigned error, causing glacial performance. Date: Wed, 13 Nov 2013 07:33:16 +0000 Message-ID: <5283394C0200007800102B7A@nat28.tlf.novell.com> References: <1384272621-21655-1-git-send-email-andrew.cooper3@citrix.com> <5282640502000078001028D1@nat28.tlf.novell.com> <52825FA2.8030405@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgUwy-0005iH-Ol for xen-devel@lists.xenproject.org; Wed, 13 Nov 2013 07:33:20 +0000 In-Reply-To: <52825FA2.8030405@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 12.11.13 at 18:04, Andrew Cooper wrote: > On 12/11/13 16:23, Jan Beulich wrote: >>>>> On 12.11.13 at 17:10, Andrew Cooper wrote: >>> --- a/xen/common/vsprintf.c >>> +++ b/xen/common/vsprintf.c >>> @@ -239,7 +239,7 @@ static char *number( >>> static char *string(char *str, char *end, const char *s, >>> int field_width, int precision, int flags) >>> { >>> - unsigned int i, len = strnlen(s, precision); >>> + int i, len = strnlen(s, precision); >> ... this just looks _so_ wrong (and whenever I'll come across >> this again, I'll just be tempted again to adjust it)! > > I agree in general, and do err on the side of unsigned whenever > possible. In this case, I went with exactly what was present before. And after having committed your fixup, I realized that I should have made them explicitly "signed" (and going forward we should try to do so elsewhere when signedness really matters). Jan