Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp748991pxb; Fri, 22 Apr 2022 10:19:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKhaC87iaQpwHdaWMMXHHp0mcR9Yu0YHpeQGhEMXkb3alkVOxSBYgaKeNCFsFP/mcGC8Mw X-Received: by 2002:a17:90b:384e:b0:1d2:798d:6f42 with SMTP id nl14-20020a17090b384e00b001d2798d6f42mr6352000pjb.5.1650647970915; Fri, 22 Apr 2022 10:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650647970; cv=none; d=google.com; s=arc-20160816; b=zK2PGqLk0e+owkw9OvuwXD7uYstbcriqd2CDOYkk8t2exFzyez5l91XBt1b3LZmlMn afyIWOEx/k19xhnt5i3wy0eqMKVKlCvA6/OfY0z48rp2CK26oHfd7nhEDfwAhnt3F3Ww +Y4F0pqXyAGgOax2EuxdyQ1Gz0xKidKGmVXnv62Gm6ADI8HktMWQkQea5qsK/KWPdlPj bLw81x/TsVY7898yLw1/uBgvQuT0kSg4NdFIvMwJFlWyRg6inONOWU3iTYBz1PuU36V4 HCLRihMnvSTtHgskvCguTiEe7rdBhFZNFITGBzirWyfNiixeos0AZixy8dDubWPwO9mj K+xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Av0WDD17KqZTnnWpTO7caIQzT04y2/xp320J3kYCBfI=; b=UvQtsf9kqyGm2w0pHpb9ZQ1cAK7YPSLXYuMCMw4AHn8xUXuKCpdzOHYTUlEwt9Z5/I VL/9e4mqDliig6LpEqx7aepgMydKlGucvmc1axTd8NflNTo+IWCtQFTr5i3qjf2Tjq9j sjjaHAm2GEQp5ffKRsRM/8v8QL8BzQc2zHxUqAfYpozYUterHMBupvrNFWJ64DsTUMTS BFGOIWdshxCIcMVI39ydA+xcKisfhM1FZniIbQvnvPHtKHrbWHFy3mCCqg+v+rbzQDMd tUL1Ww9szi5o4hFfdAayGJnm5+1kQiXLZ8dZONG0GdETbONSOenhsmKkpYyq2pZ1lIyo Zd8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=phxzUDo1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=2zW+Sr+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ng5-20020a17090b1a8500b001d529ef7481si8521363pjb.168.2022.04.22.10.19.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:19:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=phxzUDo1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=2zW+Sr+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9749E1FA55; Fri, 22 Apr 2022 10:15:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388263AbiDUKUL (ORCPT + 99 others); Thu, 21 Apr 2022 06:20:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbiDUKUC (ORCPT ); Thu, 21 Apr 2022 06:20:02 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8661322B10; Thu, 21 Apr 2022 03:17:11 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 068341F753; Thu, 21 Apr 2022 10:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650536230; 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=Av0WDD17KqZTnnWpTO7caIQzT04y2/xp320J3kYCBfI=; b=phxzUDo1E0uAUHonf9nDzXPKqJOI5Xi5Kln8yeW5r/LaEzLBjc7/Oxm9xmWBzm/7z3JUTR RjrXpOK5mMYDWydXZKebGSDsKAk2i7l+QFjBNt8v/R4+OGpA9be+xrmiM+RPRk+NgRL9Mt 2/foT1agPh+NCc3M1A5rgiHwAVY+QyU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650536230; 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=Av0WDD17KqZTnnWpTO7caIQzT04y2/xp320J3kYCBfI=; b=2zW+Sr+BmD13xFjUgKqg8cBYoW6p6OSJmm9Fpw2mjkFMXTH+1lftKyvicZ1TKIx4lWv+9C zvd+0ixRz3/KF/Bg== Received: from localhost.localdomain (unknown [10.100.208.98]) (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 D082F2C141; Thu, 21 Apr 2022 10:17:09 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 3/7] serial: xilinx_uartps: cache xmit in cdns_uart_handle_tx() Date: Thu, 21 Apr 2022 12:17:04 +0200 Message-Id: <20220421101708.5640-4-jslaby@suse.cz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220421101708.5640-1-jslaby@suse.cz> References: <20220421101708.5640-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cache port->state->xmit into a local variable (xmit) in cdns_uart_handle_tx(). This reduces length of some lines there significantly. I.e. makes the code more readable. Signed-off-by: Jiri Slaby --- drivers/tty/serial/xilinx_uartps.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index b84ae9c07c3b..9e01fe6c0ab8 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -313,29 +313,26 @@ static void cdns_uart_handle_rx(void *dev_id, unsigned int isrstatus) static void cdns_uart_handle_tx(void *dev_id) { struct uart_port *port = (struct uart_port *)dev_id; + struct circ_buf *xmit = &port->state->xmit; unsigned int numbytes; - if (uart_circ_empty(&port->state->xmit)) { + if (uart_circ_empty(xmit)) { writel(CDNS_UART_IXR_TXEMPTY, port->membase + CDNS_UART_IDR); return; } numbytes = port->fifosize; - while (numbytes && !uart_circ_empty(&port->state->xmit) && - !(readl(port->membase + CDNS_UART_SR) & - CDNS_UART_SR_TXFULL)) { + while (numbytes && !uart_circ_empty(xmit) && + !(readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXFULL)) { - writel(port->state->xmit.buf[port->state->xmit.tail], - port->membase + CDNS_UART_FIFO); + writel(xmit->buf[xmit->tail], port->membase + CDNS_UART_FIFO); port->icount.tx++; - port->state->xmit.tail = (port->state->xmit.tail + 1) & - (UART_XMIT_SIZE - 1); - + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); numbytes--; } - if (uart_circ_chars_pending(&port->state->xmit) < WAKEUP_CHARS) + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); } -- 2.36.0