Message ID | 20210520100528.322846-3-rasmus.villemoes@prevas.dk |
---|---|
State | Superseded |
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=EEzV/IF6; 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 4Fm53q6cZ6z9sRN for <incoming@patchwork.ozlabs.org>; Thu, 20 May 2021 20:06:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 74E4582D15; Thu, 20 May 2021 12:06:03 +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="EEzV/IF6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B26EC82D25; Thu, 20 May 2021 12:05:55 +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 EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20702.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::702]) (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 2C03F82C97 for <u-boot@lists.denx.de>; Thu, 20 May 2021 12:05:52 +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=aibFKVHD9mJx9Gdas9/1oa2EIEIyHDwkhmDPj6kdQQ086ZBWbKyqe5sKHWn+N55rarp7WvgEdXz3JDISfTEAMNLkKphanFxOkgi74B07GaC7AVYaxhennyUhwD7H0okg4mmgSejx9UA/n88QTlDwSq6DhybGVD3rChV3YUFBTudGbC0kOOW2u9KPaTQ/+64EUcgIIORGS90Jt4DPqHXJjUwBFmZo8Tp9mOFtdXK9y6HnmTw7q28VePhLIdJfrCla993RRl8kt9/rZLt/TidhATwe44jeLLOWmOX4BXNZSjeCSeYfN/8CdUXchXFbe6GCIaF2FL3PE+8GdheW1lSJOA== 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=FOIsa2ruYrSBqNxqRIdUngRSiM81ACsvZnSuEbwxChU=; b=T1Y837RXb4dvOgyVxK4OR4xpjFhlyynNUODxcYyef7q+2GK+zQpENYMAH9OhoENAaQW6JgVB8hMA0EI3LvzwmhvMwT9TXID8lIasOyMUgkybT5oh0ykOiDo0QR6m+MNloq6zDHsssZDGGvWAtGtsAV9vi5E3bWMDc9x+x+GCtQ4Ts9aQr45SFiq1RZdanawHXRq/AsFTRVnkD7DoMxyS0WnAwigbBECBgyvajYSdxOIfUJdeQIYuH5/Bu5md1i6pdEfLeMv1OKI+ATfIkNdnDbu75WxwT/nTJppbv8j7dcgH41AszYFXlFFnHoMB6leDmTwGE4b9iq5wM4dbk14cqw== 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=FOIsa2ruYrSBqNxqRIdUngRSiM81ACsvZnSuEbwxChU=; b=EEzV/IF6im33FngqGWt4urL8IRBHl5+++RTjoAP/oZzoY9+BSWWrO9TJJDMRJPdnsD64lg5fWfRAjUXKuUxSYmuDPRvoDmksDv6W6vXQj6IpzDDOfCi1oLRhJ/0/edEtBGQe8cRut8ZvC4ZnteIaCqOCmW9zg6ocgUFBjmhV00k= 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 AM9PR10MB4310.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:1fd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 10:05:49 +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.028; Thu, 20 May 2021 10:05:48 +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 2/5] lib/vsprintf.c: implement printf() in terms of vprintf() Date: Thu, 20 May 2021 12:05:25 +0200 Message-Id: <20210520100528.322846-3-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520100528.322846-1-rasmus.villemoes@prevas.dk> References: <20210520100528.322846-1-rasmus.villemoes@prevas.dk> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [80.208.71.248] X-ClientProxiedBy: AM6P194CA0072.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::49) 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.71.248) by AM6P194CA0072.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 10:05:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c952c83d-2a95-4da6-eedb-08d91b76d794 X-MS-TrafficTypeDiagnostic: AM9PR10MB4310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <AM9PR10MB431082AA2B8B2A159976D25C932A9@AM9PR10MB4310.EURPRD10.PROD.OUTLOOK.COM> X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KIqBF66ELMi+zbl/stPHxd4HjjUkbisV2TW4tNTemEy8uNXN6gnh56NPY+qv3hf1kfY2qIIGJUGvdU1cZFD+OQh20jQtKx7FkTQnVEx1qQi+NxfT9NO51jfHjAvIV0249ahZgAuwOSzgBxYvGGw4mmih436RFLPuJiqbHhM+0InWbFzn4yofm0CGbyiCDISOlZZ3BQicdm009HOrSreJ5THJQ++WlsR4JG/PxsmPAat9isAfIN1QOzykhIQAH/8W3uLOIL9A3OylOU58tvHxRDbVGoy89y89iW8OOMZEdE10u2LzwHSi3WO3nLicj0pd0UJY28CIEJI0RGgHqcyhWfDY+zFkHZ37OSZQu/WV65bg92KUzqgBjkgdueu17oxQ5+rtBVQJiKdVwdgi9HN+H6T8VeJXbObFisNA9iHZthfluFGpVPzOGiHCmiQswfzT7tav9rziHZxwvfk8IPKtkk7llG5jIar+vTiisk54UHTg1uivn+VlIBAtaiYmFKT4WK1NpgSb+M6HwrAr5EsQENgXPOdb5plPqv9E0T1UUmav4Yiic7qhTon4djkMub9QOW3oQUawHCjraN+1Zj4V5Rxt1hBr+CvWtIa6aGc2GxWr3pOq667yW8qph4cIl65f7wvDqbTFc+oOMAhoGsBTDTRyxYhMBgWt+gypEpNnbDg= 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:(396003)(376002)(39850400004)(136003)(366004)(346002)(5660300002)(36756003)(54906003)(6506007)(86362001)(26005)(107886003)(6486002)(4326008)(8936002)(478600001)(6512007)(66476007)(6666004)(66556008)(66946007)(8976002)(83380400001)(1076003)(44832011)(2616005)(956004)(8676002)(38100700002)(186003)(16526019)(38350700002)(52116002)(316002)(4744005)(6916009)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: EAuzGRR/WCWyZGYTru9eJn8xC6Z3tCe12QPethpbOjdITFa3m+Tdcwwp256GyJuiNSUIwxwe7Q5YOTux25TV1VBEWIPcS/aEe/3yT8BOiNK7mPPGKBMx2EVbpBsnak2oAbTjkVaVfEqjGqhI4Ao/n786rKKdURSxE8MZfya3HtyVujfGnFfODkwiAVQlq1aKZ340U7xv9ZDAgSN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GaZk2QW1cF+D6WOU2hS00z4CekBzhoOfhXau0Y2fbvuKQ1 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: c952c83d-2a95-4da6-eedb-08d91b76d794 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 10:05:48.9367 (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: e0NVKXxnkidQdCywWcCqhSUYWUR/iq9m0QznYxZZTKMHYYM8PK4X1cycJthH1JJhjAaoUB8XRiOk4lWAM7hdRo1XKkL4xgxudIbTOzoK5uU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR10MB4310 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 |
assorted printf-related patches
|
expand
|
On Thu, 20 May 2021 at 04:05, Rasmus Villemoes <rasmus.villemoes@prevas.dk> 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(). > > Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> > --- > lib/vsprintf.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 0050110683..e3bec7489b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -785,19 +785,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); - /* Print the string */ - puts(printbuffer); return i; }
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(). Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> --- lib/vsprintf.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)