Received: by 10.223.164.202 with SMTP id h10csp362620wrb; Mon, 6 Nov 2017 07:53:18 -0800 (PST) X-Google-Smtp-Source: ABhQp+QhOYJ3OZoUDU038a+IxjSVbRPall9Coq66QipNd4XFb4XjPRQLAjAHIVveJ8ttgsVTxVrq X-Received: by 10.98.29.212 with SMTP id d203mr17097318pfd.226.1509983598341; Mon, 06 Nov 2017 07:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509983598; cv=none; d=google.com; s=arc-20160816; b=EQ0cAFq0YMDRlvzN9CzExjdKwOdj7Bmdr3U/EPWK2OcgtK925glzJ5gIf8Jf4A/VPK GwulMtnvOV1bWK/fimyHNvuF08ki/CMcHxESNqF2HzVhlxwDBz9UbHe91xyedX4wg0Pc 474fmD6zimAMhzwrEqABY/BAb35U5lsugcYLJZT1lllierl3BHNy6Imysqk/j6XULUKH z0XY9AqER31xfVuCI3SOPCNxIKlH5R8MyuUsZayj0rd+mfPjM3xv/o5Syijsj3J058iL wDPepqDYtk3Po8GTOrozNxj4rJXHdNg3k9ozok//wRSdy+FRkezdCxxA1BEgrKJAw2rs pGrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4lzGrO8GDem+CSGRaxwqmqDARlGZTH8LDQEgW+GYBD4=; b=KBQ+/cRJ1nUTl2/ed1y10/YmRhVKFRbV9SSdSBUVAyqq3evQPdv8lBJDT1NZQUvSGT qFb4QUtY6/he/BPQCWljfyPzi1/iKVE+6nelr/Ycjzfb/q4p2SKnnEP0KF7XcQF1N2Zf /GR9vowQxRs50dG3LA51j7KlbMJRHjLAIkvVC9LYTDASAmCOzDC0HrgNTI0kR9Bmfno2 vQq8X7W/mSPu/2umIggwNlNqjvTDaQm0+Tivf7N8je0iKSTgjAvYVRI1yHxPJvOx0efO wMSJD5pjlxUQfeLQgg3EzZHfjo0FCEyTuFnzdYLC1ZiYicb5FJ48K6YS8JsJ2zAu1KBP wycQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si4004545pld.2.2017.11.06.07.52.52; Mon, 06 Nov 2017 07:53:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753515AbdKFOU4 (ORCPT + 97 others); Mon, 6 Nov 2017 09:20:56 -0500 Received: from aibo.runbox.com ([91.220.196.211]:39242 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753312AbdKFOUz (ORCPT ); Mon, 6 Nov 2017 09:20:55 -0500 Received: from [10.9.9.212] (helo=mailfront12.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eBiGg-0006cg-K8; Mon, 06 Nov 2017 15:20:50 +0100 Received: from 93.89.113.32.ip.vitnett.no ([93.89.113.32] helo=localhost.localdomain) by mailfront12.runbox.com with esmtpsa (uid:646232 ) (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1eBiGN-00017c-7W; Mon, 06 Nov 2017 15:20:31 +0100 From: Egil Hjelmeland To: andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Egil Hjelmeland Subject: [PATCH net-next] net: dsa: lan9303: Drop port range check Date: Mon, 6 Nov 2017 15:19:49 +0100 Message-Id: <20171106141949.19806-1-privat@egil-hjelmeland.no> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that ds->num_ports is 3, there is no need to check range of "port" parameter. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 70ecd18a5e7d..320651a57c6f 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -1057,17 +1057,7 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port, { struct lan9303 *chip = ds->priv; - /* enable internal packet processing */ - switch (port) { - case 1: - case 2: - return lan9303_enable_processing_port(chip, port); - default: - dev_dbg(chip->dev, - "Error: request to power up invalid port %d\n", port); - } - - return -ENODEV; + return lan9303_enable_processing_port(chip, port); } static void lan9303_port_disable(struct dsa_switch *ds, int port, @@ -1075,18 +1065,9 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port, { struct lan9303 *chip = ds->priv; - /* disable internal packet processing */ - switch (port) { - case 1: - case 2: - lan9303_disable_processing_port(chip, port); - lan9303_phy_write(ds, chip->phy_addr_sel_strap + port, - MII_BMCR, BMCR_PDOWN); - break; - default: - dev_dbg(chip->dev, - "Error: request to power down invalid port %d\n", port); - } + lan9303_disable_processing_port(chip, port); + lan9303_phy_write(ds, chip->phy_addr_sel_strap + port, + MII_BMCR, BMCR_PDOWN); } static int lan9303_port_bridge_join(struct dsa_switch *ds, int port, -- 2.11.0 From 1583328319104875843@xxx Mon Nov 06 14:45:52 +0000 2017 X-GM-THRID: 1583328319104875843 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread