From nobody Sun May 10 23:27:44 2026 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 976E1C433F5 for ; Thu, 21 Apr 2022 10:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388297AbiDUKUO (ORCPT ); Thu, 21 Apr 2022 06:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388170AbiDUKT7 (ORCPT ); Thu, 21 Apr 2022 06:19:59 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C31D822539; Thu, 21 Apr 2022 03:17:10 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 80D0E215FD; Thu, 21 Apr 2022 10:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650536229; 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=4ZDmSqxvMSMnzvD66zwNXx1oaFSysSwdXwirsm7uH1U=; b=GdUI6X2P8dy3i3Mu4rned74AooRfbQ15jokbXg46TXhM39+Ah83oDRuCoZVCW+Qwe5ivC2 0CGoI/G+RpI2bVmxOrlPHcbYRCduFA7rpCxysh3nf7su51vnFq3tSqdcQ/M0gr53YEWyjT WNgfRv2b3YmkcjxXqqnWvoLnQot1q3U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650536229; 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=4ZDmSqxvMSMnzvD66zwNXx1oaFSysSwdXwirsm7uH1U=; b=w05mHH6TFR+f4ofcPE4b0aaD79QbvniAyOjRKMuudWzlCYtlN0x7roK1X0sp8vLvhNezkD KZ/TMG3Dq/VwMkCg== 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 4E8932C145; 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 1/7] serial: sunplus-uart: mark sunplus_console_ports[] static Date: Thu, 21 Apr 2022 12:17:02 +0200 Message-Id: <20220421101708.5640-2-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" It's used only in the driver, so declare it as local to silence this correct sparse warning: sunplus-uart.c:501:26: warning: symbol 'sunplus_console_ports' was not decl= ared. Should it be static? Signed-off-by: Jiri Slaby --- drivers/tty/serial/sunplus-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sunplus-uart.c b/drivers/tty/serial/sunplus= -uart.c index 9f15922e681b..60c73662f955 100644 --- a/drivers/tty/serial/sunplus-uart.c +++ b/drivers/tty/serial/sunplus-uart.c @@ -498,7 +498,7 @@ static const struct uart_ops sunplus_uart_ops =3D { }; =20 #ifdef CONFIG_SERIAL_SUNPLUS_CONSOLE -struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR]; +static struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR]; =20 static void sunplus_uart_console_putchar(struct uart_port *port, unsigned char ch) --=20 2.36.0 From nobody Sun May 10 23:27:44 2026 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 109B8C433F5 for ; Thu, 21 Apr 2022 10:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388313AbiDUKUV (ORCPT ); Thu, 21 Apr 2022 06:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388241AbiDUKUC (ORCPT ); Thu, 21 Apr 2022 06:20:02 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64AD222B0C; Thu, 21 Apr 2022 03:17:11 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BDBFA215FE; Thu, 21 Apr 2022 10:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650536229; 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=ZPmULzmh0/xA3SxYa2A8Wvr5Go8Reyih7fHmmfVIddM=; b=PpeW2wuuZuaofyJb6mAIjpipTq3x3pQmCGP0oGj9eKi8OqXLBqeTMYEu4rCUbRYKouR2UB 4KJEzhyJokHsmfNUcv7iw+qlUpPCeGXwadm7KQcnFP9l1ykjWl5XR9BrNLSqz4bcy5CzBL TlOpBoZD/GMjf8S4eQylHAqizSNz/AM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650536229; 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=ZPmULzmh0/xA3SxYa2A8Wvr5Go8Reyih7fHmmfVIddM=; b=VHL8VVSzBsF6qfsey7xd/8/rVRWA5yyEQ5qCAor58h9ClHzA9LmwCdk9wg+4q2xljOe8q8 lPgRV1MaxhY7ZuAQ== 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 948742C142; 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 2/7] serial: xilinx_uartps: return early in cdns_uart_handle_tx() Date: Thu, 21 Apr 2022 12:17:03 +0200 Message-Id: <20220421101708.5640-3-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Return from the true branch of the 'if'. This saves one indentation level and makes the code more readable. The two comments about what obvious code does are removed too. Signed-off-by: Jiri Slaby --- drivers/tty/serial/xilinx_uartps.c | 47 ++++++++++++------------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx= _uartps.c index 250a1d888eeb..b84ae9c07c3b 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -317,37 +317,26 @@ static void cdns_uart_handle_tx(void *dev_id) =20 if (uart_circ_empty(&port->state->xmit)) { writel(CDNS_UART_IXR_TXEMPTY, port->membase + CDNS_UART_IDR); - } else { - numbytes =3D port->fifosize; - while (numbytes && !uart_circ_empty(&port->state->xmit) && - !(readl(port->membase + CDNS_UART_SR) & - CDNS_UART_SR_TXFULL)) { - /* - * Get the data from the UART circular buffer - * and write it to the cdns_uart's TX_FIFO - * register. - */ - writel( - port->state->xmit.buf[port->state->xmit.tail], - port->membase + CDNS_UART_FIFO); - - port->icount.tx++; - - /* - * Adjust the tail of the UART buffer and wrap - * the buffer if it reaches limit. - */ - port->state->xmit.tail =3D - (port->state->xmit.tail + 1) & - (UART_XMIT_SIZE - 1); - - numbytes--; - } + return; + } =20 - if (uart_circ_chars_pending( - &port->state->xmit) < WAKEUP_CHARS) - uart_write_wakeup(port); + numbytes =3D port->fifosize; + while (numbytes && !uart_circ_empty(&port->state->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); + + port->icount.tx++; + port->state->xmit.tail =3D (port->state->xmit.tail + 1) & + (UART_XMIT_SIZE - 1); + + numbytes--; } + + if (uart_circ_chars_pending(&port->state->xmit) < WAKEUP_CHARS) + uart_write_wakeup(port); } =20 /** --=20 2.36.0 From nobody Sun May 10 23:27:44 2026 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 AE8C2C433F5 for ; Thu, 21 Apr 2022 10:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388251AbiDUKUM (ORCPT ); Thu, 21 Apr 2022 06:20:12 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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, unsigne= d int isrstatus) static void cdns_uart_handle_tx(void *dev_id) { struct uart_port *port =3D (struct uart_port *)dev_id; + struct circ_buf *xmit =3D &port->state->xmit; unsigned int numbytes; =20 - if (uart_circ_empty(&port->state->xmit)) { + if (uart_circ_empty(xmit)) { writel(CDNS_UART_IXR_TXEMPTY, port->membase + CDNS_UART_IDR); return; } =20 numbytes =3D 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)) { =20 - writel(port->state->xmit.buf[port->state->xmit.tail], - port->membase + CDNS_UART_FIFO); + writel(xmit->buf[xmit->tail], port->membase + CDNS_UART_FIFO); =20 port->icount.tx++; - port->state->xmit.tail =3D (port->state->xmit.tail + 1) & - (UART_XMIT_SIZE - 1); - + xmit->tail =3D (xmit->tail + 1) & (UART_XMIT_SIZE - 1); numbytes--; } =20 - if (uart_circ_chars_pending(&port->state->xmit) < WAKEUP_CHARS) + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); } =20 --=20 2.36.0 From nobody Sun May 10 23:27:44 2026 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 21D53C433FE for ; Thu, 21 Apr 2022 10:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388333AbiDUKUZ (ORCPT ); Thu, 21 Apr 2022 06:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388124AbiDUKUD (ORCPT ); Thu, 21 Apr 2022 06:20:03 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2CC622B12; 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 4BB201F755; 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=NF+UmkqumeY0pckDNhK2uWzgueOaF+BJbbY4k3pIt1k=; b=jykvhSaXeT7d/16BWZwwf8Hy93G+2JZ20H3coVDtYZ5mXH1xNrgle4PBNWzr2wM6GDBxx3 reOsbbTbWPhr9SZKtxTYFUCO+v3RvyqZg9FpM1TlxIbqNxQIm58ucZpScJGx5vzWR1RGJL AWZTgpWaG6FMTRBp7v88tDKih/+tO4c= 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=NF+UmkqumeY0pckDNhK2uWzgueOaF+BJbbY4k3pIt1k=; b=r8KEOduRgvrxhQRRDK32mMYaxb3BWijDb/FVb3KuYn676AstyrmI4celzE5YZBve/PUgR6 y9ECwomqls6s7ZBA== 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 1A47A2C142; Thu, 21 Apr 2022 10:17:10 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 4/7] serial: zs: use NULL as a pointer, not 0 Date: Thu, 21 Apr 2022 12:17:05 +0200 Message-Id: <20220421101708.5640-5-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" struct uart_port::membase is declared as a pointer. So it should be initialized by NULL, not zero constant. Signed-off-by: Jiri Slaby --- drivers/tty/serial/zs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index 70969bf9d82c..5bc58591665a 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -981,7 +981,7 @@ static const char *zs_type(struct uart_port *uport) static void zs_release_port(struct uart_port *uport) { iounmap(uport->membase); - uport->membase =3D 0; + uport->membase =3D NULL; release_mem_region(uport->mapbase, ZS_CHAN_IO_SIZE); } =20 --=20 2.36.0 From nobody Sun May 10 23:27:44 2026 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 D4FFAC433F5 for ; Thu, 21 Apr 2022 10:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388356AbiDUKUi (ORCPT ); Thu, 21 Apr 2022 06:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379764AbiDUKUD (ORCPT ); Thu, 21 Apr 2022 06:20:03 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB3A925C40; Thu, 21 Apr 2022 03:17:11 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id A201921110; 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=/Nre80yG3dX3kSQn05Ue/XY8zsmy/wEbfiIp5CM7yac=; b=TJ/aeHQEIzst0dMgWVyDEvZKl/9sw9YXVuYCt8QqePeQOp9t3zw4y+ZemPqnfHX0JeSwLo qG0p04wrGwFk9y6F0HzAdxVKzgVA2fwLJ+m7SzJ/H83v1FB01BWFvMQjpNxERG0dPHv6BU hLUBPEGbD0sA/xuXErAwnV1c3LZlQzs= 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=/Nre80yG3dX3kSQn05Ue/XY8zsmy/wEbfiIp5CM7yac=; b=3eN1T6Khp94LhXBTUA9ggDKKjg5/dPqrHN0XPr5EiyCaynzS9pjA1tywpAY8AcGd/oTjLm BEoFnS8Af8dY+HBg== 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 602062C141; Thu, 21 Apr 2022 10:17:10 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , Andy Gross , Bjorn Andersson Subject: [PATCH 5/7] serial: qcom: use check for empty instead of pending Date: Thu, 21 Apr 2022 12:17:06 +0200 Message-Id: <20220421101708.5640-6-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The code wants to know if the circ buffer is empty, so use the proper macro. No functional change intended, just saner function name used for that use case. Cc: Andy Gross Cc: Bjorn Andersson Signed-off-by: Jiri Slaby --- drivers/tty/serial/qcom_geni_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qco= m_geni_serial.c index 1543a6028856..f4961022d7d0 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -507,7 +507,7 @@ static void qcom_geni_serial_console_write(struct conso= le *co, const char *s, */ qcom_geni_serial_poll_tx_done(uport); =20 - if (uart_circ_chars_pending(&uport->state->xmit)) { + if (!uart_circ_empty(&uport->state->xmit)) { irq_en =3D readl(uport->membase + SE_GENI_M_IRQ_EN); writel(irq_en | M_TX_FIFO_WATERMARK_EN, uport->membase + SE_GENI_M_IRQ_EN); --=20 2.36.0 From nobody Sun May 10 23:27:44 2026 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 87687C433F5 for ; Thu, 21 Apr 2022 10:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388314AbiDUKUe (ORCPT ); Thu, 21 Apr 2022 06:20:34 -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 S1384007AbiDUKUD (ORCPT ); Thu, 21 Apr 2022 06:20:03 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3247922509; Thu, 21 Apr 2022 03:17:12 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id DB341215FF; 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=bZqNTsTGUjNsjOXWwSBxVwhockoLbVfQoEn634ED5Z4=; b=0FxNZL5HhLq9tCrMGkbDDpDmY5GzJfFz0qrUZ4akBWbLbPo2pNQGXzSoEN1ZhGl3SLHckM o+ZEHzkPmqoNeoS6SNq/yC+AfoxCwEUYe9VukE4Aw9deYqDJAyMy9DfsXuP9HdWX27Cqru mS2u5VkzJavky7cG1qZMS+WGaldKu6g= 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=bZqNTsTGUjNsjOXWwSBxVwhockoLbVfQoEn634ED5Z4=; b=WfF9pVinNH+uQGqZJH0uMmZgCduz+cxDRNNYpnmHVHzoAfBvgcBaF1DocVcYe0Jsh8b124 m5aPxEBUCrsautCw== 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 B21E92C142; Thu, 21 Apr 2022 10:17:10 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 6/7] serial: pic32: make SERIAL_PIC32_CONSOLE depend on SERIAL_PIC32=y Date: Thu, 21 Apr 2022 12:17:07 +0200 Message-Id: <20220421101708.5640-7-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" pic32_uart contains this: #ifdef CONFIG_SERIAL_PIC32_CONSOLE ... console_initcall(pic32_console_init); ... core_initcall(pic32_late_console_init); ... #endif ... arch_initcall(pic32_uart_init); When the driver is built as module, all three above become module_init(). So if SERIAL_PIC32_CONSOLE is set while SERIAL_PIC32=3Dm, it results in the following build error: In file included from include/linux/device/driver.h:21, from include/linux/device.h:32, from include/linux/platform_device.h:13, from drivers/tty/serial/pic32_uart.c:12: include/linux/module.h:131:49: error: redefinition of '__inittest' So make sure SERIAL_PIC32_CONSOLE can be set only when SERIAL_PIC32=3Dy -- similar as for other drivers. Signed-off-by: Jiri Slaby --- drivers/tty/serial/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index dbac90e2e209..20cb103972fa 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -817,7 +817,7 @@ config SERIAL_PIC32 =20 config SERIAL_PIC32_CONSOLE bool "PIC32 serial console support" - depends on SERIAL_PIC32 + depends on SERIAL_PIC32=3Dy select SERIAL_CORE_CONSOLE help If you have a PIC32, this driver supports the putting a console on one --=20 2.36.0 From nobody Sun May 10 23:27:44 2026 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 8E741C433F5 for ; Thu, 21 Apr 2022 10:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388361AbiDUKUn (ORCPT ); Thu, 21 Apr 2022 06:20:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388252AbiDUKUE (ORCPT ); Thu, 21 Apr 2022 06:20:04 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4365728E27; Thu, 21 Apr 2022 03:17:13 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 25BCC21600; Thu, 21 Apr 2022 10:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650536231; 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=uJilQ8bhQzcKnYlu51Jw3ZNoqJWqrcIlFOvokPNs7P4=; b=0LFDeKlXLqK7riuToQsDBZwBw1UHI1ZSa/PONl16yS69ANd3Vp3DMlN00L5Wi5eA5jRImw yjPQDxx7VC3iYY90sye+4oWBtp5PU/yWPH6j0slFsh2dXjNZVr2hgVp1KKECsZcnqxBdIP RurrsQMVOI7RLEDOlEZzcmJb2mjxu8Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650536231; 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=uJilQ8bhQzcKnYlu51Jw3ZNoqJWqrcIlFOvokPNs7P4=; b=n/AFf/lVGOsWq6bgMByjw29zU+c47oh6LCyXIIhkBnHj/At25vmmvGtZ0LB8wHKgsN4FeF etPdJEtqWQEzwrDA== 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 F18332C141; Thu, 21 Apr 2022 10:17:10 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 7/7] serial: allow COMPILE_TEST for some drivers Date: Thu, 21 Apr 2022 12:17:08 +0200 Message-Id: <20220421101708.5640-8-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Some more serial drivers can be compile-tested under certain circumstances (when building a specific architecture). So allow for that. This reduces the need of zillion mach/subarch-specific configs. And since the 0day bot has only allmodconfig's for some archs, this increases build coverage there too. Note that cpm needs a minor update in the header, so that it drags in at least some defines (CPM2 ones). Signed-off-by: Jiri Slaby --- drivers/tty/serial/Kconfig | 6 +++--- drivers/tty/serial/cpm_uart/cpm_uart.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 20cb103972fa..2d3eed53b43e 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -782,7 +782,7 @@ config SERIAL_PMACZILOG_CONSOLE =20 config SERIAL_CPM tristate "CPM SCC/SMC serial port support" - depends on CPM2 || CPM1 + depends on CPM2 || CPM1 || (PPC32 && COMPILE_TEST) select SERIAL_CORE help This driver supports the SCC and SMC serial ports on Motorola=20 @@ -806,7 +806,7 @@ config SERIAL_CPM_CONSOLE =20 config SERIAL_PIC32 tristate "Microchip PIC32 serial support" - depends on MACH_PIC32 + depends on MACH_PIC32 || (MIPS && COMPILE_TEST) select SERIAL_CORE help If you have a PIC32, this driver supports the serial ports. @@ -1246,7 +1246,7 @@ config SERIAL_XILINX_PS_UART_CONSOLE =20 config SERIAL_AR933X tristate "AR933X serial port support" - depends on HAVE_CLK && ATH79 + depends on (HAVE_CLK && ATH79) || (MIPS && COMPILE_TEST) select SERIAL_CORE select SERIAL_MCTRL_GPIO if GPIOLIB help diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cp= m_uart/cpm_uart.h index 6113b953ce25..8c582779cf22 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart.h +++ b/drivers/tty/serial/cpm_uart/cpm_uart.h @@ -19,6 +19,8 @@ struct gpio_desc; #include "cpm_uart_cpm2.h" #elif defined(CONFIG_CPM1) #include "cpm_uart_cpm1.h" +#elif defined(CONFIG_COMPILE_TEST) +#include "cpm_uart_cpm2.h" #endif =20 #define SERIAL_CPM_MAJOR 204 --=20 2.36.0