From patchwork Thu May 20 10:05:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1481473 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; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=mxpd3QB9; 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 4Fm53c3q75z9sRN for ; Thu, 20 May 2021 20:06:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5096B82D57; Thu, 20 May 2021 12:05: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=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="mxpd3QB9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4780882D52; 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 F002582B98 for ; Thu, 20 May 2021 12:05:51 +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=M+K7k/dTE+tqACH7KjrIkYnKijfHXRAlzFLnLeVsEOzyvgnplIVKN4LcdJr77se5IBic7h66UqPTr4qgZbhr7piMt0z43E7MYUd7/UDO+m5ApUU3YC98CZPtg0Vs8YK/yDtihrH0JhGTRFB5w4VTgAM7rY+Q9PugtiDhNrKQrfn5B3A8FodfXg+vKPLjaPJRZhMDVj1mNvsvAvcqlCbzIHjkVSLIWxURUks0RvsrnE9dvn4kGT3cux3VU6rnDRXVta0gNPXIE+bemCwvZ+B80ix5L/+OxVjFGhTaAu4DRbu1TK3OoUi6OlYCQOoGFR+gqtOiSaLHSQzO6dhT3N/2Kg== 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=Qnta3rv4QsIlHtdrLsm0msw6pTrfED2oMUH4zqWyxnI=; b=MScxpkJJHDmep9xQNhRAx/V7CoCTmXItgS4iZtR+WPnaHx3aIBTrA9n7BnYXuHTcaaC3ujYoBvtTeOBCPx672i6EYvfXXqw5bdnzItfRdYVgLEEh3KGxw0T7ioLDVhRO3HCzzQ2PKnlPTTt5+hQHzpkGK7YgSOZHzT88Kdk/Dyu90TsbFgC38/4iNFr6HYA3jmx/uNc9hydHplOmyqSRQ6qMR2bHzNA4Prq2ssivuHn4anY7eCVKccRaQjYDMjur7ug/l5bHqglHd53jG6QSxOaBQgQBJEz8IniPjqvEhfh5CkzGrOvrS6s5JxZST8WM7O1FnoWt1g1M/pdzhEabDw== 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=Qnta3rv4QsIlHtdrLsm0msw6pTrfED2oMUH4zqWyxnI=; b=mxpd3QB98TLEnez2x7GpgXV/IV35eVWTNcayO7Cebty/pAWItT+8ABLxJ/J3NnMZry54S2D0jhGYBvcVWczS6U541ie6XcqHX8v+dfeCziNXMsgQ5TJqcYDEPK3owHasN/Ef9CKqxpuGbxyYcdzBXFLHyqZO82YNNt8+2SVl7VI= 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:47 +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:47 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Simon Glass , Tom Rini , Rasmus Villemoes Subject: [PATCH 1/5] lib/vsprintf.c: make sure vsnprintf() never returns a negative value Date: Thu, 20 May 2021 12:05:24 +0200 Message-Id: <20210520100528.322846-2-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> 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:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef58f61f-c575-42e9-93fe-08d91b76d657 X-MS-TrafficTypeDiagnostic: AM9PR10MB4310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7l65mnpEOmvtHuDVPFH33oMzV/we6yTL569XZdHxCpphUJxJv/GEphmfnNNpgaImw74e5EwVD1d6Cpj4W+yiGDDzwTRM26Hy5XKiq5dzTv1FMrd/iM8ZE9DMcEYCKGHTyNh+QNO6cHGP4tQwLYfzmKomLxK7Z1YtO1K6OVLO0ieQwQ+DyKs3GAREV3aFdTel3BuTaWxikGH0nZKMoCTqKxazNRmq4ieWwrWMMABbeCHwEnHIuZPZBMQ2Md+6U69UnKE/NHCwwAWdYulQGH1hlZjQyFyDuidy5VAP2nnU0QzSRn2h+jKJs5fzCu0UKbfblXGVSFYGddat1Lr+f0+yXZmpv2GReJLyDlPebS14/U/Dx0tRDKH8kcw0zNQawT4yIb13NShOcQwRUVV5XULbGgcodPqE0oNj5t8Tm+Rs2LrGQeyGMAsfZgo+Ugp7EVMAJWsMI9thPxbYocr2bKza2sJQ2uBmLUK7ihTn+QWKjogn2U/VV0udYpvls4I6+xeQSDVcJYTiHk5yYeuUTGgc3VQ5ElPBJU5EfcseBMyoAMkS1jE0Yp417pWWQ1vKVjxvuP4AxuWq0Tg3eg66RlbmquPpyg5Y+aZICawDOi8AZevwyG+XhTicwTASAbrM2EiO6nfrxLuvJmYNWPRhYqkvVxtuKQgksoyfyV3oBJ7E6f8= 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)(6916009)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: iSZRmlgimidntwSz/le1YH2eUTIgC34T4u+hG8ASGbpUryI6G9kjmo1S3H3dt34eUkso9JC3IRLY6WcP0F7fCJjz4KVDakuZOYyi8ynmMkoS7kBZBpkAO806/sIgkIzYPGwBCX+jBb8pZUGktrzfro2z3Uu4BzJWROy/pi681E5XKO7KZ2GGuLd30w/XG3UXil2RQP0PFqevB9dCdGWaNEuvxd19UfJdjymsML8HS5tvEvv1VgVkSJ8RcjtxTHRi/14HQmC+GToTNjrLhVs0INgd2f3Grxa27CJ6uaIrhsjghfI0708USNC/Kp7BIcF+ZnzOa6UslvrUUpJByKh7s7sSffahzV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-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:47.2236 (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: 0iPboW2IZUJQUNh19TPxzbTWfIKTktvBClyxv/XzFdu/5IV+XrYSkCISONKnVXhirOVAdN79f6rjE8IDLhsKCLsvKCpQKadjNfnhqrKDhQ0= 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 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.4 at phobos.denx.de X-Virus-Status: Clean Most callers (or callers of callers, etc.) of vsnprintf() are not prepared for it to return a negative value. The only case where that can currently happen is %pD, and it's IMO more user-friendly to produce some output that clearly shows that some "impossible" thing happened instead of having the message completely ignored - or mishandled as for example log.c would currently do. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass --- lib/vsprintf.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 9dc96c81c6..0050110683 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -310,7 +310,7 @@ static char *device_path_string(char *buf, char *end, void *dp, int field_width, str = efi_dp_str((struct efi_device_path *)dp); if (!str) - return ERR_PTR(-ENOMEM); + return string(buf, end, "<%pD:ENOMEM>", field_width, precision, flags); buf = string16(buf, end, str, field_width, precision, flags); efi_free_pool(str); @@ -631,8 +631,6 @@ repeat: str = pointer(fmt + 1, str, end, va_arg(args, void *), field_width, precision, flags); - if (IS_ERR(str)) - return PTR_ERR(str); /* Skip all alphanumeric pointer suffixes */ while (isalnum(fmt[1])) fmt++; @@ -798,9 +796,6 @@ int printf(const char *fmt, ...) i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); va_end(args); - /* Handle error */ - if (i <= 0) - return i; /* Print the string */ puts(printbuffer); return i; @@ -817,9 +812,6 @@ int vprintf(const char *fmt, va_list args) */ i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); - /* Handle error */ - if (i <= 0) - return i; /* Print the string */ puts(printbuffer); return i; From patchwork Thu May 20 10:05:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1481474 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; 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 ; 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 ; 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 To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Simon Glass , Tom Rini , Rasmus Villemoes 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> 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: 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/WCWyZGYTru9eJn8xC6Z3tCe12QPethpbOjdITF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Wuxn64NPH/ssli6p6L5CSg/Sev9vpeocNnKvvgbto/JlMXvRoEYhzR/MkxZVY2A/swQUhgmIajD90m1oDOfszoIdpG74IUxQvsYQQ6k1zTQ4RJB4qRhkAhJrMYU/Nmjt50K4678YszwiKf29VIPBffWi/9ylwDsCzEVA+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 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.4 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Simon Glass --- lib/vsprintf.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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; } From patchwork Thu May 20 10:05:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1481475 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; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=V/Pliaze; 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 4Fm5440CHdz9sRN for ; Thu, 20 May 2021 20:06:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4711782E1A; Thu, 20 May 2021 12:06:07 +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="V/Pliaze"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 89DC082D65; Thu, 20 May 2021 12:06:00 +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 659AA82CBE for ; 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=gXl3igaAekke5//pHxIlwhH8amWK1NmfzW7Ppoe8dTM53xp58l1CeJg9hkLnsuEFjhlwOYl5Qqo0arxeRtwhSgbv/EqRWAplpigDVwrZFDt/Uk+hJkIAbrac2pP7JQS+HtWwXuPNaWfnF2Gm+2d5g5xNa045MmpVisTAkKjs8j8wRsQkobvb3zbmLE1JzgsnMjBEjl2KhJYopGYHihxbnhyyZb2tA+Tgg9dFgt68Ff54vm0qypEK1cEiOZWxg7h+IjDPTlM2TGjW3Yrvs3h+BtIhLorKNtroXup3dT6Y8+NxbUQJC7qvv3hu9TgQ2Fmwmd6NExq2tCMZH4WQjz5Yww== 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=IieZM6OLizEAdjool9Hw5a8/6zQeBae19BgkqVsqicY=; b=c3l/f0+uTi2JgANe5a2B27Jrh2IhhegMYNddk3YjcLOIxy7PL/daJYGjb8HYtmihm4JhXG0u4ztE54Th3lE99GdzXwGWftaZUQSPtLiiw5YeN0VNzQBgwAA8mFDEoFDdaGLeCUd6+DLYA5XIP8ilov78i8FYMq8fMZ2pudDGUAl0ViO+WnqOkmCVTrY/gnWouVHas/IU+O3Z1HBDPA8gFJ76Gg+xiw2WWes45asb361jKaoUJtQ6yPlkXUt+BpizSMKHz0o/0r3YHevPuETxaXqNR2lSlp9X74/RTPWpKHp/NWGc3+I2StZwS/Z2NZwF+RmFTmcBcLce5bKcgBPhPA== 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=IieZM6OLizEAdjool9Hw5a8/6zQeBae19BgkqVsqicY=; b=V/PliazePzL+y9nQJpqTKltt4vOakYFwMhMry4QUw6StBUcVlK2EP5zOdB2R4CuzWaU/kq2vHF5wEJsLGngiNON2DNc5ynEuR9Jv36RkStQzs0BxMVKHY81prGubGq1QOkcHGqu0+xcTnzro5ILTvKfwWkqiQ8aKhYeQE7XzscE= 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:50 +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:50 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Simon Glass , Tom Rini , Rasmus Villemoes Subject: [PATCH 3/5] lib/vsprintf.c: remove stale comment Date: Thu, 20 May 2021 12:05:26 +0200 Message-Id: <20210520100528.322846-4-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> 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:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0ca72b4-be83-4337-f984-08d91b76d872 X-MS-TrafficTypeDiagnostic: AM9PR10MB4310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1775; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kVvuNgiZMtn9vjMUq1vKG7a/ykl3Gm3hUB5O6hG4e/sNdf+n+q/m/RC+WpwGOR0Tq32Ib3yZeuU8mLw8AREoos4vHpm9FYVgKb8daLkSe166Sz29d58npOIJ1KNJrI4NKJOUqSM2sGG2Mjv57rtcojCuKmL9CTDnChdOycxC1dPX5wi5n7DF14+89isvuhj/1f/imC42clqHKmFFBHrvRyl4Xxp5Fz6Pru7bSdm/XLytCKkcAGOe4sC+xabAMeFzpEILB9sWFNK6Q5i4pTWAqL8Q6hSxrdDn3U3fI/LfTbxSuwaxU1QSiALXtfM2wMI/BUe9NqlHqwj/qTRCkMOfapVwlk+yAJg6MZaXRGMdOgMcCcpExNO3LbMMcDCWxKPUfehATyTxOtVWFMugroHeGpM9oYWiA1NMbO98njshmTa2iLnykXmdGZBoHm/Uvhcpbyy2QjgNidQRsvzsfeMX1cJe4WsjsGjsSmTHAXgxDmHuOigrQJTapzi5L7wood3nuB/9dgPD59w0prBdd4K+5oFDTC2qQCQhDQjdNe1C8aACWhTGdSRPLiOkw3jMq0GQJbO48kwjxcz7Tay3qMZ1t5b6ogVHBSLySZkMnPgxDFF0CmBO4I3ihKECNDkbiHLT1g/DZVaHLUIC+f3XmBm1vg== 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: P1ZSgd36C0OqAZcX8nlPYGZkmWGXHYGMT38peFh2pfEIqZuWrdFphpqGeGuoCIT7PuGL0iG3bJ5UBnVR9axzPbn/HN9eqNGXOsVNrIc/qDrj0MSr5CtmY40h1doISQ4Fke0kAIfQ0h1DcxPuzGvFwReKAXsuGPDDC9NqrN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yaXDuLLlvZJFVNHdfz7zx4AAmkU14pg8GHGHiMcCLGTTyv6nTCj1q9N1OzyUu5f/yivgFIgJr8hInjvwqYaO4q X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: e0ca72b4-be83-4337-f984-08d91b76d872 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:50.3678 (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: GGtSQFZStvdyjQ8UycAQdea9zdcVflhIrw8BLapjV6EZs1jvWFsp86PtGrX/QzOcNqELqqCf4c4leWge30erwY3iUvsX1eUCGtcMnraPP/Q= 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 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.4 at phobos.denx.de X-Virus-Status: Clean U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like lookups. Remove the comment. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass --- lib/vsprintf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e3bec7489b..65d985982d 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -434,9 +434,6 @@ static char *uuid_string(char *buf, char *end, u8 *addr, int field_width, * - 'i' [46] for 'raw' IPv4/IPv6 addresses, IPv6 omits the colons, IPv4 is * currently the same * - * Note: The difference between 'S' and 'F' is that on ia64 and ppc64 - * function pointers are really function descriptors, which contain a - * pointer to the real address. */ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field_width, int precision, int flags) From patchwork Thu May 20 10:05:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1481477 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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=ekBAw39/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4Fm54V5dFPz9sRK for ; Thu, 20 May 2021 20:06:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 076CC82E40; Thu, 20 May 2021 12:06:14 +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="ekBAw39/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 29D4282B98; Thu, 20 May 2021 12:06:01 +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 C2C8E82D15 for ; 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=BrPKt9vDLt2JDUEXHbUFhLIGk4nDxL63+Xn9dKZF411oLTSdOtaS3QHShJ9jxB7IlS34k052rldhS5O2K19aQxU/4UQK4xAkXNHDLL2vl/mDaNcxbFruNbzMDguUrPZp9BnoKSLv2xfc0TnBmVsKWP+4XyT0BbZVJGatSI8l9HZHt43+mto3NdGh9KAnEMZnq+NaoJ+k4a68L9JC/BKsBwczbMm/bUdD6yQADolItMrhN4e5shsMD0HPtLnHPBEqfADvM7lztkBdWW1/8omK13PD0OhJdjety6k8uqHQVhgLtA5KI5KbZek77EHUVWbOu4MyS9GWZt86X94AvEettQ== 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=XOGV9A0CNTML9/QO2UOtFg53JA99YHtLU27ff02QSYw=; b=LWe2YKEA8iTPC68C0XtDbCgj9uxuhjTcznZaCuA3HPxG+9YAm2Q7IiBa7Xyj88N7Wr3R/v7PAchLd1NCSb3fxsRcoypaBiko79awJkAQA/BtzC7d0X3pxCBhmGX7Ei4Og1PAcf2/mfqrT79KsJ1IPDpUrpYJtwYIEH0G0PYILc3HyHgUPGQ/iKiU9LjKVi+FbZQ9xIAr02k05sM6QIGFlRuk2WP3fIoerboW0IYBRmASzm4CR0izomVULmEMukmPS+/rbA1Lq7XVMjSCaSVdaufxfnJlVGc7L76yWAsg/3i2fi9l9W5N0nX7wyJB7l5vFXXFsu3k9oFLapUkXsYXKQ== 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=XOGV9A0CNTML9/QO2UOtFg53JA99YHtLU27ff02QSYw=; b=ekBAw39/f+9OPDt0NWP1O40X6CSZETdjWH6ZarNboljH2j1N1gR2KIIe/FjqjVkKbciR1Nf9QT3eoOXpow+u6BJnEyVrF52QaIHfV/x6OUAOq5Pztvm/ydcGWnRMdkd4SPwQY/IF5YbmdXJQRXkfvL/8M3CgyuHLxhSiVbugVGk= 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:51 +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:51 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Simon Glass , Tom Rini , Rasmus Villemoes Subject: [PATCH 4/5] lib/vsprintf.c: remove unused ip6_addr_string() Date: Thu, 20 May 2021 12:05:27 +0200 Message-Id: <20210520100528.322846-5-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> 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:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3c6d355-b262-40c7-b6a2-08d91b76d90a X-MS-TrafficTypeDiagnostic: AM9PR10MB4310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GiBShxtG796TiyygdXU0Q3k89hQybj2JS5AXeeE9tfdiriafB87q7RWbkjEYCUflJF5ehmW1cToeiLwEpMTP8gCDypGX9BEaGjA0ZBAbpfmMagD6Yj0U/1e+F+e7wGjHzXIF+q+04o2+Fj6xcRH7nayst0vM0j0+Dv9FNZgdKKqbNFrXYPz63V16ePO49tXLefZx5dpRyq4jqQZbxPKNbENrGJZMLMrOPZNJrKvgbKfnuUke213xkU5gLEOgZ9fSfIRphx3TMyYcmLCAhfbXWc3QnEccG4gt9pTm5mNaCbVALJTP7Bx7SHmaaKwbppPc/kTNiPIcm8bmwaWWf3n0HSrt+W8SHWGy2c7wffqAMREnc715U4iG/lctMfMFd1vrRrXh0Vy/7SrFC5/oEGuGuucT/kOO+SALr2nwZ+mZ/sd1GGDccJUHY9LOUzYfR9YB8bsbSrMbJS6mpGDyF1e+rA4KAWaGGHP3GP0yD5mbRVd16XmH+8qvXvvNEO/Q2TLooBwV0WdQZkDlfcWVknsaAMPkq29D9AHKFJR5cpPr8orIh9zCnmzwNl5yJ/w1ad1ar2MNCv4bh21/zsdN6HnDEQhseWbURwQI5crJ2L0kth+ccFsLcZwZ98sw6JONwevErqw9mSN9BfIbYvtW/Am509jmC3D9w8rmi1K+oQ/kwm8= 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)(6916009)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: YtQAcKBgRSGVBP9rK+3g7h13Q5iYlBJgb1XifvsI3lM+BiNIQdh87+ygTgEUzHbrnBTFG/G+dlwdeT6x3RDa4OLpwRZmn03vLvQOzaN0hGZqcSVsm5Z7e4p4VUOvdfMoYCNZ4AZp7Sux4H9VESRQ8OKJxJV61Lu1mZq7nxV+JDjJ8todGaAJGgx3YTzIU0Wu0Xdn9D22UEMWt3cxeGrcpPS0EQ9Z349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Ftq4I/IQLr5MNaCzQvaEqjkvMBW4T9BKCCX5PrxHc4TIZ1Y X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: a3c6d355-b262-40c7-b6a2-08d91b76d90a 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:51.3883 (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: gMfuR2XIzqap3Dw9HqLyvfaQiTBe1Z+RMVD4l7YWpNDLbUjbR67FqE3hxagkLj4JM1AwHALk9cRMunSRfPsjK4JYTOWMP11CCtC5BFZLD+Q= 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 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.4 at phobos.denx.de X-Virus-Status: Clean There's currently no user of %p[iI]6, so including ip6_addr_string() in the image is a waste of bytes. It's easy enough to have the compiler elide it without removing the code completely. The closest I can find to anybody "handling" ipv6 in U-Boot currently is in efi_net.c which does if (ipv6) { ret = EFI_UNSUPPORTED; As indicated in the comment, it can easily be put back, but preferably under a config knob. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass --- lib/vsprintf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 65d985982d..6742b0985a 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -434,6 +434,9 @@ static char *uuid_string(char *buf, char *end, u8 *addr, int field_width, * - 'i' [46] for 'raw' IPv4/IPv6 addresses, IPv6 omits the colons, IPv4 is * currently the same * + * Note: IPv6 support is currently if(0)'ed out. If you ever need + * %pI6, please add an IPV6 Kconfig knob, make your code select or + * depend on that, and change the 0 below to CONFIG_IS_ENABLED(IPV6). */ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field_width, int precision, int flags) @@ -478,7 +481,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, flags |= SPECIAL; /* Fallthrough */ case 'I': - if (fmt[1] == '6') + if (0 && fmt[1] == '6') return ip6_addr_string(buf, end, ptr, field_width, precision, flags); if (fmt[1] == '4') From patchwork Thu May 20 10:05:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1481476 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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=CVMqawR/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fm54H39dpz9sRf for ; Thu, 20 May 2021 20:06:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5AE2482E36; Thu, 20 May 2021 12:06:10 +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="CVMqawR/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DDD8B82D36; Thu, 20 May 2021 12:06:00 +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 EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0705.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::705]) (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 65BA982D1B for ; Thu, 20 May 2021 12:05:53 +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=fYy9xWUKRRi7MhYUSYg+FGjjvJjgvxaOt48OLkEtWjAcSskch9qu1sjkXKpko9qb39QarBWri2+0+c3IWv6dJKKNK538VirwZgRycRi8lrXdqqUHNE48OjQ/YekpMZxk8vkxUdEAKRqrlZxAbvWTRtNpw0wYlx6gKFsK3DFdAfZ4COaNpo2QQ6+7bWjD9onooZU6k88hhua9a9v50KM07pXpOZ7R6sJjXq7D+vPZE/GOFU74h+4T+P0zz73XVL+nq5SZPS1BufjkNiK/DJz3kHO0Hr1g4DEl3MyxAPmCZsHMwBPgbOlLoMJ11YD+MVLXtsEi0LwZJru3xsGy3lXBrA== 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=IsRu6WtnihyB++ebNW28UaRFquxNAF4bsFpS/bItQnU=; b=AIPhA5KtroghG3fOMwjocRPJCLs3YTUhxCNcu5JWc5XpQJDNkb8coH9m2pC5N4GDo7sUZ1AZKEKV9te6QCD3f7n/pPixn9hiIcS9CBhJaneEALedD52RrQYRVhWvPiJKtsNyvmksNdDglDoTOIaa4JYTmkfDu8ENmcOdRKLjp/OEfvFtaHDS9APMgDVtBVk7tqlxThSYlgsN0opLPR4HLSnkb2HYXuuSVlOh0VG6T60hTaDrAoJ9GqE67gII6XI3dF5+ewJ6KCjCJ4BgVoHBfs86mVA+36CpeuBKHMVLrshjVMGI5VdTR1oeGhGwG8B34QyPaMI8e0dcXuhypDg9tA== 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=IsRu6WtnihyB++ebNW28UaRFquxNAF4bsFpS/bItQnU=; b=CVMqawR/z/4hnOcILJul68hICmIs1Bdi3YW/3/XT+pEHvZrc54rpB8OYqm2By4ObgPEehYLgvqdYvljVvQZB/kltfS1JnfXhr8mOVQs0s+zUk8fKBGBKDnk/GOrF/aKX5BZd6pz+izVle8Wl/VVov/ki5ZrpM0ytvCOZ3JHESRs= 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 AM0PR10MB2417.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:d5::25) 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:52 +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:52 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Simon Glass , Tom Rini , Rasmus Villemoes Subject: [PATCH 5/5] common/log.c: use vscnprintf() in log_dispatch() Date: Thu, 20 May 2021 12:05:28 +0200 Message-Id: <20210520100528.322846-6-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> 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:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb437b61-28b8-4ede-a5ad-08d91b76d9c0 X-MS-TrafficTypeDiagnostic: AM0PR10MB2417: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lCKPr3Y2NvK2xYV2ch6iFJmsz1Vh4HR52g3rf9OcOXOFsHcM/9Jnt8OkmLZBl8ovHh4/uJIrjov7EmuhTA7yKSMs/9oBzGxzT30eL1Pet0DZrzHc9A0wOhQXdDL54HsxLCa69t3EhXQLecxMAen4+sTQg0pE035prciPy/LUTL5AIZ+bJ+e05nNofFzyWZUMxuHKAG7q0hAvcwl+mmrjWn6TilKVnLVg/hjb8H3BuCECrspvCGkFT0s9nCAe5pDRl0Qsqbe3rYW8NvfIOoTaGhgb2SSfend1oly12whxaQ2L/kMjHncIGEFhAU6IUsjMyD/b/xbDhL1NdY1ZssvpxB9T52AYYIS26mEAXZqEfAVCPR2jJ/6bZ10nEMGLdzKE3zRikQ2HGoACR02CX9XVNZZ8ywdHFDMsDfuZol5VpJlZWCaE38Ge/fKQJgOik9cpH+WAb7SPtTDfNSHSAiEBGzGdvKUFsr+dhq7mi2hadx2z63vbaMPrUui5GFBkeeyrXyV12ElIB4JhTiM2Kt/LmAAXRIC+GwU2G2JNxOQD9/FhasSR2zE7GFHAlzCrZ3pZtUTJp7Awp9l72wvM5v8OzyJ8LoLw8lbKIXwSAZPhVXbY8rXSR8H3VKYT3W32saUKaaI88x4dvWDRBr0GgeePQ/4uU/ao9n/Uew6y6LGVQSg= 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:(346002)(39850400004)(396003)(376002)(136003)(366004)(478600001)(38100700002)(52116002)(38350700002)(6666004)(956004)(6506007)(5660300002)(6486002)(2616005)(4744005)(26005)(86362001)(44832011)(6916009)(107886003)(1076003)(36756003)(66946007)(54906003)(316002)(6512007)(2906002)(4326008)(83380400001)(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xLsrvP8PHXBclLJIZejCDm7IauB5/YGBpTGvUgMEP70lVDHNxoYR7U4JrQfjlBhVznyhyVr+XcCqaHr5gDN5zGQsQ0LnFAMP9s5JnIo5kVsVGUbw6t3gFmXp11TkXkbxNHB8qvL4DJ3ryPkBHtxWT9Ci6Wn0EGinZo96tHMQMF0ztX69HH+ENOgEVA6LD+HMdVw9/uYinEh4L8Y1uTAtcRb3PhYJDOhd7cCbmNKnW/DeLqHhVm/SvTtpLD49fTwcgQvkth4HrDuWlda0CkApCU18RW7EKwdXeuv+31QHmCpyWcGXo6O7xKavzeZ6BKHNcmUjgGrkX7cA39hwqERvFBUgcgGR X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: bb437b61-28b8-4ede-a5ad-08d91b76d9c0 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:52.5526 (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: kbswh/lA74kwBqCZynSmgtSFl0ajjsWbMHCxAjOlY0B2d6j1mCz+p10QYo1+cV6LYdvO3gq5fXAwfoEcmT4CYnBE8LnzZI55D0NXjzxlqJ4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB2417 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.4 at phobos.denx.de X-Virus-Status: Clean We have to use the *printf variant which returns the strlen() of the resulting string, not the how-much-would-have-been-printed-given-enough-space, in order to use that value to inspect the last character in the string. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass --- common/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/log.c b/common/log.c index ea407c6db9..cba8df5caa 100644 --- a/common/log.c +++ b/common/log.c @@ -220,7 +220,7 @@ static int log_dispatch(struct log_rec *rec, const char *fmt, va_list args) if (!rec->msg) { int len; - len = vsnprintf(buf, sizeof(buf), fmt, args); + len = vscnprintf(buf, sizeof(buf), fmt, args); rec->msg = buf; gd->log_cont = len && buf[len - 1] != '\n'; }