Re: [PATCH net-next] net: ifdefy the wireless pointers in struct net_device

From
Jakub Kicinski <kuba@kernel.org>
Date
2022-05-17 19:50:03
Also in
linux-wireless
Reply to
Alexander Aring, 2022-05-17
On Tue, 17 May 2022 15:33:02 -0400 Alexander Aring wrote:
quoted
Could not we move to an union of pointers in the future since in many
cases a network device can only have one of those pointers at any given
time?  
note that ieee802154 has also functionality like __dev_get_by_index()
and checks via "if (netdev->ieee802154_ptr)" if it's a wpan interface
or not, guess the solution would be like it's done in wireless then.

Ack, but that code must live somewhere under

#if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN)

otherwise I think I'd see a build failure. I guess a nice thing about
having the typed pointers is that we can depend on the compiler for
basic checking :)
Thread (14 messages) 14 messages, 7 authors, last reply 2022-05-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help