Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030264AbbKSUPT (ORCPT ); Thu, 19 Nov 2015 15:15:19 -0500 Received: from mail-bl2nam02on0083.outbound.protection.outlook.com ([104.47.38.83]:1519 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030201AbbKSUPR (ORCPT ); Thu, 19 Nov 2015 15:15:17 -0500 X-Greylist: delayed 847 seconds by postgrey-1.27 at vger.kernel.org; Thu, 19 Nov 2015 15:15:16 EST Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Soren Brinkmann To: Greg Kroah-Hartman , Jiri Slaby CC: Michal Simek , , , , "Soren Brinkmann" Subject: [PATH RESEND v2 01/10] tty: xuartps: Beautify read-modify writes Date: Thu, 19 Nov 2015 12:02:15 -0800 Message-ID: <1447963344-16266-2-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.6.3.3.g9bb996a In-Reply-To: <1447963344-16266-1-git-send-email-soren.brinkmann@xilinx.com> References: <1447963344-16266-1-git-send-email-soren.brinkmann@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21950.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(586003)(229853001)(48376002)(81156007)(50466002)(5001770100001)(50986999)(11100500001)(19580395003)(189998001)(5001960100002)(5001920100001)(5003940100001)(5007970100001)(19580405001)(87936001)(63266004)(5008740100001)(77096005)(36756003)(33646002)(92566002)(106466001)(575784001)(86362001)(36386004)(47776003)(76176999)(2950100001)(76506005)(107886002)(6806005)(57986006)(4001430100002)(50226001)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1NAM02HT203;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-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:SN1NAM02HT203; X-Microsoft-Antispam-PRVS: <75e88a5c6553495ea785f5520d474db3@SN1NAM02HT203.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(10201501046)(3002001);SRVR:SN1NAM02HT203;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT203; X-Forefront-PRVS: 07658B8EA3 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2015 20:01:08.1544 (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: SN1NAM02HT203 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.3.3.g9bb996a -- 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/