{"id":815631,"url":"http://patchwork.ozlabs.org/api/patches/815631/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170919155700.14474-3-vivien.didelot@savoirfairelinux.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170919155700.14474-3-vivien.didelot@savoirfairelinux.com>","list_archive_url":null,"date":"2017-09-19T15:56:58","name":"[net-next,2/4] net: dsa: setup master ethtool unconditionally","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"cde394d4f24f7815125daf3fa72a76217af4f490","submitter":{"id":15889,"url":"http://patchwork.ozlabs.org/api/people/15889/?format=json","name":"Vivien Didelot","email":"vivien.didelot@savoirfairelinux.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170919155700.14474-3-vivien.didelot@savoirfairelinux.com/mbox/","series":[{"id":3916,"url":"http://patchwork.ozlabs.org/api/series/3916/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=3916","date":"2017-09-19T15:56:59","name":"net: dsa: move master ethtool code","version":1,"mbox":"http://patchwork.ozlabs.org/series/3916/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/815631/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/815631/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xxSKn3QVXz9sPk\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 20 Sep 2017 02:01:33 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751521AbdISQAr (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 19 Sep 2017 12:00:47 -0400","from mail.savoirfairelinux.com ([208.88.110.44]:46176 \"EHLO\n\tmail.savoirfairelinux.com\" rhost-flags-OK-OK-OK-OK) by\n\tvger.kernel.org with ESMTP id S1751284AbdISQAp (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 19 Sep 2017 12:00:45 -0400","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id 4AE329C2C9A;\n\tTue, 19 Sep 2017 12:00:45 -0400 (EDT)","from mail.savoirfairelinux.com ([127.0.0.1])\n\tby localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new,\n\tport 10032)\n\twith ESMTP id 8LkMOCPzRXNK; Tue, 19 Sep 2017 12:00:44 -0400 (EDT)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id D2BD39C2CA9;\n\tTue, 19 Sep 2017 12:00:44 -0400 (EDT)","from mail.savoirfairelinux.com ([127.0.0.1])\n\tby localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new,\n\tport 10026)\n\twith ESMTP id aVTe0VA8wL71; Tue, 19 Sep 2017 12:00:44 -0400 (EDT)","from weeman.mtl.sfl (unknown [192.168.49.104])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTPSA id A0C699C2C9A;\n\tTue, 19 Sep 2017 12:00:44 -0400 (EDT)"],"X-Virus-Scanned":"amavisd-new at mail.savoirfairelinux.com","From":"Vivien Didelot <vivien.didelot@savoirfairelinux.com>","To":"netdev@vger.kernel.org","Cc":"linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tFlorian Fainelli <f.fainelli@gmail.com>, Andrew Lunn <andrew@lunn.ch>,\n\tVivien Didelot <vivien.didelot@savoirfairelinux.com>","Subject":"[PATCH net-next 2/4] net: dsa: setup master ethtool unconditionally","Date":"Tue, 19 Sep 2017 11:56:58 -0400","Message-Id":"<20170919155700.14474-3-vivien.didelot@savoirfairelinux.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170919155700.14474-1-vivien.didelot@savoirfairelinux.com>","References":"<20170919155700.14474-1-vivien.didelot@savoirfairelinux.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"When a DSA switch tree is meant to be applied, it already has a CPU\nport. Thus remove the condition of dst->cpu_dp.\n\nMoreover, the next lines access dst->cpu_dp unconditionally.\n\nSigned-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>\n---\n net/dsa/dsa2.c | 14 +++++---------\n 1 file changed, 5 insertions(+), 9 deletions(-)","diff":"diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c\nindex 873af0108e24..bd19304f862f 100644\n--- a/net/dsa/dsa2.c\n+++ b/net/dsa/dsa2.c\n@@ -433,11 +433,9 @@ static int dsa_dst_apply(struct dsa_switch_tree *dst)\n \t\t\treturn err;\n \t}\n \n-\tif (dst->cpu_dp) {\n-\t\terr = dsa_cpu_port_ethtool_setup(dst->cpu_dp);\n-\t\tif (err)\n-\t\t\treturn err;\n-\t}\n+\terr = dsa_cpu_port_ethtool_setup(dst->cpu_dp);\n+\tif (err)\n+\t\treturn err;\n \n \t/* If we use a tagging format that doesn't have an ethertype\n \t * field, make sure that all packets from this point on get\n@@ -474,10 +472,8 @@ static void dsa_dst_unapply(struct dsa_switch_tree *dst)\n \t\tdsa_ds_unapply(dst, ds);\n \t}\n \n-\tif (dst->cpu_dp) {\n-\t\tdsa_cpu_port_ethtool_restore(dst->cpu_dp);\n-\t\tdst->cpu_dp = NULL;\n-\t}\n+\tdsa_cpu_port_ethtool_restore(dst->cpu_dp);\n+\tdst->cpu_dp = NULL;\n \n \tpr_info(\"DSA: tree %d unapplied\\n\", dst->tree);\n \tdst->applied = false;\n","prefixes":["net-next","2/4"]}