From patchwork Fri Apr 10 18:54:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1269164 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=PaWBJKeU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48zRyx3YkVz9sSj for ; Sat, 11 Apr 2020 04:55:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B6B1E804D5; Fri, 10 Apr 2020 20:54:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1586544899; bh=ahPHt3DDrGa3NP8TJ94QQadHPJSe2nyAG8gsbEPaQvY=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=PaWBJKeUS9O+AuzHvCRRLHC4WULm3EsOcAR6kCrM1dGhDHCUC1saoVHJ49+lcWB5o jvtPJ2+tPwVIosAQp1UmbE8oi7xAaJHgN6b+JnwMqxJoo08zyp24AxgDv2xpwtalHG Fw+J5dyJMSvR5/l3TywL8T//DRtkGzGs9PSOyO9ks/+6O+ywdV0gpw2FYfkWlqGg7q Jjm+/aVaPZgL5om1p2/8SNt9QDYOk4d64+ekdMOWXlkLN2ENfxknKbKwDGm5F++iEB IllBW+mQ7/RQv30az/gCUV4FBIscx3AXCaAmP8C0LZ2rJl6fLyLaduIW08P7Ushlpe +0X/p9kG6huiQ== Received: by phobos.denx.de (Postfix, from userid 109) id 351FE8054E; Fri, 10 Apr 2020 20:54:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BFBBB8006F for ; Fri, 10 Apr 2020 20:54:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marex@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48zRyl1PMpz1qrGG; Fri, 10 Apr 2020 20:54:55 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48zRyl15KGz1qqkg; Fri, 10 Apr 2020 20:54:55 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id gN2O0XEaRRpd; Fri, 10 Apr 2020 20:54:54 +0200 (CEST) X-Auth-Info: Ve1Se+RB6HOeBpZjLBLT8s7fYPWl0CPXZjhu0ul93Ko= Received: from desktop.lan (ip-86-49-35-8.net.upcbroadband.cz [86.49.35.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 10 Apr 2020 20:54:54 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Simon Glass , Stefan Roese Subject: [PATCH] tiny-printf: Support %i Date: Fri, 10 Apr 2020 20:54:49 +0200 Message-Id: <20200410185449.152564-1-marex@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The most basic printf("%i", value) formating string was missing, add it for the sake of convenience. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Stefan Roese --- lib/tiny-printf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index 1138c7012a..8fc7e48d99 100644 --- a/lib/tiny-printf.c +++ b/lib/tiny-printf.c @@ -242,6 +242,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va) goto abort; case 'u': case 'd': + case 'i': div = 1000000000; if (islong) { num = va_arg(va, unsigned long); @@ -251,7 +252,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va) num = va_arg(va, unsigned int); } - if (ch == 'd') { + if (ch != 'u') { if (islong && (long)num < 0) { num = -(long)num; out(info, '-');