From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E4B6C48BD6 for ; Tue, 25 Jun 2019 23:46:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61DE32086D for ; Tue, 25 Jun 2019 23:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbfFYXp7 (ORCPT ); Tue, 25 Jun 2019 19:45:59 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:51475 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfFYXp5 (ORCPT ); Tue, 25 Jun 2019 19:45:57 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45YN8N6S1yz1rMqm; Wed, 26 Jun 2019 01:45:56 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45YN8N6GHwz20V2L; Wed, 26 Jun 2019 01:45:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id HK6oF4JvLroN; Wed, 26 Jun 2019 01:45:55 +0200 (CEST) X-Auth-Info: slaiVZ9/1MqU++YkBN/Lf2Ooh8Sf3dh49GatL/sjOGY= Received: from kurokawa.lan (ip-86-49-110-70.net.upcbroadband.cz [86.49.110.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 26 Jun 2019 01:45:55 +0200 (CEST) From: Marek Vasut To: netdev@vger.kernel.org Cc: Marek Vasut , Andrew Lunn , Florian Fainelli , Tristram Ha , Woojung Huh Subject: [PATCH V4 05/10] net: dsa: microchip: Use PORT_CTRL_ADDR() instead of indirect function call Date: Wed, 26 Jun 2019 01:43:43 +0200 Message-Id: <20190625234348.16246-6-marex@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190625234348.16246-1-marex@denx.de> References: <20190625234348.16246-1-marex@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The indirect function call to dev->dev_ops->get_port_addr() is expensive especially if called for every single register access, and only returns the value of PORT_CTRL_ADDR() macro. Use PORT_CTRL_ADDR() macro directly instead. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: New patch V3: - Rebase on next/master - Test on KSZ9477EVB V4: No change --- drivers/net/dsa/microchip/ksz9477.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index e8b96566abd9..7d209fd9f26f 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -83,7 +83,7 @@ static void ksz_port_cfg(struct ksz_device *dev, int port, int offset, u8 bits, u32 addr; u8 data; - addr = dev->dev_ops->get_port_addr(port, offset); + addr = PORT_CTRL_ADDR(port, offset); ksz_read8(dev, addr, &data); if (set) -- 2.20.1