Casts to (struct ifnet *) made sense when if_t was a void *, but
since it's a struct ifnet * it no longer makes sense. Also remove
pointless conditionals in if_setcapenable().
Sponsored by: Juniper Networks, Inc.
Differential D38499
IfAPI: Style cleanup jhibbits on Feb 10 2023, 9:35 PM. Authored by Tags None Referenced Files
Details
Casts to (struct ifnet *) made sense when if_t was a void *, but Sponsored by: Juniper Networks, Inc.
Diff Detail
Event TimelineComment Actions A lot of functions return int and that boils down to return (0);. Do you intend to make the fail in some way in the future? If yes, could you please describe what are the expected failure modes?
Comment Actions For many of the new ones that return (0); I was just following the precedent. I think the idea was originally (nearly a decade ago) that the netstack module could return an error on an accessor that doesn't exist. For instance, maybe the netstack doesn't support some capability at all, it could return an error if that capability gets set. @stevek knows better of Juniper's intentions then. I'll at least clean up the functions that simply forward to functions that return void. Comment Actions Didn't mean to override your comments! I'm pretty sure @jhibbits will address them before checking in.
|