lkml.org 
[lkml]   [2017]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH net-next 3/7] net: dsa: get port type at parse time
Date
Hi Florian,

Florian Fainelli <f.fainelli@gmail.com> writes:

> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
>
> 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.


Thanks,

Vivien

\
 
 \ /
  Last update: 2017-10-30 19:46    [W:0.080 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site