From nobody Tue Feb 10 03:38:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1654850086766685.8589129471496; Fri, 10 Jun 2022 01:34:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.345961.571707 (Exim 4.92) (envelope-from ) id 1nza67-0002Ec-5f; Fri, 10 Jun 2022 08:34:27 +0000 Received: by outflank-mailman (output) from mailman id 345961.571707; Fri, 10 Jun 2022 08:34:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nza67-0002EU-1y; Fri, 10 Jun 2022 08:34:27 +0000 Received: by outflank-mailman (input) for mailman id 345961; Fri, 10 Jun 2022 08:34:25 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nza65-0000uL-7j for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 08:34:25 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id 131201b3-e898-11ec-8179-c7c2a468b362; Fri, 10 Jun 2022 10:33:59 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4743212FC; Fri, 10 Jun 2022 01:34:21 -0700 (PDT) Received: from e129167.arm.com (unknown [10.57.4.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 251CD3F73B; Fri, 10 Jun 2022 01:34:18 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 131201b3-e898-11ec-8179-c7c2a468b362 From: Michal Orzel To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 3/3] xen/console: Fix incorrect format tags for struct tm members Date: Fri, 10 Jun 2022 10:33:58 +0200 Message-Id: <20220610083358.101412-4-michal.orzel@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610083358.101412-1-michal.orzel@arm.com> References: <20220610083358.101412-1-michal.orzel@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1654850088389100001 Content-Type: text/plain; charset="utf-8" All the members of struct tm are defined as integers but the format tags used in console driver for snprintf wrongly expect unsigned values. Fix the tags to expect integers. Signed-off-by: Michal Orzel Reviewed-by: Stefano Stabellini --- xen/drivers/char/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index f9937c5134..beb44fe06f 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -844,7 +844,7 @@ static void printk_start_of_line(const char *prefix) /* nothing */; else if ( mode =3D=3D TSM_DATE ) { - snprintf(tstr, sizeof(tstr), "[%04u-%02u-%02u %02u:%02u:%02u] = ", + snprintf(tstr, sizeof(tstr), "[%04d-%02d-%02d %02d:%02d:%02d] = ", 1900 + tm.tm_year, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); break; @@ -852,7 +852,7 @@ static void printk_start_of_line(const char *prefix) else { snprintf(tstr, sizeof(tstr), - "[%04u-%02u-%02u %02u:%02u:%02u.%03"PRIu64"] ", + "[%04d-%02d-%02d %02d:%02d:%02d.%03"PRIu64"] ", 1900 + tm.tm_year, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, nsec / 1000000); break; --=20 2.25.1