lkml.org 
[lkml]   [2023]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH net-next v2 2/6] net: dcb: add new common function for set/del of app/rewr entries
Date
 > Petr Machata <petrm@nvidia.com> writes:
>
> > Daniel Machon <daniel.machon@microchip.com> writes:
> >
> >> In preparation for DCB rewrite. Add a new function for setting and
> >> deleting both app and rewrite entries. Moving this into a separate
> >> function reduces duplicate code, as both type of entries requires the
> >> same set of checks. The function will now iterate through a configurable
> >> nested attribute (app or rewrite attr), validate each attribute and call
> >> the appropriate set- or delete function.
> >>
> >> Note that this function always checks for nla_len(attr_itr) <
> >> sizeof(struct dcb_app), which was only done in dcbnl_ieee_set and not in
> >> dcbnl_ieee_del prior to this patch. This means, that any userspace tool
> >> that used to shove in data < sizeof(struct dcb_app) would now receive
> >> -ERANGE.
> >>
> >> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
> >
> > Reviewed-by: Petr Machata <petrm@nvidia.com>
>
> ... though, now that I found some issues in 3/6, if you would somehow
> reformat the ?: expression that's now awkwardly split to two unaligned
> lines, that would placate my OCD:
>
> + err = dcbnl_app_table_setdel(ieee[DCB_ATTR_IEEE_APP_TABLE],
> + netdev, ops->ieee_setapp ?:
> + dcb_ieee_setapp);

Putting the expression on the same line will violate the 80 char limit.
Does splitting it like that hurt anything - other than your OCD :-P At
least checkpatch didn't complain.

/Daniel

>
> (and the one other).
\
 
 \ /
  Last update: 2023-03-26 23:46    [W:0.231 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site