From nobody Thu Nov 6 16:03:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489431047702523.6599786561686; Mon, 13 Mar 2017 11:50:47 -0700 (PDT) Received: from localhost ([::1]:53864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnV3O-0002o5-Cw for importer@patchew.org; Mon, 13 Mar 2017 14:50:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnV13-0001aL-DB for qemu-devel@nongnu.org; Mon, 13 Mar 2017 14:48:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnV0z-0004o0-HV for qemu-devel@nongnu.org; Mon, 13 Mar 2017 14:48:21 -0400 Received: from mail.kernel.org ([198.145.29.136]:56006) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnV0x-0004lT-Hl; Mon, 13 Mar 2017 14:48:15 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8051020260; Mon, 13 Mar 2017 18:48:13 +0000 (UTC) Received: from localhost.localdomain (bzq-79-180-56-222.red.bezeqint.net [79.180.56.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39C9620263; Mon, 13 Mar 2017 18:48:08 +0000 (UTC) From: Krzysztof Kozlowski To: Igor Mitsyanko , Peter Maydell , Paolo Bonzini , qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Mon, 13 Mar 2017 20:47:49 +0200 Message-Id: <20170313184750.429-3-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170313184750.429-1-krzk@kernel.org> References: <20170313184750.429-1-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PATCH v3 2/3] hw/char/exynos4210_uart: Constify static array and few arguments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Krzysztof Kozlowski Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The static array exynos4210_uart_regs with register values is not modified so it can be made const. Few other functions accept driver or uart state as an argument but they do not change it and do not cast it so this can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski --- hw/char/exynos4210_uart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index b75f28d473bf..bff706ab3a68 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -102,7 +102,7 @@ typedef struct Exynos4210UartReg { uint32_t reset_value; } Exynos4210UartReg; =20 -static Exynos4210UartReg exynos4210_uart_regs[] =3D { +static const Exynos4210UartReg exynos4210_uart_regs[] =3D { {"ULCON", ULCON, 0x00000000}, {"UCON", UCON, 0x00003000}, {"UFCON", UFCON, 0x00000000}, @@ -220,7 +220,7 @@ static uint8_t fifo_retrieve(Exynos4210UartFIFO *q) return ret; } =20 -static int fifo_elements_number(Exynos4210UartFIFO *q) +static int fifo_elements_number(const Exynos4210UartFIFO *q) { if (q->sp < q->rp) { return q->size - q->rp + q->sp; @@ -229,7 +229,7 @@ static int fifo_elements_number(Exynos4210UartFIFO *q) return q->sp - q->rp; } =20 -static int fifo_empty_elements_number(Exynos4210UartFIFO *q) +static int fifo_empty_elements_number(const Exynos4210UartFIFO *q) { return q->size - fifo_elements_number(q); } @@ -245,7 +245,7 @@ static void fifo_reset(Exynos4210UartFIFO *q) q->rp =3D 0; } =20 -static uint32_t exynos4210_uart_Tx_FIFO_trigger_level(Exynos4210UartState = *s) +static uint32_t exynos4210_uart_Tx_FIFO_trigger_level(const Exynos4210Uart= State *s) { uint32_t level =3D 0; uint32_t reg; --=20 2.9.3