From patchwork Wed Jul 31 02:58:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Liang X-Patchwork-Id: 1966806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=IYx8WjQ9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYcHw05Wnz1ybV for ; Wed, 31 Jul 2024 12:59:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YrSLVcQICI7c1yof5wZ+liqFF+JC9EhpdkkJKEzCkUQ=; b=IYx8WjQ9U6RdEg uWwUEDKBHxO7sKqXHUDY0HO3sfYp2Rj/wtlp6vlSLUWphb5QUGgtgMDRiNXoFldyddaqXS1VvBlOj fkJx4RMuqnf6HTLlUyhw3yyYJgONWO5Yg+bim2GlGTpmoaZKs/Myiw6uPfh63iOClTJH3TkSRY+nu RH1AQy/xyQ/+vFaj7zzyH4Soyfpwzhe6a9WLcNf89tKEup3ISbYV+9hxWvzT+ZjIYMOdQjJyvTl0r Vpwh5o4D736urb9XrSerVDAAr+cpEVSm1c+X0MeAed2srZFtbu3747SfkTWjAsERMqbrCAGSd/0zG mEiizeytm4toVF1Lujbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYzYH-0000000H5Kq-21FX; Wed, 31 Jul 2024 02:58:57 +0000 Received: from 60-248-80-70.hinet-ip.hinet.net ([60.248.80.70] helo=Atcsqr.andestech.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYzYC-0000000H5J3-2EeU for opensbi@lists.infradead.org; Wed, 31 Jul 2024 02:58:55 +0000 Received: from mail.andestech.com (ATCPCS34.andestech.com [10.0.1.134]) by Atcsqr.andestech.com with ESMTPS id 46V2wktg071040 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Wed, 31 Jul 2024 10:58:46 +0800 (+08) (envelope-from ycliang@andestech.com) Received: from swlinux02.andestech.com (10.0.15.183) by ATCPCS34.andestech.com (10.0.1.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 31 Jul 2024 10:58:46 +0800 From: Leo Yu-Chi Liang To: CC: , Subject: [PATCH v2, 1/1] util: atcsmu.c: fix typo and coding style Date: Wed, 31 Jul 2024 10:58:41 +0800 Message-ID: <20240731025841.984979-1-ycliang@andestech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.0.15.183] X-ClientProxiedBy: ATCPCS33.andestech.com (10.0.1.100) To ATCPCS34.andestech.com (10.0.1.134) X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 46V2wktg071040 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_195852_874463_56DCB530 X-CRM114-Status: GOOD ( 10.41 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Fix typo "hard -> hart", printf format and if statement coding style. Signed-off-by: Leo Yu-Chi Liang Reviewed-by: Yu Chien Peter Lin --- lib/utils/sys/atcsmu.c | 36 +++++++++++++++++ 1 file changed, 17 [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [60.248.80.70 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [60.248.80.70 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [60.248.80.70 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address 1.0 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Fix typo "hard -> hart", printf format and if statement coding style. Signed-off-by: Leo Yu-Chi Liang Reviewed-by: Yu Chien Peter Lin --- lib/utils/sys/atcsmu.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/utils/sys/atcsmu.c b/lib/utils/sys/atcsmu.c index 8ddd88d5..0472d0f9 100644 --- a/lib/utils/sys/atcsmu.c +++ b/lib/utils/sys/atcsmu.c @@ -15,11 +15,11 @@ inline int smu_set_wakeup_events(struct smu_data *smu, u32 events, u32 hartid) { - if (smu) { - writel(events, (void *)(smu->addr + PCSm_WE_OFFSET(hartid))); - return 0; - } else + if (!smu) return SBI_EINVAL; + + writel(events, (void *)(smu->addr + PCSm_WE_OFFSET(hartid))); + return 0; } inline bool smu_support_sleep_mode(struct smu_data *smu, u32 sleep_mode, @@ -37,17 +37,15 @@ inline bool smu_support_sleep_mode(struct smu_data *smu, u32 sleep_mode, switch (sleep_mode) { case LIGHTSLEEP_MODE: if (EXTRACT_FIELD(pcs_cfg, PCS_CFG_LIGHT_SLEEP) == 0) { - sbi_printf( - "SMU: hart%d (PCS%d) does not support light sleep mode\n", - hartid, hartid + 3); + sbi_printf("SMU: hart%d (PCS%d) does not support light sleep mode\n", + hartid, hartid + 3); return false; } break; case DEEPSLEEP_MODE: if (EXTRACT_FIELD(pcs_cfg, PCS_CFG_DEEP_SLEEP) == 0) { - sbi_printf( - "SMU: hart%d (PCS%d) does not support deep sleep mode\n", - hartid, hartid + 3); + sbi_printf("SMU: hart%d (PCS%d) does not support deep sleep mode\n", + hartid, hartid + 3); return false; } break; @@ -58,11 +56,11 @@ inline bool smu_support_sleep_mode(struct smu_data *smu, u32 sleep_mode, inline int smu_set_command(struct smu_data *smu, u32 pcs_ctl, u32 hartid) { - if (smu) { - writel(pcs_ctl, (void *)(smu->addr + PCSm_CTL_OFFSET(hartid))); - return 0; - } else + if (!smu) return SBI_EINVAL; + + writel(pcs_ctl, (void *)(smu->addr + PCSm_CTL_OFFSET(hartid))); + return 0; } inline int smu_set_reset_vector(struct smu_data *smu, ulong wakeup_addr, @@ -83,10 +81,10 @@ inline int smu_set_reset_vector(struct smu_data *smu, ulong wakeup_addr, reset_vector = ((u64)vec_hi << 32) | vec_lo; if (reset_vector != (u64)wakeup_addr) { - sbi_printf( - "hard%d (PCS%d): Failed to program the reset vector.\n", - hartid, hartid + 3); + sbi_printf("hart%d (PCS%d): Failed to program the reset vector.\n", + hartid, hartid + 3); return SBI_EFAIL; - } else - return 0; + } + + return 0; }