Message ID | 20210527222046.1276246-2-rasmus.villemoes@prevas.dk |
---|---|
State | Accepted |
Commit | 97587786463ae3a44c95fcb053ab27136c646aa3 |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> 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=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=G2waG0Dn; 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 4Frj2j4bZ8z9sW4 for <incoming@patchwork.ozlabs.org>; Fri, 28 May 2021 08:21:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8232382E4A; Fri, 28 May 2021 00:21:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="G2waG0Dn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE1BE82E40; Fri, 28 May 2021 00:20:59 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0701.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::701]) (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 35ADF82CFE for <u-boot@lists.denx.de>; Fri, 28 May 2021 00:20:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OavxzqAc31+cQU44+iMjd9fvEAaqdHbGc3+BgfA8v0aKHDeIwHQYnKdxiRws7HAoO17DQCgABRW9PrdAH0c+Or9dBVdJL22tDI10rMXzZoC5GaVga5LPnkgRHxKIMRDJHuUR6NMHjHuZivV/x1OALrLpYzlUQinbnJD/AKrgn41CP+/5ewRRf+90q8q1n6rOh3IGgxo95yVY0VaMOiPKxMQ/QsA6n+4Y0X58r5TCKF6BcL3IZc4KX7PMRoq6hWnKoZkUeuhIceyTEeVUfOOBqN5RDDIZPADssin01o+eKDfrDNgPQn/g03RknGeC4vhQ2qQw4R805KTdRyWj1RXh+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1PatziJFzMPJHVdBf/cgaWGwGLgJB8NZi4pGzNF3joU=; b=HJeEjekLCK/qBDczSp3R4OEjv3miJvfCpb3L3MPjh9WX/kRDL1VIna5vbr5RQg6jzVKw8UrRGfl22sw6XXI9+HlgyFNcH5drvtl4QDeL0dflu5fbrKsUnEVLfwl3GZBx7iDpQ8HafTYX/nW+kzz3J3wC35z763jAmUzAiIfOY/0PTZSRPKu9ewcuFdcR/cXM2/t0etp1F1tXpbsxKRifkyqKE+uN2lVV3jAsNss/g32j4gqkKOVeWpLzFH3dyiTT7UFAGWBIR7jOanS6Z0IohvNarkpw4Bp7ESywGDRgvAPARoZp7vZzcno3rEkkcZWe1NmK8WP5itZfu6sy14/v+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1PatziJFzMPJHVdBf/cgaWGwGLgJB8NZi4pGzNF3joU=; b=G2waG0DnH4qFxjPx6iYVwsUr/WO3XZZkgczGe2aK4CwjfZoe+CUaD481ei4uwoIMGDhGwE8Fo2gWP1OODzq+3Ea9S2XWyAhd8HDq4MLUsH9Hmm5GyK9z5OPq4q5Sgrm2WXZOmyR30rOS3R+pqVUY3SzAdKL5dt1Yag/tZXveUF0= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM0PR10MB3444.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:156::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.24; Thu, 27 May 2021 22:20:56 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::888d:190b:b3b5:1ad2]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::888d:190b:b3b5:1ad2%3]) with mapi id 15.20.4129.036; Thu, 27 May 2021 22:20:56 +0000 From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> To: u-boot@lists.denx.de Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>, Rasmus Villemoes <rasmus.villemoes@prevas.dk> Subject: [PATCH v2 1/3] lib/vsprintf.c: implement printf() in terms of vprintf() Date: Fri, 28 May 2021 00:20:44 +0200 Message-Id: <20210527222046.1276246-2-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527222046.1276246-1-rasmus.villemoes@prevas.dk> References: <20210527222046.1276246-1-rasmus.villemoes@prevas.dk> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [80.208.74.47] X-ClientProxiedBy: AM3PR05CA0155.eurprd05.prod.outlook.com (2603:10a6:207:3::33) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (80.208.74.47) by AM3PR05CA0155.eurprd05.prod.outlook.com (2603:10a6:207:3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Thu, 27 May 2021 22:20:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9cbf3b27-5fa5-4115-b151-08d9215db291 X-MS-TrafficTypeDiagnostic: AM0PR10MB3444: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <AM0PR10MB3444DA9D8CE3FE5EE57C49BF93239@AM0PR10MB3444.EURPRD10.PROD.OUTLOOK.COM> X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4ERuOdxt9RMXACr9bwhNuz+hnJcRWYrWOnpmWuW+nik5+4vBPgMKyhRPfYiYEHzexFjkTCAYXOBI8A3fCA37t/SHQttIAwFqXQ/1EP2PvPpgWdFeoKSfYqbx+brXCUIB7KwejK1dPRzzkLGboMKbH8CYgYLzTVh7HrVMVnswvrVwgdCokhET4KzP4t6U041tc1o+yIrT51SbzQVzPhHdcsoUwFpa1veIed7xz4kj39E3N6DZntYgAPRNaWXIKADyX7DrySuL2XaxyHse3IRz74rv92ooP4flEpzlA3xPf8gWwRgJmJLe6kNGncfjl8TrGCgSMHM9kyFtcjKWCjKM7howFox5OU5NYGndYRLlB8MC7fMvevIA193XO+a/Il9Dn+Yg354zpgHoon3HblP5vwYsIqAKfrIUFBTL7IG0qO99waOhPfeB9ucEqWEb+D1fJMZP1hgHLMG0OUJO04Zr1rfwoiEaO6o4nbFEFaZhdgWr+ZuShVD9Me4diajrKqCVJFMygY0EfHqTgCUoG/5mtURQ/S2mf03bfUhw6FN5hSbefXM+xPEUmepBGAfFQR8d3fopT54dMyuuN/Sl5nuaXJn6OsHsEQpxf9+dstAAcf9TkW04p6K80KONC5MgmNcDMwCBpfGfE1mkrUXcrAC514Tt3gdBTAy5roEkfAkkYHY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(376002)(346002)(136003)(396003)(366004)(39830400003)(66556008)(5660300002)(2906002)(83380400001)(44832011)(6512007)(54906003)(6666004)(8976002)(956004)(26005)(2616005)(36756003)(52116002)(6506007)(8676002)(8936002)(16526019)(186003)(38350700002)(38100700002)(4326008)(1076003)(66946007)(316002)(4744005)(6486002)(107886003)(6916009)(66476007)(478600001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: w8++Dd1mIDRyx+/0cwS8Zs0HVf9+J+cg4X4oiXM56oDj9Z4fU1Vw/YX8XghJP+nS+GiT+3CTbg+V//Sr0qZagU6+ntwIvXVjLkQ8WSrTDaODOyWq1SoJr6gvGBj74AlK5G7CeFyDLslD3dLw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XhpHnIeDm+4NkPEcIdAg+Uv2WhkLspE5gzw4B8dMmxezPilcAsJ4xRHeZLEbWPIBRA88WCeq+3YZN4KAqpAk+z6kq2ZyeWskEf//5k84cVcApx0/rgPOIqhQtV/Lfu0mpur X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 9cbf3b27-5fa5-4115-b151-08d9215db291 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 22:20:56.2582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qQM15CWLwfSppV7UDIbNAUGgU/BGugn0oV6rCsAXFJI/JxF7QNJPbMo3plmj6Y0ywEBH4223884d64d0OzjACz9pfE/GrsoTfgOAevT0w1U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3444 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
trivial printf patches
|
expand
|
On Fri, May 28, 2021 at 12:20:44AM +0200, Rasmus Villemoes wrote: > This saves some code, both in terms of #LOC and .text size, and it is > also the normal convention that foo(...) is implemented in terms of > vfoo(). > > Reviewed-by: Simon Glass <sjg@chromium.org> > Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Applied to u-boot/master, thanks!
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 9dc96c81c6..cf3982eb03 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -787,22 +787,11 @@ int printf(const char *fmt, ...) { va_list args; uint i; - char printbuffer[CONFIG_SYS_PBSIZE]; va_start(args, fmt); - - /* - * For this to work, printbuffer must be larger than - * anything we ever want to print. - */ - i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); + i = vprintf(fmt, args); va_end(args); - /* Handle error */ - if (i <= 0) - return i; - /* Print the string */ - puts(printbuffer); return i; }