Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030299AbbKDAWP (ORCPT ); Tue, 3 Nov 2015 19:22:15 -0500 Received: from mail-bl2on0071.outbound.protection.outlook.com ([65.55.169.71]:51661 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030203AbbKDAVM (ORCPT ); Tue, 3 Nov 2015 19:21:12 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Soren Brinkmann To: Greg Kroah-Hartman , Jiri Slaby CC: Michal Simek , , , , "Soren Brinkmann" Subject: [PATCH 1/9] tty: xuartps: Beautify read-modify writes Date: Tue, 3 Nov 2015 16:20:42 -0800 Message-ID: <1446596450-20918-2-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.6.2.3.ga463a5b In-Reply-To: <1446596450-20918-1-git-send-email-soren.brinkmann@xilinx.com> References: <1446596450-20918-1-git-send-email-soren.brinkmann@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21918.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC016;1:BOzRGjrwvz/IlNhZD363faOAc0p2wNMAWJUE2KY/92Oqz52+4rNDh7ZTaqY1zSVv8PkSS1nKVhv/mmltXkAQVsv0PZ4rZEtqLZdZxjVzXG7H8JGuZhqtH//ZXpqoPCtqFNSaHD2XaBKVcwV+HBvd4TJnTV9tdRXQnElaCKJmsk6XHUWjBcIP1k4ZKaXnr86/8JC8ryPbCCofIwoZVPeNW6eTlxyS5SBW7cR+VaIDwaAC2Tv1FKh7pQJXinFH1D4C1jjoeS9HYwWsqvHKKwL384pM0u7hBoyorEntrwHjV4AlvWc0RvycrRMQjhjaphmY61cYPqRwO5mmwUuQrZHYA9w9MS108//VfDg4+5Rql7s= X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(76506005)(19580395003)(57986006)(92566002)(107886002)(50466002)(33646002)(48376002)(47776003)(63266004)(19580405001)(189998001)(2950100001)(76176999)(16796002)(50986999)(77096005)(50226001)(6806005)(575784001)(229853001)(5001960100002)(5003940100001)(5007970100001)(81156007)(87936001)(4001430100002)(11100500001)(36756003)(5008740100001)(36386004)(86362001)(106466001)(5001770100001)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2FFO11HUB038;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB038;2:i2dUqiVhZnOiSXLDF+A54+D5vwA5QInJf1NcR610v8F87sgIu9G52vpQAUA4Ej+ZgdFhHwWfJ6wwk163JRVEvjhSb/K9KaGx2n7bZYujPzJKyuV7l8Z5W3nAI4hfExTaGlJLpY1gDSo5r0+FwWu/3V6i1GHYr5l4qm1fNttO81M=;3:ywieaYSYCF1UizVbw+iTCYK6xHINusrHuHNUGUA9kvEHt6jzFpuO/BtDFl3UaPj72xEhOJiQ8zJ+QXeIxYCZu5nMtEvM3xFbFA2JwULDANgQLUiFAocgxePWtnnPW0srhgAx08DsTSliUFvO30e48gHl6vfo3KLVqMCmmcp+Ngn6oXTTH3Fu4S/rIq3VTrghC9wGyBoW4XrdGrQiyfmdgxgXr9LrFZbPIHLmTBZBzuotNoTsbmGjDe1WyxGaQxzK7eLsVY7ZF5hpFO2nwfMklQ==;25:jRxR9IsrSNOkOw8MLr8mwj7sfv26aQxfbVGm0KCUmtnDZ05F7jCsiNP5ivkrJjCVA/1x1xx4cfbhuT3sdB07O6IC+8Xh/RCrcHq1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Rn/Js2fJwFMQzATO6wIZmgXY3eQTdliGzl2tcTMCCqBOAg+XEOwJ8rcvwsm0g2J5h/Eq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001);SRVR:BL2FFO11HUB038;BCL:0;PCL:0;RULEID:;SRVR:BL2FFO11HUB038; X-Forefront-PRVS: 0750463DC9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2FFO11HUB038;23:fUZu0P5lnpG/yzELY4IL4N237iY8cBQ+phSgrqdc?= =?us-ascii?Q?pY9NUhcVz9ArwASsK4SncVUG+j/UHpTZJhqOlTALs2D7hr9wlBg1ozBp/Pne?= =?us-ascii?Q?7GWT2POo9TCyWbMBGZi5xHBbh6wEgAjW21HE3org1Zl80lIGins8AUN2uTXh?= =?us-ascii?Q?prAbPMZRiGa2+c51U2Fi7OrSGW9ukmXEMQmzItsBZd7Eq9/Wt8muJ9vW/qub?= =?us-ascii?Q?NH9IVekwoZUqn/cOHIqJmMA8xhq2ZneMim9Q5DmMrW/6fYQsIU4pU3f+7/X5?= =?us-ascii?Q?Ew+8xheD/iCK7jj3eaUc8/1EwHsCtgz+qR6mduduUwa9ZmxROBCEriK5W3jK?= =?us-ascii?Q?a2Smvefh1gdS1zzJVJiTdM+ZZ8giGp6igl6uLaW6iH2ppggETwQcEjqybahz?= =?us-ascii?Q?eL7DSXvzcr3Kervp7LK3cJD13jBPILios1A4ZIIcOz/De7LhxO4611tENr9S?= =?us-ascii?Q?HrgKxpaHC77+lynfduZN4cCRQu8Psf1VsTk0ZYMTovue9aaAS1O56o0DTLxi?= =?us-ascii?Q?qf2gF3djWch2kRU1llrR+MPxdRmkyjdT9k05meio4n4tWQgcfuD3HyM8A2P2?= =?us-ascii?Q?rRNOmEcF/Ie4guawnOka5ceghngxrAK75mKhIF6JwrfriDgwWG9bf8qY8SO6?= =?us-ascii?Q?95v0H+nlbS9FeugLEV3rgC6LHbpdNQTPG2XB4yJ//kAo1kRzobFWVlm0kbeJ?= =?us-ascii?Q?jymq3Il1Hi/GLRyVgQeWbLyGJq7a6nLUZaFwq2EPlzSzSRNfQz7+jw1aSg13?= =?us-ascii?Q?7WKihWqUD+nq7wlvXJgp6yuZn8t57NzgFDYXejjc+dE1qEHsMF+j9RpR5zzI?= =?us-ascii?Q?pHoyeBYquvwRBISL1+Egq+UmbBaJUWexcm5hrI1K8SpMM0fjvZlIn1LOMcn9?= =?us-ascii?Q?3kjK+QbJDWw4+rD4oOBnBfPPbk3xM3keBkH944cu0JA8uV81chZCPqAQGjxA?= =?us-ascii?Q?uW9SFC6nhW2g487iDY48ZrO/zuupRvobboRNBF/Yf31lrRYCMwU3G0rSh5HB?= =?us-ascii?Q?SvMOlEg9mIyT+fONkycEHvCHNPn1KmCpbbL/eim6yiriSkShL82HkKMVGG5s?= =?us-ascii?Q?LhDE0lJPcVYW/p5KBaEQzsaUlCYqbwFBnWmz5fhZVn9bQid3rA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB038;5:y84dLlgIkC3/3a5Qh7uqEtu7FIUia1Lr97SCF0n2Izxs5GSJ/Ruw2HE45kGJ6CGJOHFp42iVJBSNN5W1DJGsdEbct/V9k+ZjaiYJLojR5uqOlPr2EDReZelcCWWjGOT80IKIRN5zapRXZEDB0K5kbA==;24:fBO3/VsU4RviWk6842SMvLWlza62bNZonn2Rd/omjZQp2wfaYHICA50rW0qkUmf8vWOO0OD66fYzdP9ETS236+vc16ijXPearbA4xPO/ptI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2015 00:21:10.8988 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2FFO11HUB038 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2024 Lines: 50 Non-functional, formatting changes to ease reading the code. Signed-off-by: Soren Brinkmann --- drivers/tty/serial/xilinx_uartps.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 009e0dbc12d2..50d4082d2354 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -515,12 +515,14 @@ static void cdns_uart_start_tx(struct uart_port *port) if (uart_circ_empty(&port->state->xmit) || uart_tx_stopped(port)) return; - status = readl(port->membase + CDNS_UART_CR_OFFSET); - /* Set the TX enable bit and clear the TX disable bit to enable the + /* + * Set the TX enable bit and clear the TX disable bit to enable the * transmitter. */ - writel((status & ~CDNS_UART_CR_TX_DIS) | CDNS_UART_CR_TX_EN, - port->membase + CDNS_UART_CR_OFFSET); + status = readl(port->membase + CDNS_UART_CR_OFFSET); + status &= ~CDNS_UART_CR_TX_DIS; + status |= CDNS_UART_CR_TX_EN; + writel(status, port->membase + CDNS_UART_CR_OFFSET); while (numbytes-- && ((readl(port->membase + CDNS_UART_SR_OFFSET) & CDNS_UART_SR_TXFULL)) != CDNS_UART_SR_TXFULL) { @@ -1123,8 +1125,9 @@ static void cdns_uart_console_write(struct console *co, const char *s, * clear the TX disable bit to enable the transmitter. */ ctrl = readl(port->membase + CDNS_UART_CR_OFFSET); - writel((ctrl & ~CDNS_UART_CR_TX_DIS) | CDNS_UART_CR_TX_EN, - port->membase + CDNS_UART_CR_OFFSET); + ctrl &= ~CDNS_UART_CR_TX_DIS; + ctrl |= CDNS_UART_CR_TX_EN; + writel(ctrl, port->membase + CDNS_UART_CR_OFFSET); uart_console_write(port, s, count, cdns_uart_console_putchar); cdns_uart_console_wait_tx(port); -- 2.6.2.3.ga463a5b -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/