# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2022/05/11231306
- Thread: https://ratatoskr.run/netdev/2022/05/11231200/t.md

```text
On Tue, 17 May 2022 15:33:02 -0400 Alexander Aring wrote:
> > 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 :)
```
