From patchwork Sun Jan 10 21:27:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7998031 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E829E9F3F6 for ; Sun, 10 Jan 2016 21:27:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B6BF20384 for ; Sun, 10 Jan 2016 21:27:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1412B20383 for ; Sun, 10 Jan 2016 21:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757471AbcAJV1m (ORCPT ); Sun, 10 Jan 2016 16:27:42 -0500 Received: from mail-lb0-f182.google.com ([209.85.217.182]:36448 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757436AbcAJV1l (ORCPT ); Sun, 10 Jan 2016 16:27:41 -0500 Received: by mail-lb0-f182.google.com with SMTP id oh2so245649880lbb.3 for ; Sun, 10 Jan 2016 13:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=+P12VTQmcOBIMfCvlpUoUT2JdArpxXLgZ5TqBe9u3po=; b=jjD911P7FzpJzPAx7dZboc3fsNGiuiIuVQOpgbJm7lGTPmnS+kmApNnWBnGTvTqN+a LBNfeXR5dxbUmu5lUmgvmc1IcD1wNbmZ3jwoEUhClIfUhQsETOXzAMu9z9keYCdMKNL4 gMCq4Lxa5gbhaYEgRy4U4sZjkAVIZvb3b4QtiPhD0wuFPzR1k4XGbMxK+enkbNo78doK bR3IhNghoeJMLbK6vvNpgFzRfF+mCpjpdVcEJJxuMiMXLgz0sL9dqIzKASAUzrTGXsl2 6Q46N1rKBUdYL5KuR4/WW/s0VQ7OLKQeF8MawawxHHn407XVfgtgzF9jyXgj7d9e+ecl Misw== 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:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=+P12VTQmcOBIMfCvlpUoUT2JdArpxXLgZ5TqBe9u3po=; b=Du2pRM2OT08vVbwA8pdE8UWkpNCqVBbTjlUj0CFnv7H/0OXkCZYtK1KXDv71DuTwY/ AvKKa9AlOYXwGPn8B+kt+UL6WqmP+EXwcq3Fkr8WnEMwsP3IPM0VQyZOki5ZFCMExrBa zMYM1urP0tpY7UcgS0cbhZBiadmyaQ02+mR07JzL4MgcE4Zv3AuUVmzOodbT4OGEj7xd noCmDuQjwI7VD39bEC6AKtqM0LOo6jRRkVA1rwWIZ8xaKjzI6nFbsfDP9/wfwbqbbjYo fKAqfT8Zs20OlCZXLXQP8X0AyOdldAtT7Y5FsAEWORrRn80yimxVeHiw7noCEWZS4b0h ZfGw== X-Gm-Message-State: ALoCoQlnrA2q13pA7l1q6eCYCFEntVW6XRXI4WtTsJibYxZ+NsibRFxLA7hWpIDsf4yDufDGiNVlRVia90klg5GzHhUbYBHNWA== X-Received: by 10.112.167.130 with SMTP id zo2mr33954567lbb.129.1452461259929; Sun, 10 Jan 2016 13:27:39 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.80.83]) by smtp.gmail.com with ESMTPSA id k3sm10660104lbp.9.2016.01.10.13.27.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 10 Jan 2016 13:27:39 -0800 (PST) From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 1/2] ravb: stop reading ECMR in ravb_emac_init() Date: Mon, 11 Jan 2016 00:27:38 +0300 Message-ID: <1554972.rhPQTyRgNp@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.10 (Linux/4.2.8-200.fc22.x86_64; KDE/4.14.14; x86_64; ; ) In-Reply-To: <5859243.yu8qorLmay@wasted.cogentembedded.com> References: <5859243.yu8qorLmay@wasted.cogentembedded.com> MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 code in ravb_emac_init() twiddling the ECMR bits always looked a bit strange to me: if one intends to respect 'priv->duplex', why save old value of the ECMR.DM bit? As all the other bits are zeroed anyway, we don't really need to read ECMR before writing to it. Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/ravb_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net/drivers/net/ethernet/renesas/ravb_main.c =================================================================== --- net.orig/drivers/net/ethernet/renesas/ravb_main.c +++ net/drivers/net/ethernet/renesas/ravb_main.c @@ -338,16 +338,13 @@ error: static void ravb_emac_init(struct net_device *ndev) { struct ravb_private *priv = netdev_priv(ndev); - u32 ecmr; /* Receive frame limit set register */ ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR); /* PAUSE prohibition */ - ecmr = ravb_read(ndev, ECMR); - ecmr &= ECMR_DM; - ecmr |= ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE; - ravb_write(ndev, ecmr, ECMR); + ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | + ECMR_TE | ECMR_RE, ECMR); ravb_set_rate(ndev);