From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH URGENT] common/vsprintf: Fix signed->unsigned error, causing glacial performance. Date: Tue, 12 Nov 2013 16:10:21 +0000 Message-ID: <1384272621-21655-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org The original patch for c/s 67a3542c5bc356e6452d8305991617c875f87de4 "common/vsprintf: Refactor string() out of vsnprintf()" specifically used signed integers, identical to the code copied out of vsprintf. When committed, these had changed to unsigned integers, which causes a functional change. This causes glacial boot performance and an excessive quantity of spaces printed to the serial console, as we loop to the upper bound of a 32bit integer. Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich --- xen/common/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index e8f45eb..43dc392 100644 --- 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); if (!(flags & LEFT)) { while (len < field_width--) { -- 1.7.10.4