From patchwork Mon Jun 20 16:03:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivien Didelot X-Patchwork-Id: 638110 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rYGCn69BLz9s9x for ; Tue, 21 Jun 2016 02:15:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754960AbcFTQOv (ORCPT ); Mon, 20 Jun 2016 12:14:51 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:46003 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbcFTQOt (ORCPT ); Mon, 20 Jun 2016 12:14:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 42176620EF9; Mon, 20 Jun 2016 12:03:49 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ZP49-o5biVlt; Mon, 20 Jun 2016 12:03:46 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 89611620EEE; Mon, 20 Jun 2016 12:03:45 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id wY-M7UHjTe-G; Mon, 20 Jun 2016 12:03:45 -0400 (EDT) Received: from ketchup.mtl.sfl (unknown [192.168.48.170]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 35862620EF3; Mon, 20 Jun 2016 12:03:45 -0400 (EDT) From: Vivien Didelot To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn , Florian Fainelli , Ben Dooks , Sergei Shtylyov , Vivien Didelot Subject: [PATCH v4 net-next v4 07/14] net: dsa: mv88e6xxx: remove table args in info lookup Date: Mon, 20 Jun 2016 12:03:30 -0400 Message-Id: <20160620160337.2934-8-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160620160337.2934-1-vivien.didelot@savoirfairelinux.com> References: <20160620160337.2934-1-vivien.didelot@savoirfairelinux.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The mv88e6xxx_table array and the mv88e6xxx_lookup_info function are static, so remove the table and size arguments from the lookup function. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index ec28465..75e5408 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c @@ -3590,15 +3590,13 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { }, }; -static const struct mv88e6xxx_info * -mv88e6xxx_lookup_info(unsigned int prod_num, const struct mv88e6xxx_info *table, - unsigned int num) +static const struct mv88e6xxx_info *mv88e6xxx_lookup_info(unsigned int prod_num) { int i; - for (i = 0; i < num; ++i) - if (table[i].prod_num == prod_num) - return &table[i]; + for (i = 0; i < ARRAY_SIZE(mv88e6xxx_table); ++i) + if (mv88e6xxx_table[i].prod_num == prod_num) + return &mv88e6xxx_table[i]; return NULL; } @@ -3625,8 +3623,7 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev, prod_num = (id & 0xfff0) >> 4; rev = id & 0x000f; - info = mv88e6xxx_lookup_info(prod_num, mv88e6xxx_table, - ARRAY_SIZE(mv88e6xxx_table)); + info = mv88e6xxx_lookup_info(prod_num); if (!info) return NULL; @@ -3739,8 +3736,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) prod_num = (id & 0xfff0) >> 4; rev = id & 0x000f; - ps->info = mv88e6xxx_lookup_info(prod_num, mv88e6xxx_table, - ARRAY_SIZE(mv88e6xxx_table)); + ps->info = mv88e6xxx_lookup_info(prod_num); if (!ps->info) return -ENODEV;