From patchwork Mon Apr 21 16:40:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4025731 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C05C1C0DA2 for ; Mon, 21 Apr 2014 16:41:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC98E2021B for ; Mon, 21 Apr 2014 16:41:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1EE1520213 for ; Mon, 21 Apr 2014 16:41:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751877AbaDUQkr (ORCPT ); Mon, 21 Apr 2014 12:40:47 -0400 Received: from mail-ie0-f201.google.com ([209.85.223.201]:38892 "EHLO mail-ie0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752834AbaDUQkk (ORCPT ); Mon, 21 Apr 2014 12:40:40 -0400 Received: by mail-ie0-f201.google.com with SMTP id rd18so902966iec.2 for ; Mon, 21 Apr 2014 09:40:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G9GILLXxLZHA7kX0HI/tA9E6W6h7h8DwuQABOmS+RGs=; b=fGzuukL1567PkP/vIKNCjD5ZEBHIQ4oR2l9KkUL8/0+VyMoHFK7uC9MXHCq1tvQMEC eZtbqRst2WdBGS90COMQzsoSZkGvqIW3nc+uX1T4+DG+woJvV5yPoOa9jxeLamllDWKH gtHSgHfCiJ5X2Jg03QxHqARoxATAqEG+yAcmyObZlHIntr+uEAy+acDABun1gXVYozsH ACs77O7ya+0FMWUbuNQX+mxOW6NmLpym5vpS+SedOjlawsthwXjhcVcnWMalhKxsXdm3 eOXCs/lgavC2XRTFBNotYvg7ruBrQue6SCLz1ZvfryDAWNK/PfIRS/xNFGunETIss2ZI 3oCQ== X-Gm-Message-State: ALoCoQlZSmNqft+GNxJsM2V5a3d4FA45KntSNpkXL7sdJOhP3s/DP5IpIMULOWb5Imha4/LYhA3r2OJGcUPqMuq+PpFydj8/KZEOcYBNZqz72n3DmKVInvI28Feqp7/yV3Qr4XwlgwYFNUOc2Wmvsr/eLoFm8sDgpR8aLwpFP2dz0+A1G55WKEec2ad0+OHqN2AF8gfWaJ0wQ/4ejAFBfFWdE9c6391jOw== X-Received: by 10.182.19.231 with SMTP id i7mr19600272obe.25.1398098439599; Mon, 21 Apr 2014 09:40:39 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id x22si5234227yhd.5.2014.04.21.09.40.39 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Apr 2014 09:40:39 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 6F13F5A4207; Mon, 21 Apr 2014 09:40:39 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 20D71800E3; Mon, 21 Apr 2014 09:40:39 -0700 (PDT) From: Doug Anderson To: Greg Kroah-Hartman , linux-samsung-soc@vger.kernel.org Cc: olof@lixom.net, Doug Anderson , jslaby@suse.cz, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] serial: samsung: don't check config for every character Date: Mon, 21 Apr 2014 09:40:35 -0700 Message-Id: <1398098436-31895-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1398098436-31895-1-git-send-email-dianders@chromium.org> References: <1398098436-31895-1-git-send-email-dianders@chromium.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The s3c24xx_serial_console_putchar() is _only_ ever used by s3c24xx_serial_console_write() and is called in a loop (indirectly through uart_console_write()). There's no reason to call s3c24xx_port_configured() for every iteration through the loop. Move it outside the loop. Signed-off-by: Doug Anderson --- drivers/tty/serial/samsung.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index a8e8b79..12442748 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1464,11 +1464,6 @@ static void s3c24xx_serial_console_putchar(struct uart_port *port, int ch) { unsigned int ufcon = rd_regl(port, S3C2410_UFCON); - unsigned int ucon = rd_regl(port, S3C2410_UCON); - - /* not possible to xmit on unconfigured port */ - if (!s3c24xx_port_configured(ucon)) - return; while (!s3c24xx_serial_console_txrdy(port, ufcon)) barrier(); @@ -1479,6 +1474,12 @@ static void s3c24xx_serial_console_write(struct console *co, const char *s, unsigned int count) { + unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); + + /* not possible to xmit on unconfigured port */ + if (!s3c24xx_port_configured(ucon)) + return; + uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar); }