> -----Original Message-----
> From: David Ahern <dsah...@gmail.com>
> Sent: Tuesday, July 9, 2019 10:41 PM
> To: Parav Pandit <pa...@mellanox.com>; netdev@vger.kernel.org
> Cc: step...@networkplumber.org; Jiri Pirko <j...@mellanox.com>;
> dsah...@kernel.org
> Subject: Re: [PATCH net-next iproute2] devlink: Show devlink port number
> 
> On 7/9/19 10:33 AM, Parav Pandit wrote:
> > @@ -2806,6 +2806,11 @@ static void pr_out_port(struct dl *dl, struct
> > nlattr **tb)
> >
> >             pr_out_str(dl, "flavour", port_flavour_name(port_flavour));
> >     }
> > +   if (tb[DEVLINK_ATTR_PORT_NUMBER]) {
> > +           uint32_t port_number =
> > +
>       mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_NUMBER]);
> 
> declare and assign separately; nothing is gained when it is split across lines
> like that.
>
Ok. I was misled by an example of port_flavour which assigns and declare in 
same line.
Sending v1.
 
> > +           pr_out_uint(dl, "port", port_number);
> > +   }
> >     if (tb[DEVLINK_ATTR_PORT_SPLIT_GROUP])
> >             pr_out_uint(dl, "split_group",
> >
> mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_GROUP]));

Reply via email to