From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932695AbdJ3SrG (ORCPT ); Mon, 30 Oct 2017 14:47:06 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:52901 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932596AbdJ3SrE (ORCPT ); Mon, 30 Oct 2017 14:47:04 -0400 X-Google-Smtp-Source: ABhQp+S1HD19uF3FoYuY8/YIIkfQac95NshtcHNfvPPiAFPw4EeG+rvMcQb3t34wkYn37cEXI+KA2w== Subject: Re: [PATCH net-next 3/7] net: dsa: get port type at parse time To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20171027195519.5931-1-vivien.didelot@savoirfairelinux.com> <20171027195519.5931-4-vivien.didelot@savoirfairelinux.com> <87she079tq.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> From: Florian Fainelli Message-ID: <0e8c7922-67c4-5fe2-339a-cf0c5c735d7c@gmail.com> Date: Mon, 30 Oct 2017 11:46:57 -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: <87she079tq.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> 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/30/2017 11:46 AM, Vivien Didelot wrote: > Hi Florian, > > Florian Fainelli writes: > >> Reviewed-by: Florian Fainelli >> >> One nit below: >> >>> static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn) >>> { >>> + struct device_node *ethernet = of_parse_phandle(dn, "ethernet", 0); >>> + struct device_node *link = of_parse_phandle(dn, "link", 0); >>> + >>> + if (ethernet) { >>> + dp->type = DSA_PORT_TYPE_CPU; >>> + } else if (link) { >>> + dp->type = DSA_PORT_TYPE_DSA; >>> + } else { >>> + dp->type = DSA_PORT_TYPE_USER; >>> + } >>> + >> >> The curly braces are probably not necessary since all of these are >> single line statements. > > I didn't mention it in the commit message because it was obvious that > the next patches will extend these condition arms. Fair enough then ;) -- Florian