From patchwork Mon Dec 7 21:41:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7791301 X-Patchwork-Delegate: horms@verge.net.au 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 DA4C19F349 for ; Mon, 7 Dec 2015 21:41:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0BA92052F for ; Mon, 7 Dec 2015 21:41:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13CF7204FB for ; Mon, 7 Dec 2015 21:41:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756031AbbLGVlr (ORCPT ); Mon, 7 Dec 2015 16:41:47 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:33313 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755679AbbLGVlq (ORCPT ); Mon, 7 Dec 2015 16:41:46 -0500 Received: by lfaz4 with SMTP id z4so376450lfa.0 for ; Mon, 07 Dec 2015 13:41:45 -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=Z+ENyewRtaDhvJvfm3uS6cqe+nwzUs29KY5ebR/Xozc=; b=T5kjaNDoAPFifqz2C+DXpTsMsjsM2MgDkKVXxBsxWBLTVIxw4T4rjKODh+5uwCE3D4 raAjRHm8yWmSjj5SKD3IhQgKO1OC8ArMVe7lGvQzdVxkHcUqftlhXpoACURuam353zhg BN1HMeXf+3XsKtMtHbCkSQwXc2pqTYRndlMQyqT5GpsTo5J4u1d0ytIhmh/ZitJ/ywsa iTsbUkgO3Sl6lyENjeeGJus86YBVh9hFCxVsgRmIEYEmcO36ONBKMEbmNTBjG2D4gPoQ mhM3qE84YhxSGdheSN2tXP8tcGY9fdzZnQUduZhNvPL+W1GsrRsFR3M7DpZOIrhzkzqy h1QA== 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=Z+ENyewRtaDhvJvfm3uS6cqe+nwzUs29KY5ebR/Xozc=; b=UQUIUU99mvMJymEMLt+TPw/2Fb/w9OjA4VCbL+o6rjXjZQLbHgLOUYVwyG3EksyACn AphCCUxufjCTit2VKUZM9MsII8oQeJE8+XSKXzbovQLF+IA2Jj9t3+ZeWznFIhSwIavS oNfnuVNT7ed7xMEDH/r0UgoagoPz1//PTn2dQPdu44Vtl2nJElQoCKOKTXD0myKgSit2 gGXJ5oWXpcEpwEzFVBvSrqUIQlGn3q4sSrTfHx1ZmU65uWym0ubi61A8DJG9l0OXFO6v m0IGwGZEtCZ1boQ7fXTj9LR4Xxm11dpBpUjJlCobH++Y5Q4InogvoNE0LPJgBIrsxWdN hfBw== X-Gm-Message-State: ALoCoQmIeCMjVXHBOtIOy+p4fLmBRpjBvPmQmhstBVJkF88TOgMFYXJMoPtaf4Ekfg/VMRdXbxGu9zlP6jioPblX7kXnDrfM3Q== X-Received: by 10.25.146.201 with SMTP id u192mr7274lfd.14.1449524505340; Mon, 07 Dec 2015 13:41:45 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.81.16]) by smtp.gmail.com with ESMTPSA id dq10sm3306lbc.12.2015.12.07.13.41.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 13:41:44 -0800 (PST) From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 3/3] sh_eth: get rid of bb_{set|clr|read}() Date: Tue, 08 Dec 2015 00:41:43 +0300 Message-ID: <2620242.OINoAeziLK@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.10 (Linux/4.2.6-201.fc22.x86_64; KDE/4.14.14; x86_64; ; ) In-Reply-To: <1582774.FcjyuztLtc@wasted.cogentembedded.com> References: <1582774.FcjyuztLtc@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,T_DKIM_INVALID,T_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 After the MDIO bitbang code consolidation, there's no need anymore for bb_{set|clr}() as well as bb_read() -- just expand them inline, thus saving more LoCs... Signed-off-by: Sergei Shtylyov Acked-by: Simon Horman --- drivers/net/ethernet/renesas/sh_eth.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 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-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1015,35 +1015,20 @@ struct bb_info { void *addr; }; -/* PHY bit set */ -static void bb_set(void *addr, u32 msk) -{ - iowrite32(ioread32(addr) | msk, addr); -} - -/* PHY bit clear */ -static void bb_clr(void *addr, u32 msk) -{ - iowrite32((ioread32(addr) & ~msk), addr); -} - -/* PHY bit read */ -static int bb_read(void *addr, u32 msk) -{ - return (ioread32(addr) & msk) != 0; -} - static void sh_mdio_ctrl(struct mdiobb_ctrl *ctrl, u32 mask, int set) { struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); + u32 pir; if (bitbang->set_gate) bitbang->set_gate(bitbang->addr); + pir = ioread32(bitbang->addr); if (set) - bb_set(bitbang->addr, mask); + pir |= mask; else - bb_clr(bitbang->addr, mask); + pir &= ~mask; + iowrite32(pir, bitbang->addr); } /* Data I/O pin control */ @@ -1066,7 +1051,7 @@ static int sh_get_mdio(struct mdiobb_ctr if (bitbang->set_gate) bitbang->set_gate(bitbang->addr); - return bb_read(bitbang->addr, PIR_MDI); + return (ioread32(bitbang->addr) & PIR_MDI) != 0; } /* MDC pin control */