From patchwork Sat May 29 19:54:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1485411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=vKxd9ro9; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=GP/xrf8d; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4Fsshw4NPfz9sVb for ; Sun, 30 May 2021 05:54:54 +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=/K2iGTP0UaOrJUH/2iSwuuIm5QkgOYdranj3jnNQJ9Y=; b=vKxd9ro99di8jC 3WX8t0kM/qbSVsGPHkFcHHVhHiwMAtIsgHD9AuSQWmfE2Zqig9X7TCqfAigfRo4DxMyaDm+FyfZ60 24D3ArqzylBUxC+nsSjqlx+AUyh+jzqixcceVldQIS0rAFw7H01bzCcYpM+zsbl3BxiWVK41Xa5Vu EUfU5gspLAQhgMaFpXlRkNhDMYoptryOBsqeRwqaRzJAuTGmTddykk6z1Q/DrFpwEvL2GYmnNW6Cj gzhIqcs/3djOrOUBPKLUMahoUS8lB5tBeHGik1JImrTu1vJKlLKv4TYAE7Qul+Kd/zQjttYGHLoIm xmW5ahTKZcPL/raWQwfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ln52j-008GV8-D5; Sat, 29 May 2021 19:54:45 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ln52h-008GUf-0x for opensbi@lists.infradead.org; Sat, 29 May 2021 19:54:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1622318075; bh=G9gMOBdu8Lx1rp8En4c4eFB10O0gIbneJO6MJoyQCEk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=GP/xrf8d/kVl5rS0BjroKzVcVjEuU0omCP6Wc4rsns9JtTVz32UQ3OgtQd2nsPbQC g+yuJ26aUQ7ettGsq5Ip75EPiBBhTaJ2pgoiYZXhg2Lhk54OcQadkmChk2cGCPcWRU 83DGsDkZ/FTpP42mqbS26ygAQKb6HFq5X8uEc67Q= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([62.143.247.63]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MAOJV-1lgECn3byd-00Bpqg; Sat, 29 May 2021 21:54:34 +0200 From: Heinrich Schuchardt To: OpenSBI Cc: Anup Patel , Atish Kumar Patra , Heinrich Schuchardt Subject: [PATCH 1/1] lib: sbi_scratch: remove owner from sbi_scratch_alloc_offset Date: Sat, 29 May 2021 21:54:29 +0200 Message-Id: <20210529195429.7707-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:SIti5JnuGJD8K7amjiIW0HkaH1oqg0W+Wnp5IvA5WZYEPZT/ZzJ nRTuu1eP4fz7HDO8hfG96TdbpA4M45QmrF1VVN6VCl/FlUs89kAFm+htFpm6tzJ0eDqP4tP dGa6tUT/iUIH2e4LneS9B+s3wCfvBBVFCOmgUDGmj1c5dUZDcMm4CAEApHoabK+uvPnp91v rqD8n40B3dGH2MNYN2iSQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:OHLGd7i6WlM=:i6LvByR8K2v5d/6tisaofI hgMTMvJ26ka+Ez278hCXREMI6tBYSOlR1WF/fLHeIw2aAkKnsSi6Ls5jBx87ge9VWhITyij96 VZZwxlz6FL9oQVTvuW+gvGYGscfTV4wJi2zofEyKZASVvSC5I9BpwYRvXpxpRudfvrbEmoEQB 37H7oUsQ70VpdJnUHn5OzzZ6/MSYtAMeBhb6tUnxVB+bXGTHvEnKiD0S7ZpQ5yu93tZ63IobT ec3eoV1cIhZxQ4rf72NvSQrO4pTpPNMKFN9IaoEmak8mHpobhbTiWiP2gw9ipyB1hnlV1oNr+ YkSvvqw89d1d3+5ERMh7EArA5E+GmrF4FSarc4W68g1e6G7tp+YIxzdmPr32NCwh92HmgWIqV PoO5vrqv8/vp+c+Y5IxKxXMXnv/skk5rFt9br9sYLw3QC5SmRqxf2kPVjpTLMnPU54HKSI6hu swYtewDbwHpDAcLY/UMwT7lAUWER87M1YaoaZVC/87zvRK8IYyxVsWxaF5ZO+g8HDW6aAo7FP DPk9um8i82yQAF+l1M6R9ka/5oUawXHO+/5Hd2iO8tZKqSvt2k9OXiAqxprjADV9NTywagISI 6gKq4cZkD/fu437TOJtRXC0xOrjB4CnEZFQ5ztYfpLnCkLN/R67vawCjTUa+Tv7mmjdLnki7q +uGi/pvidg8+jOZb9qwDODvq3sH3QG6peJ3773vFbEGz7z6yW0IXCDJT7YGipEM8+FEgIU25l aN1zIPzAMwKWFc5ziSfJQXerXEYDPi/lpmGmDp3Gqzwo8XQA44/vKsppTDkxe2gU/qufFiBkG zPjsyqvdU9XvyCdiQSQuqceeyGUOFQ0RVT85GuEcrkBkR3tjtTWHJyMaG1KdKzY93aUyEe5GW RnwEEKFX0oYMtjtnSNglP3IZfxCbgACLQ2F7c15b3udiEoYHant7TO11259H2GOBBGMtxMsGh LVm5YG+/sBwMgT6VQYOo9KoUxMxidDDnASzZhdbrZJWilbuc2cfZAd85PxBA9iGxzNCA7f80E 9uHddCcY1gmvUMLidLv9vWZuSfhUmgqp4tB+nyQJnYo6p1brQikOh7cEpXt2uTOFwL0zPt2SC EiGEM0NfGOBBkfkxwg+JaSTBpptABKqU63VqVa15scKCz8cMsgXV0zRhPg1YGB6pOSobAxDTr RaPxC/PL3+bXGUW8LlQ7cPHXkx6c0j7NgSq19Jx8Nzp16pK+kGD5YRSuP5XyucOYerpac= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210529_125443_427687_E54F726A X-CRM114-Status: GOOD ( 10.31 ) X-Spam-Score: 0.0 (/) 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: The parameter owner of function sbi_scratch_alloc_offset() is never used. The scratch memory is small. We should not use it for debug information in future. Hence eliminate the parameter. Signed-off-by: Heinrich Schuchardt --- include/sbi/sbi_scratch.h | 2 +- lib/sbi/sbi_hart.c | 3 +-- lib/sbi/sbi_hsm.c | 3 +-- lib/sbi/sbi_init.c | 3 +-- lib/sbi/sbi_ipi.c | 3 +-- lib/sbi/sbi_scratch. [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.15.15 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [xypron.glpk[at]gmx.de] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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 The parameter owner of function sbi_scratch_alloc_offset() is never used. The scratch memory is small. We should not use it for debug information in future. Hence eliminate the parameter. Signed-off-by: Heinrich Schuchardt Reviewed-by: Xiang W Reviewed-by: Anup Patel --- include/sbi/sbi_scratch.h | 2 +- lib/sbi/sbi_hart.c | 3 +-- lib/sbi/sbi_hsm.c | 3 +-- lib/sbi/sbi_init.c | 3 +-- lib/sbi/sbi_ipi.c | 3 +-- lib/sbi/sbi_scratch.c | 2 +- lib/sbi/sbi_timer.c | 3 +-- lib/sbi/sbi_tlb.c | 9 +++------ 8 files changed, 10 insertions(+), 18 deletions(-) -- 2.30.2 diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h index e83b234..186a40c 100644 --- a/include/sbi/sbi_scratch.h +++ b/include/sbi/sbi_scratch.h @@ -98,7 +98,7 @@ int sbi_scratch_init(struct sbi_scratch *scratch); * @return zero on failure and non-zero (>= SBI_SCRATCH_EXTRA_SPACE_OFFSET) * on success */ -unsigned long sbi_scratch_alloc_offset(unsigned long size, const char *owner); +unsigned long sbi_scratch_alloc_offset(unsigned long size); /** Free-up extra space in sbi_scratch */ void sbi_scratch_free_offset(unsigned long offset); diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index de59b14..56878b4 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -451,8 +451,7 @@ int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot) sbi_hart_expected_trap = &__sbi_expected_trap_hext; hart_features_offset = sbi_scratch_alloc_offset( - sizeof(struct hart_features), - "HART_FEATURES"); + sizeof(struct hart_features)); if (!hart_features_offset) return SBI_ENOMEM; } diff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c index 4662150..67890f3 100644 --- a/lib/sbi/sbi_hsm.c +++ b/lib/sbi/sbi_hsm.c @@ -185,8 +185,7 @@ int sbi_hsm_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot) struct sbi_hsm_data *hdata; if (cold_boot) { - hart_data_offset = sbi_scratch_alloc_offset(sizeof(*hdata), - "HART_DATA"); + hart_data_offset = sbi_scratch_alloc_offset(sizeof(*hdata)); if (!hart_data_offset) return SBI_ENOMEM; diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index 3f44a2b..b158314 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -233,8 +233,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) if (rc) sbi_hart_hang(); - init_count_offset = sbi_scratch_alloc_offset(__SIZEOF_POINTER__, - "INIT_COUNT"); + init_count_offset = sbi_scratch_alloc_offset(__SIZEOF_POINTER__); if (!init_count_offset) sbi_hart_hang(); diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index bfaf4e9..75f86d8 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -227,8 +227,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) struct sbi_ipi_data *ipi_data; if (cold_boot) { - ipi_data_off = sbi_scratch_alloc_offset(sizeof(*ipi_data), - "IPI_DATA"); + ipi_data_off = sbi_scratch_alloc_offset(sizeof(*ipi_data)); if (!ipi_data_off) return SBI_ENOMEM; ret = sbi_ipi_event_create(&ipi_smode_ops); diff --git a/lib/sbi/sbi_scratch.c b/lib/sbi/sbi_scratch.c index 96bae5b..7cf5b43 100644 --- a/lib/sbi/sbi_scratch.c +++ b/lib/sbi/sbi_scratch.c @@ -40,7 +40,7 @@ int sbi_scratch_init(struct sbi_scratch *scratch) return 0; } -unsigned long sbi_scratch_alloc_offset(unsigned long size, const char *owner) +unsigned long sbi_scratch_alloc_offset(unsigned long size) { u32 i; void *ptr; diff --git a/lib/sbi/sbi_timer.c b/lib/sbi/sbi_timer.c index 63e8ea9..77d6f95 100644 --- a/lib/sbi/sbi_timer.c +++ b/lib/sbi/sbi_timer.c @@ -121,8 +121,7 @@ int sbi_timer_init(struct sbi_scratch *scratch, bool cold_boot) const struct sbi_platform *plat = sbi_platform_ptr(scratch); if (cold_boot) { - time_delta_off = sbi_scratch_alloc_offset(sizeof(*time_delta), - "TIME_DELTA"); + time_delta_off = sbi_scratch_alloc_offset(sizeof(*time_delta)); if (!time_delta_off) return SBI_ENOMEM; diff --git a/lib/sbi/sbi_tlb.c b/lib/sbi/sbi_tlb.c index 73f59e8..2ba1b7b 100644 --- a/lib/sbi/sbi_tlb.c +++ b/lib/sbi/sbi_tlb.c @@ -380,19 +380,16 @@ int sbi_tlb_init(struct sbi_scratch *scratch, bool cold_boot) const struct sbi_platform *plat = sbi_platform_ptr(scratch); if (cold_boot) { - tlb_sync_off = sbi_scratch_alloc_offset(sizeof(*tlb_sync), - "IPI_TLB_SYNC"); + tlb_sync_off = sbi_scratch_alloc_offset(sizeof(*tlb_sync)); if (!tlb_sync_off) return SBI_ENOMEM; - tlb_fifo_off = sbi_scratch_alloc_offset(sizeof(*tlb_q), - "IPI_TLB_FIFO"); + tlb_fifo_off = sbi_scratch_alloc_offset(sizeof(*tlb_q)); if (!tlb_fifo_off) { sbi_scratch_free_offset(tlb_sync_off); return SBI_ENOMEM; } tlb_fifo_mem_off = sbi_scratch_alloc_offset( - SBI_TLB_FIFO_NUM_ENTRIES * SBI_TLB_INFO_SIZE, - "IPI_TLB_FIFO_MEM"); + SBI_TLB_FIFO_NUM_ENTRIES * SBI_TLB_INFO_SIZE); if (!tlb_fifo_mem_off) { sbi_scratch_free_offset(tlb_fifo_off); sbi_scratch_free_offset(tlb_sync_off);