From mboxrd@z Thu Jan 1 00:00:00 1970 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 0EEC6ECAAD8 for ; Tue, 20 Sep 2022 05:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbiITFVZ (ORCPT ); Tue, 20 Sep 2022 01:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbiITFUy (ORCPT ); Tue, 20 Sep 2022 01:20:54 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAF94D4DD; Mon, 19 Sep 2022 22:20:53 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 2C6B221CB9; Tue, 20 Sep 2022 05:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1663651251; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UI2jWYkFC7yTyQ71uYKxabQJQdsHojOQkO52hXQioaY=; b=RcRxz1VdBnWER++nYaGrYWA3pzAoUVNe5xc7j1k2UaeRrL21lgV/MtqHIfjCjrnq8pCmLE n+rrCIHGM5wvVXaL/W1iYNMuYEN4r8nFUXIpeDxNn9R0rHF3RIAUrJj4hFk9XHhjcNK8On CMy1Ebfv+U709TYaLT9I/74s5Q/tEjU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1663651251; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UI2jWYkFC7yTyQ71uYKxabQJQdsHojOQkO52hXQioaY=; b=qOY0EUaed4/ac2F5DBb1tXPyfi1oWtSOosFx/8Dbct0nT0tBBaSBFJ2R/0dlYF9RuryQDR qsC9ddav/qtD3oBQ== Received: from localhost.localdomain (unknown [10.100.201.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id EB8A12C142; Tue, 20 Sep 2022 05:20:50 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , Tobias Klauser Subject: [PATCH v4 03/10] tty: serial: altera_uart_{r,t}x_chars() need only uart_port Date: Tue, 20 Sep 2022 07:20:43 +0200 Message-Id: <20220920052049.20507-4-jslaby@suse.cz> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220920052049.20507-1-jslaby@suse.cz> References: <20220920052049.20507-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both altera_uart_{r,t}x_chars() need only uart_port, not altera_uart. So pass the former from altera_uart_interrupt() directly. Apart it maybe saves a dereference, this makes the transition of altera_uart_tx_chars() easier to follow in the next patch. Cc: Tobias Klauser Signed-off-by: Jiri Slaby --- Notes: [v4] this is new in v4 -- extracted as a separate change drivers/tty/serial/altera_uart.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index 4170e66601ec..82f2790de28d 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -199,9 +199,8 @@ static void altera_uart_set_termios(struct uart_port *port, */ } -static void altera_uart_rx_chars(struct altera_uart *pp) +static void altera_uart_rx_chars(struct uart_port *port) { - struct uart_port *port = &pp->port; unsigned char ch, flag; unsigned short status; @@ -246,9 +245,8 @@ static void altera_uart_rx_chars(struct altera_uart *pp) tty_flip_buffer_push(&port->state->port); } -static void altera_uart_tx_chars(struct altera_uart *pp) +static void altera_uart_tx_chars(struct uart_port *port) { - struct uart_port *port = &pp->port; struct circ_buf *xmit = &port->state->xmit; if (port->x_char) { @@ -286,9 +284,9 @@ static irqreturn_t altera_uart_interrupt(int irq, void *data) spin_lock(&port->lock); if (isr & ALTERA_UART_STATUS_RRDY_MSK) - altera_uart_rx_chars(pp); + altera_uart_rx_chars(port); if (isr & ALTERA_UART_STATUS_TRDY_MSK) - altera_uart_tx_chars(pp); + altera_uart_tx_chars(port); spin_unlock(&port->lock); return IRQ_RETVAL(isr); -- 2.37.3