This is most useful to make it easier to search the calling of ifnet routines by regular expression.
No functional change intended.
MFC after: 2 weeks
Differential D52346
net: Explicitly dereference the function pointer zlei on Sep 2 2025, 5:41 PM. Authored by Tags None Referenced Files
Details
This is most useful to make it easier to search the calling of ifnet routines by regular expression. No functional change intended. MFC after: 2 weeks
Diff Detail
Event TimelineComment Actions I personally don't like the change. Readability is reduced. I also don't understand the motivation. If you use grep for ->if_transmit\( you will find all calls of the method and nothing extra. Comment Actions I'd admit this reduce readability somewhat. The motivation to keep the style of all calls of function pointers consistent. Yes I have ever grep as you suggested, but eventually I figured out that I missed some, for example # grep -Er 'if_transmit)\(' sys sys/net/if_vlan.c: error = (p->if_transmit)(p, m); sys/net/if_fwsubr.c: error = (ifp->if_transmit)(ifp, m); sys/net/if_fwsubr.c: error = (ifp->if_transmit)(ifp, m); sys/net/if.c: return ((*ifp->if_transmit)(ifp, m)); sys/net/if_tuntap.c: error = (ifp->if_transmit)(ifp, m0); sys/net/if_ethersubr.c: return ((ifp->if_transmit)(ifp, m)); sys/net/if_lagg.c: return (ifp->if_transmit)(ifp, m); sys/netgraph/ng_iface.c: error = (ifp->if_transmit)(ifp, m); sys/dev/netmap/netmap_kern.h: int (*if_transmit)(if_t, struct mbuf *); We also have IfAPI if_transmit(), so by intuition I'd like to distinguish calls to functions and that to function pointers. |