From patchwork Tue Nov 15 07:17:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 20216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2565845wru; Mon, 14 Nov 2022 23:20:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf7AlwhL1QNQbbV7puBYIW5/SHc5iNBNDFEzqU5mJ7IHh4T+JXH+3spgefUItQq3buOJmFGn X-Received: by 2002:aa7:de92:0:b0:467:8fb6:d11 with SMTP id j18-20020aa7de92000000b004678fb60d11mr10731048edv.421.1668496810656; Mon, 14 Nov 2022 23:20:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668496810; cv=none; d=google.com; s=arc-20160816; b=yRBRX+MQwJDJHRSkCCkgujDaA+lRzxwYJP8cAmaY3JYjKs5xzblnlP57ihc1pAWOPZ //3HqpOK6wyqo9U37R0vvEznV2SSEu5+ttuRxWcHEE0WjMbTrXEzwWcNl3bnLNXqSCdA Q1yxOxHRIAQ9/2TX0httFakbnaER0LNugu3hairC7Jk5pX46ZAe14acBN4A7/Ooxoovl /fk9borJ/klH463Y4fgNzQ88PlUX4GRqHY4ubriKpdp5TTY1SaZURoldyEdBWWsWoCg3 w1/ayjLrHOAHinLd0pfVoz313NXzbfsKIWM3crhukPNufSDFqD/r9R6IcLeQyvXjeJBO 509g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=+RCT2yB8h0kWm0nmaHq7MwBFOD3naBENbOD+/8vukmc=; b=kjZfUegyzL4Nc+50/hLhcuiWZ+J0Dj5sBdQ665FpDetL5ZWd8ShQFrrA223FLi5q6/ cXDMh/YfQ+yG46boHeAahqPWxr02Je2KhFu1/i+6F2Ah1lYiwbZ3UrQIRs2aIBOnJdzv g4UQkOyh7gywVukZ7sKt6jne0MG9YgCSWRrEyNCiqEcQaUHZIcwhboumNNMbbvUaN6jL rgoB5c8dCrWT1ETYRTQDIY4Rqk1S9kIp/Fj38kUi36ryvaRjwNM7ZNRU7+Ka8Rq4TXKt WMPR8DbnKdHuyc4e/ipl6zxX6R6GTU1mvK3J8KJV617kw+mlrQMqeQAmP3IdDOXcSQnu KAvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U2fZHfaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a05640242c300b0045c7611d8ddsi11796418edc.179.2022.11.14.23.19.45; Mon, 14 Nov 2022 23:20:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U2fZHfaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbiKOHRe (ORCPT + 99 others); Tue, 15 Nov 2022 02:17:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbiKOHRb (ORCPT ); Tue, 15 Nov 2022 02:17:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8391DF05; Mon, 14 Nov 2022 23:17:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 61D36B816D4; Tue, 15 Nov 2022 07:17:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B151BC433D6; Tue, 15 Nov 2022 07:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668496648; bh=4+/EQQYq7onpYQWLzcvcEdnGKo/7iYZ/uL0MrdW6F24=; h=From:To:Cc:Subject:Date:From; b=U2fZHfaNEO1BH3jEhS2mhHKTOSJgcQ5Icu5Qu1JDBg9q4iyq4KiQcyVszU7pARyZm 0tD8X4lqMzghdB8FOYY49ZZDYpElPIk5RxW0JeDQbFgXOz/GSG8EfQSxsxNR0xCRIE eKuIrF3F/YV+nb9W9gjAuWze/9Ko/uIyCzCwQEVVvm5n5dwtI6mPi83j1/uII2PNAS 1i65qXsclBHab/uLWk1tA08agPVljXyBht/wHtw4zSk71Boqu+Fgwz4K3WNIzTBhS1 38c0ULOo5HZu1v+qpJs8eLG6ih5mRahawUFqcDN3/Vb+KNhBV8ZYG8lZ3bJezyxe0O AOZ54uzpS2FEA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Tobias Klauser Subject: [PATCH 1/4] tty: serial: altera_jtaguart: remove flag from altera_jtaguart_rx_chars() Date: Tue, 15 Nov 2022 08:17:21 +0100 Message-Id: <20221115071724.5185-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749545712053608136?= X-GMAIL-MSGID: =?utf-8?q?1749545712053608136?= TTY_NORMAL is the only value it contains, so remove the variable and use the constant instead. Cc: Tobias Klauser Signed-off-by: Jiri Slaby (SUSE) Reviewed-by: Tobias Klauser --- drivers/tty/serial/altera_jtaguart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index aa49553fac58..8d1729711584 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -126,18 +126,17 @@ static void altera_jtaguart_set_termios(struct uart_port *port, static void altera_jtaguart_rx_chars(struct altera_jtaguart *pp) { struct uart_port *port = &pp->port; - unsigned char ch, flag; + unsigned char ch; unsigned long status; while ((status = readl(port->membase + ALTERA_JTAGUART_DATA_REG)) & ALTERA_JTAGUART_DATA_RVALID_MSK) { ch = status & ALTERA_JTAGUART_DATA_DATA_MSK; - flag = TTY_NORMAL; port->icount.rx++; if (uart_handle_sysrq_char(port, ch)) continue; - uart_insert_char(port, 0, 0, ch, flag); + uart_insert_char(port, 0, 0, ch, TTY_NORMAL); } tty_flip_buffer_push(&port->state->port); From patchwork Tue Nov 15 07:17:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 20219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2566313wru; Mon, 14 Nov 2022 23:21:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5YdNlzNTgoNOcJ2rP53su8tvu+3pf+aRapMRehQ1vo1jGzRPrpthkp4kujG/8C1ODPsrdr X-Received: by 2002:a17:907:d402:b0:7aa:493b:679 with SMTP id vi2-20020a170907d40200b007aa493b0679mr13191445ejc.320.1668496886531; Mon, 14 Nov 2022 23:21:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668496886; cv=none; d=google.com; s=arc-20160816; b=auyE/y5mnjRWm+nlzxC+8lPa0PNgG5A05UXEeatpp8jpu7f4SjLFDEFoB/06riTBwF 7Yi60O+k54nO5XVpuFe/zDwhXDrSzSNFpSZGDkBawmSjrPquQYY4nPuE4d4Oq3VnQFn5 LUike/iua4rdpH6klAKMEVVm0mowN/UfYMtetVB+Oo8DSTlsZtuLyZTqlEJ8MBRR18HD CjghOD2oslRgrVvgH9HhcmVBEnLNHZRgXipXj+C4CP/u2NuCw4mVY0orj6OexT/LR8ym evn4iZs8Iny3cqsU4YQDqfrsfgZaHjYer4qdkwHjNwvT97m1azbaLVqhggh55rYxOFro 4gEw== 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; bh=21Ng4BIBddJwkS58u1eQj19z5IQVdKeROznQ7Kqh1ao=; b=BL0GXQzDFsFb5G8lvUOjWmRXwLbSwkqgcRtaFM6lm5EtrKDTnBF6yv2jfMj93j9tEu /CWI10ob4VCGB04N9upix1eEcEJDbovjmM5OAUp3TmzOonG4eMhSPew5ePtcAWylQWBA oGxV9m9GVfCqIwfY+ikfs2vOSIMcaQ738cO+HyHTodlksKHiv4NVWotpXkdTIvmGGPFT ZSahIL5j1ubjpa5zuxJ7V3T/mXZfniEq8H5PJcBLF3bMSN51PIg8EOm6bDTUngE2Y2xH BgzNJcWFBUw/KBOL9rPTcfWjWggoU6/RmkpHfz5Hzedhj1PehjSwqfmlSY9a9LmglXXk 7pTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lA8lBgKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a056402191100b00458cd6f8506si12410101edz.173.2022.11.14.23.21.02; Mon, 14 Nov 2022 23:21:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lA8lBgKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbiKOHRl (ORCPT + 99 others); Tue, 15 Nov 2022 02:17:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbiKOHRd (ORCPT ); Tue, 15 Nov 2022 02:17:33 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 671B01DF07; Mon, 14 Nov 2022 23:17:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1AF5AB816E1; Tue, 15 Nov 2022 07:17:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73A75C433B5; Tue, 15 Nov 2022 07:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668496649; bh=Sg6Xpqv3xz30myfUt2Jwhn6u7Q0v3+pg5wo8zEwC8aA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lA8lBgKinNH0e8VMXvQ+tE19umChfhaiW57zjRDPC/nO35XHwLq2JxGI+9zZxNPKR As/aV0ezJ30JyGaEARzMUn00ecxRyk3caEsdH3JSA5H0FdeLUnXeNhrZIIRpwzOuR0 dXtZHrLYpzWM5KF9ZfRATY76yEfdvAYtKjhgcN4NyWNLUDQzgVhkLTcyADw91E6vM7 u7IL5LTV/dHV6+JQF/ZJlJ6yUlIQUux1UbijgInVlrVnjKJ32E8dNMGSZfO71S44Cr Uy/lrD/QFHd4FZ3ziSy1+SyiEA47i9dEPcPXXaglsEKxGleO0NvNmssdhwHGGgk9QC xpBFSpo15IePQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Tobias Klauser Subject: [PATCH 2/4] tty: serial: altera_jtaguart: remove unused altera_jtaguart::sigs Date: Tue, 15 Nov 2022 08:17:22 +0100 Message-Id: <20221115071724.5185-2-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221115071724.5185-1-jirislaby@kernel.org> References: <20221115071724.5185-1-jirislaby@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749545791252946294?= X-GMAIL-MSGID: =?utf-8?q?1749545791252946294?= Nothing uses struct altera_jtaguart::sigs. Remove it. Cc: Tobias Klauser Signed-off-by: Jiri Slaby (SUSE) Reviewed-by: Tobias Klauser --- drivers/tty/serial/altera_jtaguart.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 8d1729711584..b83eade64b22 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -55,7 +55,6 @@ */ struct altera_jtaguart { struct uart_port port; - unsigned int sigs; /* Local copy of line sigs */ unsigned long imr; /* Local IMR mirror */ }; From patchwork Tue Nov 15 07:17:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 20221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2566787wru; Mon, 14 Nov 2022 23:22:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf6hGq3zTDvqBXYP491MhX1iQbobncaJUs6qLaHXbZP07Kaj+/xz2wAnyRdWNj2XynHlTBEi X-Received: by 2002:a17:906:d115:b0:79e:9aea:7b60 with SMTP id b21-20020a170906d11500b0079e9aea7b60mr13109533ejz.444.1668496957027; Mon, 14 Nov 2022 23:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668496957; cv=none; d=google.com; s=arc-20160816; b=zXLN75Dvp8KTnwzIuUbz3stgW1VrH/VshLaBWWorVCvSipfwVYUIXYqhrVGqDwvcAF DY9AaLiNMTwsOb3o6wGy5vl1n6pEYE7JJp3YaQrcOt+331UAUvhq2k1A6+Y7yCRT2ZwJ 6T1i2V3QxErTIf3OvrNR5Kf38ZXYtTq0eis8+XOykfaRLXSIRQHv/uACunqqVPpuRDkV 8B7weXOtbsuVo3kwdv2UwhEoym8eKF36S6PQvgm+QsFGFaCCXk387UVfi1AgCbERHKxx aBuNN8AbyCOfEwtewx8n4jtiD/Intk4mFlEBU7o7xKf7AAOFRAgsg2jct0B3M3k5Ts+v 7kig== 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; bh=ZN0z6nPyQE6trmhcHuRv9hP7vFnpkl52nAkd0jyPeco=; b=cAQKcp9uF7CdjcXDZ9xyn10TfK+Q6M3/BqM5ChjH5XGIBMn2EzqD9lkDukH1KB+AsG 9dYEdwXdqOmAvkmOThwYmiYE0WJwkF3pMBr+flgpU1Q8v5uNXWfOOopRuQYyXUVyWtUV ZF+PX/2j4fX3nepQ/ih3JNq5HxdfJngnyHi6RnMOvhEmPUuJ8STGyfRu+rjD6bfWw+5P +5o2qOX7OUdHalDbV9ahUWMEHl7EV2N6rUHlEr1H/zdFwqw7KBpht+/Fruyn2LXohyGd /A72arZFX3ZcsAo+2r4DgTcH3piEZUPQB7jSXi57QyefDG0W0jz7pebHdO/KiaOIl4iN LWQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wo3YGIGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd11-20020a1709069b8b00b0077d562462f5si11353761ejc.381.2022.11.14.23.22.02; Mon, 14 Nov 2022 23:22:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wo3YGIGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbiKOHRs (ORCPT + 99 others); Tue, 15 Nov 2022 02:17:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232197AbiKOHRf (ORCPT ); Tue, 15 Nov 2022 02:17:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D36F1DF07; Mon, 14 Nov 2022 23:17:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C2ADAB816E3; Tue, 15 Nov 2022 07:17:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3516CC433D7; Tue, 15 Nov 2022 07:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668496651; bh=ySbf5OGqnLlT6+c5XgtGYdkxj8KjA4c0fKuJpbK+Xa8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wo3YGIGoImxD2R2QnuP0u57S+zV8/mH+JYkL1bRXG8eVtmO1Azn4BwldRFM43gzoI u7ooUUY0c+seV9RinkoH0WjKV+FNzA9r9kQomNUPhQpsb5svlkARiZA/Yox3XHgqgh y7U+LDT5npwH9jVY1taWmP7hf9sv1EFh/Zy9waYuemMDwLjlTrFPXsrZ9BkfQgvSWA FXdvbkyJdIKk37BKZBAkkb8agytP3uU8XUOY2YkTr9PsVeHyMrmT2Ufx9eC/Om8Dqf PjR56200TJ/9m5csISkbaxXg81klMus4xZywT6V+svYAd88ochkr1csH+cBXCP5mv4 REAMkaKw7chzQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Tobias Klauser Subject: [PATCH 3/4] tty: serial: altera_jtaguart: use uart_port::read_status_mask Date: Tue, 15 Nov 2022 08:17:23 +0100 Message-Id: <20221115071724.5185-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221115071724.5185-1-jirislaby@kernel.org> References: <20221115071724.5185-1-jirislaby@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749545865289081163?= X-GMAIL-MSGID: =?utf-8?q?1749545865289081163?= Instead of self-defined struct altera_jtaguart::imr, use preexisting uart_port::read_status_mask. Note that imr was ulong. But there is no reason for that, its values are uints. And readl/writel's are used to read it/write to it. Cc: Tobias Klauser Signed-off-by: Jiri Slaby (SUSE) Reviewed-by: Tobias Klauser --- drivers/tty/serial/altera_jtaguart.c | 41 +++++++++++----------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index b83eade64b22..6808abd27785 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -55,7 +55,6 @@ */ struct altera_jtaguart { struct uart_port port; - unsigned long imr; /* Local IMR mirror */ }; static unsigned int altera_jtaguart_tx_space(struct uart_port *port, u32 *ctlp) @@ -84,29 +83,23 @@ static void altera_jtaguart_set_mctrl(struct uart_port *port, unsigned int sigs) static void altera_jtaguart_start_tx(struct uart_port *port) { - struct altera_jtaguart *pp = - container_of(port, struct altera_jtaguart, port); - - pp->imr |= ALTERA_JTAGUART_CONTROL_WE_MSK; - writel(pp->imr, port->membase + ALTERA_JTAGUART_CONTROL_REG); + port->read_status_mask |= ALTERA_JTAGUART_CONTROL_WE_MSK; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); } static void altera_jtaguart_stop_tx(struct uart_port *port) { - struct altera_jtaguart *pp = - container_of(port, struct altera_jtaguart, port); - - pp->imr &= ~ALTERA_JTAGUART_CONTROL_WE_MSK; - writel(pp->imr, port->membase + ALTERA_JTAGUART_CONTROL_REG); + port->read_status_mask &= ~ALTERA_JTAGUART_CONTROL_WE_MSK; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); } static void altera_jtaguart_stop_rx(struct uart_port *port) { - struct altera_jtaguart *pp = - container_of(port, struct altera_jtaguart, port); - - pp->imr &= ~ALTERA_JTAGUART_CONTROL_RE_MSK; - writel(pp->imr, port->membase + ALTERA_JTAGUART_CONTROL_REG); + port->read_status_mask &= ~ALTERA_JTAGUART_CONTROL_RE_MSK; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); } static void altera_jtaguart_break_ctl(struct uart_port *port, int break_state) @@ -163,7 +156,7 @@ static irqreturn_t altera_jtaguart_interrupt(int irq, void *data) unsigned int isr; isr = (readl(port->membase + ALTERA_JTAGUART_CONTROL_REG) >> - ALTERA_JTAGUART_CONTROL_RI_OFF) & pp->imr; + ALTERA_JTAGUART_CONTROL_RI_OFF) & port->read_status_mask; spin_lock(&port->lock); @@ -187,8 +180,6 @@ static void altera_jtaguart_config_port(struct uart_port *port, int flags) static int altera_jtaguart_startup(struct uart_port *port) { - struct altera_jtaguart *pp = - container_of(port, struct altera_jtaguart, port); unsigned long flags; int ret; @@ -203,8 +194,9 @@ static int altera_jtaguart_startup(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); /* Enable RX interrupts now */ - pp->imr = ALTERA_JTAGUART_CONTROL_RE_MSK; - writel(pp->imr, port->membase + ALTERA_JTAGUART_CONTROL_REG); + port->read_status_mask = ALTERA_JTAGUART_CONTROL_RE_MSK; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); spin_unlock_irqrestore(&port->lock, flags); @@ -213,15 +205,14 @@ static int altera_jtaguart_startup(struct uart_port *port) static void altera_jtaguart_shutdown(struct uart_port *port) { - struct altera_jtaguart *pp = - container_of(port, struct altera_jtaguart, port); unsigned long flags; spin_lock_irqsave(&port->lock, flags); /* Disable all interrupts now */ - pp->imr = 0; - writel(pp->imr, port->membase + ALTERA_JTAGUART_CONTROL_REG); + port->read_status_mask = 0; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); spin_unlock_irqrestore(&port->lock, flags); From patchwork Tue Nov 15 07:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 20217 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2566010wru; Mon, 14 Nov 2022 23:20:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6IybkoSQVBxgD4HrkSSAaJVJqOIz7srCOdonj0J9Kx0+994PwbzRJ0mgjohOByHSdooTwb X-Received: by 2002:a17:907:a046:b0:7ae:cbae:af1 with SMTP id gz6-20020a170907a04600b007aecbae0af1mr12187446ejc.31.1668496843211; Mon, 14 Nov 2022 23:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668496843; cv=none; d=google.com; s=arc-20160816; b=iqNTCgky5G2eOJqIQqbZQqaFyBlkcm9VhgvP/9UKNM+r+aTuTuMTl91XhLVPHshKVf iU/Wk55MG9ddyFjuJGzth+WL5pf2qwx6OirIaQvg6sBhnH+0E3qXq8UFUMxOGs4qfUim YwbjnDjTakaJtahdN8IQcBnIc0RIDm2lPJP99/rN64qGFRxSRP1R3s+2qV5XUvPH/2/o tC9OU+LgqfntSmnKEpLT/7h5ElFBkzYxWKhqd+8yhAePF2J/eSo5X0Iss/Y2UW4SWWn/ tc6Jnw4MXwEd1C5/3ugXCEy61Sr6EagmCcLtGKAZhH9g5fevJJaKxrDgY27Lci0bNv2G swpQ== 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; bh=uHLOZAoBCxM2ggx3auBDP7ULS8olXYXAI1yNvmRSbX0=; b=TCTzvctMpzK+67Kz5BO/SVbIExYOqATFwtZ4G3T47EHLx7Wr2KPukdSeSPlfZ1bUMn HlsHzVtNXai2NLK1Oq5xCiUparTbbOGjdwtikm6k5OihHAH/NQU7xtpoSf7W0kPWwCKE M7ANdDXuI7WKf/zCt1LCfio1Ckdg5oOM4wyssyVCWeu9XTNAxilDKX44O/0kAY/LePTt 0ixqrq9GRjU7MG6ImK8y8d9FlTLCnYhoBRgwwnv2zv2sfbGM39rXicUFPCCEBGsuaV3J VQc8U17/Sp7tc/DE6xhgt887XE3QdoyvbWRgHo9fQMFyqFwqwtlyg/mO2vnS5Vo532kJ GH1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K8Iu51xs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170906974d00b0073d8e4e8c77si11107927ejy.1005.2022.11.14.23.20.18; Mon, 14 Nov 2022 23:20:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K8Iu51xs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232428AbiKOHRw (ORCPT + 99 others); Tue, 15 Nov 2022 02:17:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232253AbiKOHRh (ORCPT ); Tue, 15 Nov 2022 02:17:37 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C227D1DF05; Mon, 14 Nov 2022 23:17:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77BEDB816E1; Tue, 15 Nov 2022 07:17:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E19C2C433C1; Tue, 15 Nov 2022 07:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668496653; bh=H6ycuvdmMnn4fzX+ZhFbcKEoEHYAguQOKDxX4bdPxmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K8Iu51xsk/uma9VXUC+KtCaKc2k728Hhu9iT9hakP+zjNbkf1Sm0z0curl0rL/35R PocaKKjpqrbp1nxraFy82R+x8FNWAmWrYRmzkDWtc1nijLQnzpjQnga5Er6HM1Zgqu UE0K+IhEiOpnSK2Ne/d9u/HKuE5mjx0j3/hW33KGErn967xK8DSF6p/WJHHierWd7k tQ0qy4XFdHSzoyYOiCAfd5j5sO7nu09fGYfA4X3yr7ZpLZvNOQ/Xg4aE1h53V1E+zU nWZUP4SxrvjrUrN11IqTyVScrhmx3braNGbRgsdCkbdpdK2Z6qxdNHizNUKJUVamPk 2KW6vf9csSJyA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Tobias Klauser Subject: [PATCH 4/4] tty: serial: altera_jtaguart: remove struct altera_jtaguart Date: Tue, 15 Nov 2022 08:17:24 +0100 Message-Id: <20221115071724.5185-4-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221115071724.5185-1-jirislaby@kernel.org> References: <20221115071724.5185-1-jirislaby@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749545745909848568?= X-GMAIL-MSGID: =?utf-8?q?1749545745909848568?= It contains only struct uart_port, so no need for another structure. Remove it and convert the rest to use struct uart_port directly. Cc: Tobias Klauser Signed-off-by: Jiri Slaby (SUSE) Reviewed-by: Tobias Klauser --- drivers/tty/serial/altera_jtaguart.c | 29 +++++++++------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 6808abd27785..9f843d1cee40 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -50,13 +50,6 @@ #define ALTERA_JTAGUART_CONTROL_AC_MSK 0x00000400 #define ALTERA_JTAGUART_CONTROL_WSPACE_MSK 0xFFFF0000 -/* - * Local per-uart structure. - */ -struct altera_jtaguart { - struct uart_port port; -}; - static unsigned int altera_jtaguart_tx_space(struct uart_port *port, u32 *ctlp) { u32 ctl = readl(port->membase + ALTERA_JTAGUART_CONTROL_REG); @@ -115,9 +108,8 @@ static void altera_jtaguart_set_termios(struct uart_port *port, tty_termios_copy_hw(termios, old); } -static void altera_jtaguart_rx_chars(struct altera_jtaguart *pp) +static void altera_jtaguart_rx_chars(struct uart_port *port) { - struct uart_port *port = &pp->port; unsigned char ch; unsigned long status; @@ -134,9 +126,8 @@ static void altera_jtaguart_rx_chars(struct altera_jtaguart *pp) tty_flip_buffer_push(&port->state->port); } -static void altera_jtaguart_tx_chars(struct altera_jtaguart *pp) +static void altera_jtaguart_tx_chars(struct uart_port *port) { - struct uart_port *port = &pp->port; unsigned int count; u8 ch; @@ -151,8 +142,6 @@ static void altera_jtaguart_tx_chars(struct altera_jtaguart *pp) static irqreturn_t altera_jtaguart_interrupt(int irq, void *data) { struct uart_port *port = data; - struct altera_jtaguart *pp = - container_of(port, struct altera_jtaguart, port); unsigned int isr; isr = (readl(port->membase + ALTERA_JTAGUART_CONTROL_REG) >> @@ -161,9 +150,9 @@ static irqreturn_t altera_jtaguart_interrupt(int irq, void *data) spin_lock(&port->lock); if (isr & ALTERA_JTAGUART_CONTROL_RE_MSK) - altera_jtaguart_rx_chars(pp); + altera_jtaguart_rx_chars(port); if (isr & ALTERA_JTAGUART_CONTROL_WE_MSK) - altera_jtaguart_tx_chars(pp); + altera_jtaguart_tx_chars(port); spin_unlock(&port->lock); @@ -265,7 +254,7 @@ static const struct uart_ops altera_jtaguart_ops = { }; #define ALTERA_JTAGUART_MAXPORTS 1 -static struct altera_jtaguart altera_jtaguart_ports[ALTERA_JTAGUART_MAXPORTS]; +static struct uart_port altera_jtaguart_ports[ALTERA_JTAGUART_MAXPORTS]; #if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE) @@ -308,7 +297,7 @@ static void altera_jtaguart_console_putc(struct uart_port *port, unsigned char c static void altera_jtaguart_console_write(struct console *co, const char *s, unsigned int count) { - struct uart_port *port = &(altera_jtaguart_ports + co->index)->port; + struct uart_port *port = &altera_jtaguart_ports[co->index]; uart_console_write(port, s, count, altera_jtaguart_console_putc); } @@ -320,7 +309,7 @@ static int __init altera_jtaguart_console_setup(struct console *co, if (co->index < 0 || co->index >= ALTERA_JTAGUART_MAXPORTS) return -EINVAL; - port = &altera_jtaguart_ports[co->index].port; + port = &altera_jtaguart_ports[co->index]; if (port->membase == NULL) return -ENODEV; return 0; @@ -400,7 +389,7 @@ static int altera_jtaguart_probe(struct platform_device *pdev) if (i >= ALTERA_JTAGUART_MAXPORTS) return -EINVAL; - port = &altera_jtaguart_ports[i].port; + port = &altera_jtaguart_ports[i]; res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res_mem) @@ -444,7 +433,7 @@ static int altera_jtaguart_remove(struct platform_device *pdev) if (i == -1) i = 0; - port = &altera_jtaguart_ports[i].port; + port = &altera_jtaguart_ports[i]; uart_remove_one_port(&altera_jtaguart_driver, port); iounmap(port->membase);