Message ID | 20200501145516.18168-3-rasmus.villemoes@prevas.dk |
---|---|
State | Deferred |
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; dmarc=none (p=none dis=none) header.from=prevas.dk 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=QPMKt7jf; 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 49DFgf3kqzz9sRY for <incoming@patchwork.ozlabs.org>; Sat, 2 May 2020 00:56:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 31F638229D; Fri, 1 May 2020 16:55:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none 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="QPMKt7jf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC0C382296; Fri, 1 May 2020 16:55:33 +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,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0727.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::727]) (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 4EFAA8225E for <u-boot@lists.denx.de>; Fri, 1 May 2020 16:55:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none 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=i4bhYfruv1YFr0D3tDLfoliBBVORAyVrFr7XwnzVmOM3vIE7FZak59eWRlNpY2sXUxBKOC6LNjhotsJgBPiMV4f3AagQG/SrbPrqQ/j6j3FWgK7TWIbzNsoIrRZ/9+KgUEENlmZA2fkOy+x8EHyJmCpOJaCczR93grkYbqCi76D1UE3xkaDMCjDJcPkOpl85j9dkXzOrVn+LUVKMm1oZ/zjHVB6770jZAJQhJdawAPKj8zh/TISrcY1QdrNc15LfNlFsJZT4Vb/uf4kLtQDWRenfT2jgHRxMRarGqHLtKA6KSnCe2It+a61NU+U8SxQSW2BWHXvhYb1YivB17PrVvA== 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=qq2Iyc0vNisL2gqY3fx45cayTj6jISGr2rbvh9z5A4Y=; b=i07E7Pik7M5mTybZBJJXnFC76BOAvrWY2iwQTIO9QQbXPeSc1EcuuID0d2ke2hqWs4M2nM2aMxjXBwytRtWR9dACEiyd7F2TfIdDDUBKDp2RCTUUMt1XV1LXzoFzk6KqKRlEdCY2KjEgcZaDvxgd8jIreruv+mjURTmiBSGyss6XQ8Z3nMymkvPPsPkCLUBZW13qFB3nSW17utcea7wUMvDTuKLgD45Kw88vGW9VvY7URX1r+n9GB19Wy6bjZn+SNV/3LZjstbFPfWnuj8UtAmTsyCIw5WX5w/vG5meIoZzvWDn2PZhxF0zMCevVMRjBGSAVKdPz5OI3vhkPwtdH6w== 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=qq2Iyc0vNisL2gqY3fx45cayTj6jISGr2rbvh9z5A4Y=; b=QPMKt7jfd6DMsj2ewt3Xg4APri7Y6VqjKtRkXBD7ECCnLDR0tL7Qnkftjm1m1qMQwAivq216glz9389Sadn52c7/f0YEXJzqTdwI+Qyhpj9XgJOdgJztp6PfWYnYytz/alKtY8juWdfYcRPrIayS9sjwVcrpZKU27Afb8FsB2Is= 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 VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e1::21) by VI1PR10MB1967.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:32::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Fri, 1 May 2020 14:55:27 +0000 Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM ([fe80::f0ac:4e97:2536:faa]) by VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM ([fe80::f0ac:4e97:2536:faa%7]) with mapi id 15.20.2958.020; Fri, 1 May 2020 14:55:27 +0000 From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> To: u-boot@lists.denx.de Cc: Simon Glass <sjg@chromium.org>, Mario Six <mario.six@gdsys.cc>, Bin Meng <bmeng.cn@gmail.com>, Urja Rannikko <urjaman@gmail.com>, Rasmus Villemoes <rasmus.villemoes@prevas.dk> Subject: [PATCH 2/5] sysreset: mpc83xx: shuffle newline logic in mpc83xx_sysreset_get_status Date: Fri, 1 May 2020 16:55:13 +0200 Message-Id: <20200501145516.18168-3-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200501145516.18168-1-rasmus.villemoes@prevas.dk> References: <20200501145516.18168-1-rasmus.villemoes@prevas.dk> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM6PR0502CA0065.eurprd05.prod.outlook.com (2603:10a6:20b:56::42) To VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e1::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.116.45) by AM6PR0502CA0065.eurprd05.prod.outlook.com (2603:10a6:20b:56::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Fri, 1 May 2020 14:55:26 +0000 X-Mailer: git-send-email 2.23.0 X-Originating-IP: [5.186.116.45] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36d88cea-783b-4e5f-ad36-08d7eddfaf73 X-MS-TrafficTypeDiagnostic: VI1PR10MB1967: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <VI1PR10MB1967BE7988F71DDDB4D84A2393AB0@VI1PR10MB1967.EURPRD10.PROD.OUTLOOK.COM> X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-Forefront-PRVS: 0390DB4BDA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /6A9pWOH6u468cHsC3S6HxO1yq6ILePYsFFZV+ndgscn+9IBrebe0JjSfz9ONuCKsAunIe1RoxeT3h1P2jfpeX6aCduVfID/mFQDnF3dU92OZwHzUNERhqC8dbP61ZXIxqjXvK4vsjqjnNbelPVbD3QEq/hNl/EuZG0S9KQEWqRrlmYR/QreSL3GaBAMyKWAN3H4WSjPXHUIlvKb4BAOCsKF73VpWynH6adDSZdIJdJV8z8Gmtd//7n/QPaeP0ZFnn8oS2KuVbOUaZgw94SXMRub+EGJhpNN/vNnvSg3YZa1weJQtUrQ8qZhDKbPF2ClD91qlWygDL2iLxnKN0UpNSHt9Jx5Lfj5oDRGl/at51MF2aZvsV7XfvXA5RNXeb6fEEAKrgcE7ayHoGX+/aDeiSLtQhoDj2W7ZK74Hbgcq/3tY5KTScYOMj3nLAV2EMZC X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(39840400004)(136003)(346002)(366004)(52116002)(66946007)(8676002)(66556008)(66476007)(26005)(186003)(6486002)(6666004)(16526019)(316002)(6506007)(2906002)(54906003)(86362001)(107886003)(6916009)(8976002)(8936002)(4326008)(6512007)(478600001)(2616005)(44832011)(1076003)(36756003)(956004)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: wk7GzmTP6o0OsfyV0iLYyTpXUwIjWeBWgqrRNkr4K06cwGiihJwTFtYZ6EVgC7ZNe2Fw4geXI0GnQPmTqej2PvEF2/ywurQLREljX6UUPjTEKZ3S46YoR9HsvNYu4mP4u9gQr7DeRe/MLSbM6+gC4wT5C+X6Hpk+TrGs72miWvuIxkjch3GGn1nofaXlAiqKBr4OLas3UUE6LAY/FluB5Df11qO46Mrg6zNdVceJlTNVdC0C8bNXmhh+PJzHppAIldCPS1Hzu+g1t5E4bpLpsZxMzAUrnqB+5j9s0Bil4HiQwWGtx64lAKf4+8rQR/CqWuA+BmG+ongogKlt/i9Qf/d0Y5jJcl+0oF3cCyK60eKCIaFAfT633CyB/M0heSLYwaHvwkmRG9NLZTWBbWlqJaHUzyox53LwA88Gx2a7NSglvDrp1ndk1VlcLNJlYvEMDuke9gPxR8Z1QL5lgONZVCaGxsp2A9OUWghOtBMIPtOW1gDiLH8tlZeq2Rd+b2DA/cKEjorNw4Q2+twQbnpdFfHE7naOixhuTJe0w7UnzK/2mpKwbUTmuNsINIJJnhQ9t+4KBBxEfg5sVCafX/suvXU0Asxjep2f9MLZx78SD/cyHSbvWPyF/9oPGjMnqdCZK083hk/wKMOkofcMKFLzcomwSFSU5juu0jeMVDJsp7wAFr0wCrmKoikSEbc4jsMEAPaZd+koqX05u8MW9SVHKBdmVtvBi0fqb7QgNsoKDkHipWqYgJamGKbeK/tj4cQoTf/vLsWfXyIAHEEsNUNPx8/a+ueTWl6KMTMukp+ioj8= X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 36d88cea-783b-4e5f-ad36-08d7eddfaf73 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2020 14:55:27.5067 (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: i896Y+gz2SmDnS8f24OeSfSlZ1QsatXdofQZMc17MOwl/+UKRf/hAHFIYhjohqHb0IQCvxNQO1FIBABKSIz7JaMzw4xWNGbhDrlQPU0opUY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB1967 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
some sysreset patches (mostly for mpc83xx)
|
expand
|
diff --git a/drivers/sysreset/sysreset_mpc83xx.c b/drivers/sysreset/sysreset_mpc83xx.c index 7148464d8b..3447b8e75c 100644 --- a/drivers/sysreset/sysreset_mpc83xx.c +++ b/drivers/sysreset/sysreset_mpc83xx.c @@ -158,13 +158,16 @@ static int mpc83xx_sysreset_get_status(struct udevice *dev, char *buf, int size) for (i = 0; i < ARRAY_SIZE(bits); i++) /* Print description of set bits */ if (rsr & bits[i].mask) { - res = scnprintf(buf, size, "%s%s%s", sep, bits[i].desc, - (i == ARRAY_SIZE(bits) - 1) ? "\n" : ""); + res = scnprintf(buf, size, "%s%s", sep, bits[i].desc); buf += res; size -= res; sep = ", "; } + res = scnprintf(buf, size, "\n"); + buf += res; + size -= res; + /* * TODO(mario.six@gdsys.cc): Move this into a dedicated * arbiter driver @@ -179,7 +182,6 @@ static int mpc83xx_sysreset_get_status(struct udevice *dev, char *buf, int size) buf += res; size -= res; } - scnprintf(buf, size, "\n"); return 0; }
mpc83xx_sysreset_get_status() adds a newline to the buffer at the end of the function. There's no point adding a newline in case the reset status word happens to contain the RSR_HRS bit. On the other hand, if one of the CONFIG_DISPLAY_AER_* options is enabled, and the RSR_HSR bit wasn't set, we'd miss a newline before the print_83xx_arb_event() output. That latter always includes a newline in its output, so just pull up the scnprintf("\n") a bit. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> --- drivers/sysreset/sysreset_mpc83xx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)