Skip to content

Commit 640f41e

Browse files
edumazetkuba-moo
authored andcommitted
dpll: fix build failure due to rcu_dereference_check() on unknown type
Tasmiya reports that their compiler complains that we deref a pointer to unknown type with rcu_dereference_rtnl(): include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ Unclear what compiler it is, at the moment, and we can't report but since DPLL can't be a module - move the code from the header into the source file. Fixes: 0d60d8d ("dpll: rely on rcu for netdev_dpll_pin()") Reported-by: Tasmiya Nalatwad <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3d6423e commit 640f41e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

drivers/dpll/dpll_core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ struct dpll_pin_registration {
4242
void *priv;
4343
};
4444

45+
struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
46+
{
47+
return rcu_dereference_rtnl(dev->dpll_pin);
48+
}
49+
4550
struct dpll_device *dpll_device_get_by_id(int id)
4651
{
4752
if (xa_get_mark(&dpll_device_xa, id, DPLL_REGISTERED))

include/linux/dpll.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ int dpll_device_change_ntf(struct dpll_device *dpll);
169169

170170
int dpll_pin_change_ntf(struct dpll_pin *pin);
171171

172+
#if !IS_ENABLED(CONFIG_DPLL)
172173
static inline struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
173174
{
174-
#if IS_ENABLED(CONFIG_DPLL)
175-
return rcu_dereference_rtnl(dev->dpll_pin);
176-
#else
177175
return NULL;
178-
#endif
179176
}
177+
#else
178+
struct dpll_pin *netdev_dpll_pin(const struct net_device *dev);
179+
#endif
180180

181181
#endif

0 commit comments

Comments
 (0)