From patchwork Wed Jul 4 09:00:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10506215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5EFE4603D7 for ; Wed, 4 Jul 2018 09:03:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 491EC28D43 for ; Wed, 4 Jul 2018 09:03:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C13228D47; Wed, 4 Jul 2018 09:03:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B198B28D43 for ; Wed, 4 Jul 2018 09:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tzc14BIstq/J1fasuL0TLeCE1H7bTznzMCgamnQKoO0=; b=shvZyL95+W4wa4 vLPvXAOhTx3fG+qFOHwrrzTWWsMe5t4BLZDrNkjGhHGP7dDFZh8/jTpiUomk5D3fboh+2Xs1daq87 vbyGmoP6RhDuYzWqHnC9gwJ2zO/xs5UVm9YCxPWOAuJGw0rWb5mbpUcVU23tLExjqpQXbBJOk93GA jF6j8gw75jbaOlVDw50yStFvH66rork+Q/CxhwrNyzdqhNwpRpxR3Z0MjbTcPYtbttjf7S+EnqLo9 qiJNB/SfevJ1Ca2Y8QF+qOpxygfVwJfSk+tnA8L+UGf36GVv3RfyXaAi1TZ9lZs6kYT/1p/CytC4Y em5wycndyJbYmIYvYj3A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fadgu-0005yN-Q1; Wed, 04 Jul 2018 09:03:12 +0000 Received: from mail-co1nam03on0620.outbound.protection.outlook.com ([2a01:111:f400:fe48::620] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fadgT-0005cS-1z for linux-arm-kernel@lists.infradead.org; Wed, 04 Jul 2018 09:02:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2BkPSalFsSkPJVjHXXPW0MqHlY03OO74gBSLetpCqdU=; b=VwfM+4FqQQ9XTdHpEm1a3rVqrZzYsudLRonhN9gJyIlXPiIjO4KVDQP3CjFo6VNjGH/4vNmnSWCU5to1Z7cEVHS8xC2jx/ZO7hSwiN4usNgYdLUDFYTow9+gl8aweTmIx32gliXBvR9dbcVlcg6j/RBfbQPfFJh6fvVgyqh4FP4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by DM5PR03MB2636.namprd03.prod.outlook.com (2603:10b6:3:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.24; Wed, 4 Jul 2018 09:02:29 +0000 Date: Wed, 4 Jul 2018 17:00:40 +0800 From: Jisheng Zhang To: Andy Shevchenko , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 1/3] serial: 8250: let serial8250_get_divisor() get uart_port * as param Message-ID: <20180704170040.39ac9cf3@xhacker.debian> In-Reply-To: <20180704165908.4bb8b090@xhacker.debian> References: <20180704165908.4bb8b090@xhacker.debian> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: TYAPR01CA0152.jpnprd01.prod.outlook.com (2603:1096:404:7e::20) To DM5PR03MB2636.namprd03.prod.outlook.com (2603:10b6:3:43::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f0cc7b6-544a-455e-d5c0-08d5e18cdff3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DM5PR03MB2636; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2636; 3:A7l7j63dUpTdnbJzFfq6jHlkNgYh5uC6z1+sTijiIqP2cT8wpnT6WiHQiuJUHje1z0Z7J2DfZc4Kbf/pqANy8qH23qP3DDa1m0BKVD2oIK/40lT+phky2MeUuU/FGNi4p4LOlFYn47A4OMpAyamTmGocdov6eX0BG8IvI/Jf4fnOkEs+V/UHEZSL5AXayyJxyd4AgRUR9UstohwW42BcfggO4lyzcR3kAiO3r4c77KRYZOuOJqfWRdFVRmdHL0O5; 25:6BOp2iIhCosG2eZR5Qc4sUXExDau1YzWxt+fpBDg5EwpCyfXIjRrPk1LeZKot77GLTJetZUX/dHGPjtZds1eRpMqkzZy9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:yrZMWFZtGklZTQiLhbqK3PmAetHq9b9bsFiDYKngJW5rqDalv17j8+3txzW68hqEMfj2cBy4uywRLmXokQJNv5GJYjB2AZd0mhgAIHv9CeBjY6jQW2RlfCaIPWWUqZVxUukB6zN517guwSLr4QLfdRMHgld4qX5Iuj/mKF14i+RSVgCkymcHKZl5LhwTwdj1RNSnoZVIWSyK7shFnwQpFftkYgfWHtfjFioAy5XCnCGnBChZdCd7EOJI4EjyPVC69xuR1k+kRwwLLuuFldTGAQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM5PR03MB2636; BCL:0; PCL:0; RULEID:; SRVR:DM5PR03MB2636; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(136003)(376002)(39850400004)(199004)(189003)(1076002)(3846002)(23726003)(4326008)(6116002)(50226002)(81166006)(8936002)(68736007)(81156014)(8676002)(105586002)(7736002)(305945005)(25786009)(11346002)(6666003)(446003)(476003)(5660300001)(106356001)(956004)(486006)(2906002)(66066001)(47776003)(97736004)(53936002)(230700001)(478600001)(72206003)(55016002)(9686003)(33896004)(110136005)(14444005)(86362001)(386003)(6506007)(186003)(16526019)(26005)(15760500003)(316002)(52116002)(7696005)(50466002)(76176011)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2636; H:xhacker.debian; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-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0ZdFS19/1dJ8bRhWhQexyYwitO9MxmEHUL/oSS9r04mCD1G35dCY5G8ai+bByHeA6m3m6SGRyCyPWyo2mk2CDPFGAs8KIki+QwmLzOR1zWijjB2XEMBH6Nm+mzY4UEOy6efY16GFR/Kd6fKrnXrTY/B5zZZycqoUzO5cAHQIhXrNnhprDQ+wrxpYPg5GEkvWWkHARZEbPX4N96/W8XFe5hLi1eNFbV4SjIzZTBL9xl+IqR1nziZPZF3QOHQB1+7VbrOn/xV1oh2VPgkYMdCiEIvWxBV2UZ+a+dWvddP4U1xwK3aeyyTzvAf4QvRlc6B3eyk5P9lGC38WF1xBqLZQ==; 5:sFz/Uw35H5qIVYU32v5AIX4asxJy8cnl2uqnFMP6gJJxQiHvXUD4oLs9uJOxIfWSkSdZdUSf84d0uv9SEqtuNkMMNxyk7GDK2ZastyfWbcaPzuPYgSiNghzL/LFaolEoUYeZoPaHb1d7o8jrAvRJl3MRo6gz8XsBeiqDoa9+2ro=; 24:0Q2PiUxnaV+UsmPeiIoLO5shhe8ZwTwJDz2wdBDCQscjRHXOuMRtuGIwjZT/fwPcxsPR/pjvBcFAzjfZia84YUx/W6p5u/oVg78zm1hTj3I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2636; 7:xfyearyrBk4yvRxPgSYH+ImCDcVVJbcbcm6E4gkeuT+0ib+gJ4WNvM+CVUzCPLuM8B/V01mE40S8ASUTyzH3XMoB6wP15fejeXMhrBeiUGZBroHyoiyfq97ogw0+9Ry7zIFPKlWEmWUYsLGOy2IVMOjMHvOMWVffeMAgbMYfDPpQSpVAH69VdNnkm00CFPssVCJLgcPLxFuRFY8LgLcL3iJXlsbmTqeF6TX9a0IcXGnyDo4IbEZHh2+J//4WKsQs X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:02:29.1576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f0cc7b6-544a-455e-d5c0-08d5e18cdff3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2636 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180704_020245_683265_AFC742A3 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Align serial8250_get_divisor() with serial8250_set_divisor() to accept uart_port pointer as the first parameter. No functionality changes. Signed-off-by: Jisheng Zhang Reviewed-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_port.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index cf541aab2bd0..709fe6b4265c 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2498,11 +2498,11 @@ static unsigned int npcm_get_divisor(struct uart_8250_port *up, return DIV_ROUND_CLOSEST(port->uartclk, 16 * baud + 2) - 2; } -static unsigned int serial8250_get_divisor(struct uart_8250_port *up, +static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int baud, unsigned int *frac) { - struct uart_port *port = &up->port; + struct uart_8250_port *up = up_to_u8250p(port); unsigned int quot; /* @@ -2636,7 +2636,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, cval = serial8250_compute_lcr(up, termios->c_cflag); baud = serial8250_get_baud_rate(port, termios, old); - quot = serial8250_get_divisor(up, baud, &frac); + quot = serial8250_get_divisor(port, baud, &frac); /* * Ok, we're now changing the port state. Do it with @@ -3197,7 +3197,7 @@ static void serial8250_console_restore(struct uart_8250_port *up) termios.c_cflag = port->state->port.tty->termios.c_cflag; baud = serial8250_get_baud_rate(port, &termios, NULL); - quot = serial8250_get_divisor(up, baud, &frac); + quot = serial8250_get_divisor(port, baud, &frac); serial8250_set_divisor(port, baud, quot, frac); serial_port_out(port, UART_LCR, up->lcr);