From patchwork Sat Mar 31 21:23:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10319019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36F2960467 for ; Sat, 31 Mar 2018 21:23:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2678D2930E for ; Sat, 31 Mar 2018 21:23:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AD8629313; Sat, 31 Mar 2018 21:23:57 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 B86F029311 for ; Sat, 31 Mar 2018 21:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751271AbeCaVX4 (ORCPT ); Sat, 31 Mar 2018 17:23:56 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35795 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbeCaVXy (ORCPT ); Sat, 31 Mar 2018 17:23:54 -0400 Received: by mail-lf0-f67.google.com with SMTP id t132-v6so16366052lfe.2 for ; Sat, 31 Mar 2018 14:23:54 -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=DC9s0MZc5czYtJBSCUOUnbpVXbvjnLY2nA1n3pZg0YY=; b=Q7TBNjPPP1XTu8paKF+8ePOkrXwFycMVYef5TCv3y/DvHldVYsbF26KI0f9C8DkTtU W058P/zNxiGGZa0kw1i5yd52aGWsMdb7KFIbogEX7v+1n0KTfsKJuyvaY0zQIM0COEfT SzIHsrr/xWDBj2w1vjSnisdHZ2oegJhZC1rN8yOGJkcGOkbw6RyJCcPAoDKWMb0E1B5r xOzsT2+RTIXCjGxX03gptPJMcYoRol1CkuY2TUR5hKItCqCrPfryaYYUgxqQV3Bo3Qyl fqrY4d2o8/UfdboW/pflXpzvaaXMLK+0Ws2Hsyy1Rh6WmFJEQ3FkcnFh2syyINdJJ6oP 5Dew== 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=DC9s0MZc5czYtJBSCUOUnbpVXbvjnLY2nA1n3pZg0YY=; b=eSSRYKh22CsaJK/4ILfP09W7sCnJkaGJlfRxy4SoUHMH1a1dBJTcvBQJL/x4nn4CpG /rjq4oEHNtSIhFHt7b2HnY4F3hnfJnnP8/XNKSbuDlnb/YIGv955lGqTHxVMR2wapfLA fZuxzWgd6+Fwu7Z8j9+6D60V0Q+cv0Mjs0wwSaNgZ0hpirSprVbNfMXFpnYdDHJmvMu7 v6ucYi5/Ixb2DKCJiT3mzEbo6pQVvZWRtwZT5EG0B+NKgBvWdBB7V+gndwrOrJFZpyBl gEhVYw77+sp7652Fg2H95LEUyoi1PsRhj7bjV+uXCYkAbl3DaYxLGVfoV1yuaV4gGXq1 LKvg== X-Gm-Message-State: ALQs6tALfBhkf96rxyXXzdzTTCHHCtahWPRYiN7g8tB7ZcQWn6rmi2by WZh4KQY8pYhyGuhxAQF06T3uhFdI6x0= X-Google-Smtp-Source: AIpwx4+UcOLaEAO3tR+GNgqW7eG+YJihtZsS7UtnUxIgCbn2a3Yn/zxgX0rBIddDNSS0Ee3rQc8SYg== X-Received: by 2002:a19:e819:: with SMTP id f25-v6mr2506200lfh.62.1522531433327; Sat, 31 Mar 2018 14:23:53 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.87.205]) by smtp.gmail.com with ESMTPSA id c29sm2000592ljd.30.2018.03.31.14.23.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Mar 2018 14:23:52 -0700 (PDT) Subject: [PATCH net-next 2/2] sh_eth: kill useless check in __sh_eth_get_regs() From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: <998029b4-9400-ebc3-51c1-623c3f72b6cc@cogentembedded.com> Organization: Cogent Embedded Message-ID: <47af0c2c-bba9-a346-1925-06c99142cbb2@cogentembedded.com> Date: Sun, 1 Apr 2018 00:23:51 +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: <998029b4-9400-ebc3-51c1-623c3f72b6cc@cogentembedded.com> Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Iff TSU registers exist on a given [G]Ether controller, they always include the CAM entry table registers (TSU_ADR{H|L}), thus the check for invalid TSU_ADRH0 offset in __sh_eth_get_regs() is useless... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 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 @@ -2153,22 +2153,17 @@ static size_t __sh_eth_get_regs(struct n add_tsu_reg(TSU_POST2); add_tsu_reg(TSU_POST3); add_tsu_reg(TSU_POST4); - if (mdp->reg_offset[TSU_ADRH0] != SH_ETH_OFFSET_INVALID) { - /* This is the start of a table, not just a single - * register. - */ - if (buf) { - unsigned int i; + /* This is the start of a table, not just a single register. */ + if (buf) { + unsigned int i; - mark_reg_valid(TSU_ADRH0); - for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES * 2; i++) - *buf++ = ioread32( - mdp->tsu_addr + - mdp->reg_offset[TSU_ADRH0] + - i * 4); - } - len += SH_ETH_TSU_CAM_ENTRIES * 2; + mark_reg_valid(TSU_ADRH0); + for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES * 2; i++) + *buf++ = ioread32(mdp->tsu_addr + + mdp->reg_offset[TSU_ADRH0] + + i * 4); } + len += SH_ETH_TSU_CAM_ENTRIES * 2; } #undef mark_reg_valid