From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756638AbdJLXCP (ORCPT ); Thu, 12 Oct 2017 19:02:15 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:52224 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753667AbdJLXCM (ORCPT ); Thu, 12 Oct 2017 19:02:12 -0400 X-Google-Smtp-Source: ABhQp+Q2YP9AdpFlcIBQTEFvUpH0kaTy1xqBshcEn0/aVtvQGahtUKjbZV5GyAZyfE9FPz3AwspfGw== Subject: Re: [PATCH net-next 4/5] net: dsa: add slave get master helper To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20171012225156.20758-1-vivien.didelot@savoirfairelinux.com> <20171012225156.20758-5-vivien.didelot@savoirfairelinux.com> From: Florian Fainelli Message-ID: Date: Thu, 12 Oct 2017 16:02:08 -0700 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: <20171012225156.20758-5-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/2017 03:51 PM, Vivien Didelot wrote: > Many part of the DSA slave code require to get the master device > assigned to a slave device. Remove dsa_master_netdev() in favor of a > dsa_slave_get_master() helper which does that. > > Signed-off-by: Vivien Didelot > --- > +static inline struct net_device * > +dsa_slave_get_master(const struct net_device *dev) > +{ > + struct dsa_port *dp = dsa_slave_to_port(dev); > + > + return dp->cpu_dp->netdev; > +} Nit: _get may convey the idea that a reference count may be incremented when the function is called (balanced with a _put), so maybe name it dsa_slave_to_master() which is more in line with dsa_slave_to_port() as well? Other than that: Reviewed-by: Florian Fainelli -- Florian