From nobody Fri Dec 19 07:31:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF10BC5ACB3 for ; Tue, 21 Nov 2023 09:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232065AbjKUJXk (ORCPT ); Tue, 21 Nov 2023 04:23:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232964AbjKUJXV (ORCPT ); Tue, 21 Nov 2023 04:23:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 449081BC for ; Tue, 21 Nov 2023 01:23:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E493C433C7; Tue, 21 Nov 2023 09:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700558596; bh=Y5i+1euxXI4UCUqQ8X+2VuZ/t15K0hpOycDIDgEeERI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IH+7wSj9QouOREWdasm6QA3mhk9WhQXzBt0Q8x2nYkUJMCp92n6GV3It3p5TDM9RP YRzbU4o3CIcfbsVm6Z65o4m6XtIPzBbIKIWDZfMDyE7zAqnEAkPdvp8iF9ic5Cbhqf aZKZGqZjt9j/W6KMV+S9+Q1++LngSBSOz9VZiysDM6KhCYJ2OgAUJGRsVWO/1EP4ch pwwPnTBJoiu2M+AnPBSuBUTGhM468rDQ/eqjns03GJAfokrz73XaYrYvX/gz2jl6/L QTNTA6kFDUwHUiabdwYcDj2t4MS4vU7sjigNDMUwlS+o2ugv4bTnbOG5UZQJmOb/b0 VbaBgCbr3yrtg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 08/17] tty: goldfish: drop unneeded temporary variables Date: Tue, 21 Nov 2023 10:22:49 +0100 Message-ID: <20231121092258.9334-9-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231121092258.9334-1-jirislaby@kernel.org> References: <20231121092258.9334-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We can pass 'buf' directly to goldfish_tty_rw() using simple (unsigned long) cast. There is no need to obfuscate the code by another variable with double casts. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/goldfish.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 4591f940b7a1..dccf6c6c69c6 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -128,16 +128,14 @@ static void goldfish_tty_rw(struct goldfish_tty *qtty, static void goldfish_tty_do_write(int line, const u8 *buf, unsigned int co= unt) { struct goldfish_tty *qtty =3D &goldfish_ttys[line]; - unsigned long address =3D (unsigned long)(void *)buf; =20 - goldfish_tty_rw(qtty, address, count, 1); + goldfish_tty_rw(qtty, (unsigned long)buf, count, 1); } =20 static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id) { struct goldfish_tty *qtty =3D dev_id; void __iomem *base =3D qtty->base; - unsigned long address; unsigned char *buf; u32 count; =20 @@ -147,8 +145,7 @@ static irqreturn_t goldfish_tty_interrupt(int irq, void= *dev_id) =20 count =3D tty_prepare_flip_string(&qtty->port, &buf, count); =20 - address =3D (unsigned long)(void *)buf; - goldfish_tty_rw(qtty, address, count, 0); + goldfish_tty_rw(qtty, (unsigned long)buf, count, 0); =20 tty_flip_buffer_push(&qtty->port); return IRQ_HANDLED; --=20 2.42.1