From patchwork Mon Jul 23 18:15:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10540723 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D0D417FD for ; Mon, 23 Jul 2018 18:15:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39A0C2832D for ; Mon, 23 Jul 2018 18:15:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3761A2837E; Mon, 23 Jul 2018 18:15:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC33328387 for ; Mon, 23 Jul 2018 18:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387873AbeGWTSR (ORCPT ); Mon, 23 Jul 2018 15:18:17 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:44438 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388222AbeGWTSQ (ORCPT ); Mon, 23 Jul 2018 15:18:16 -0400 Received: by mail-lj1-f195.google.com with SMTP id q127-v6so1326866ljq.11 for ; Mon, 23 Jul 2018 11:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A7/by9D57iv+IDd6hfD30wyQr9uWOQORPG9j8HUs/hU=; b=whCeSL2GbI7qLu3tbZ9TyFqRymihrta5ODi+UZI4/wn5NumnbyQFIYcW1vS5MhUtUy v2h80cXMVw++r5ffwGs8p2TtgB/SD2WC/tYpsAQZ+i9AggS2mNN2jFbemrKyAnz1sUHV FKaJG3WFmEEjk8VGC+dLFhXjoqOMxjnl2JBf3eS9rY7130FgE92Wxc/N/XmrJvpSxVV+ DPXt8PKUl2eeSHQwroZTy2EmxJPE0LYC7knJGnJbFMrKRZyz27AVJ/aUwuDLv31VlP2X l2BfWGnTkIDCx9KRBN4jE+7x9YpYQXXi2V2eYxl/uqyjhSFlPsbSkPHHqCTQiAz4zxg8 SLlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=A7/by9D57iv+IDd6hfD30wyQr9uWOQORPG9j8HUs/hU=; b=egE2+ZeVe8kDXiqIlmUm+vGoEBJUy64PSCdc/Q8sXXOkJl69262PVPu0tjdKV/QoJD poxLUyWTU6uqgnEb75ppef07H+LbIEC9kuUepnSV2c+Wj9T83eZKRpHuCQIfD8auNelM tWAXaLlFidApo8qD9zT/ZllyjN6KRV30ejV+z4dqKYNLXaUr/9vIA5YPKTBpX8mrsYAx 6HhyHadPIcFINBzCPrnuvH2iaKVW2svo1PCBdJlUP/C3cwgssLyEepiq3apcs5vKeX9i hBePq3Il8ORxOCYPMI3qFZh5prVKDOZlwm8IhdzyZ0sEkwG06buX4xQ7cc2ytHcSdESH DPGw== X-Gm-Message-State: AOUpUlFGssFI9PO2io3iVkGY6RI3IWtLUGeyhEaCYrrFcoWS6EWvrCGz oFrKnXoL1wztP+NvsGou+RENlQM9xTw= X-Google-Smtp-Source: AAOMgpclh1RvWSzlp5jThvxYyDGigPkAr0thevEl9/6oK0a/DLD7br5Gorw0mT6FHcgdYyTdkcQjJg== X-Received: by 2002:a2e:96d8:: with SMTP id d24-v6mr10544674ljj.50.1532369748930; Mon, 23 Jul 2018 11:15:48 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.85.93]) by smtp.gmail.com with ESMTPSA id 20-v6sm1915592ljs.32.2018.07.23.11.15.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 11:15:48 -0700 (PDT) Subject: [PATCH 5/5] sh_eth: make sh_eth_tsu_{read|write}_entry() prototypes symmetric From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org References: <24093fd0-1b9b-a211-f988-0272483185d6@cogentembedded.com> Organization: Cogent Embedded Message-ID: <93618d2e-86b6-e467-b577-632a25cb2c4c@cogentembedded.com> Date: Mon, 23 Jul 2018 21:15:47 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <24093fd0-1b9b-a211-f988-0272483185d6@cogentembedded.com> Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sh_eth_tsu_read_entry() is still asymmetric with sh_eth_tsu_write_entry() WRT their prototypes -- make them symmetric by passing to the former a TSU register offset instead of its address and also adding the (now necessary) 'ndev' parameter... Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 @@ -2695,16 +2695,17 @@ static int sh_eth_tsu_write_entry(struct return 0; } -static void sh_eth_tsu_read_entry(void *reg, u8 *addr) +static void sh_eth_tsu_read_entry(struct net_device *ndev, u16 offset, u8 *addr) { + struct sh_eth_private *mdp = netdev_priv(ndev); u32 val; - val = ioread32(reg); + val = ioread32(mdp->tsu_addr + offset); addr[0] = (val >> 24) & 0xff; addr[1] = (val >> 16) & 0xff; addr[2] = (val >> 8) & 0xff; addr[3] = val & 0xff; - val = ioread32(reg + 4); + val = ioread32(mdp->tsu_addr + offset + 4); addr[4] = (val >> 8) & 0xff; addr[5] = val & 0xff; } @@ -2718,7 +2719,7 @@ static int sh_eth_tsu_find_entry(struct u8 c_addr[ETH_ALEN]; for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) { - sh_eth_tsu_read_entry(mdp->tsu_addr + reg_offset, c_addr); + sh_eth_tsu_read_entry(ndev, reg_offset, c_addr); if (ether_addr_equal(addr, c_addr)) return i; } @@ -2839,7 +2840,7 @@ static void sh_eth_tsu_purge_mcast(struc return; for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) { - sh_eth_tsu_read_entry(mdp->tsu_addr + reg_offset, addr); + sh_eth_tsu_read_entry(ndev, reg_offset, addr); if (is_multicast_ether_addr(addr)) sh_eth_tsu_del_entry(ndev, addr); }