Skip to content

Commit

Permalink
dpll: fix build failure due to rcu_dereference_check() on unknown type
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Eric Dumazet authored and kuba-moo committed Feb 29, 2024
1 parent 3d6423e commit 640f41e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions drivers/dpll/dpll_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ struct dpll_pin_registration {
void *priv;
};

struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
{
return rcu_dereference_rtnl(dev->dpll_pin);
}

struct dpll_device *dpll_device_get_by_id(int id)
{
if (xa_get_mark(&dpll_device_xa, id, DPLL_REGISTERED))
Expand Down
8 changes: 4 additions & 4 deletions include/linux/dpll.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ int dpll_device_change_ntf(struct dpll_device *dpll);

int dpll_pin_change_ntf(struct dpll_pin *pin);

#if !IS_ENABLED(CONFIG_DPLL)
static inline struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
{
#if IS_ENABLED(CONFIG_DPLL)
return rcu_dereference_rtnl(dev->dpll_pin);
#else
return NULL;
#endif
}
#else
struct dpll_pin *netdev_dpll_pin(const struct net_device *dev);
#endif

#endif

0 comments on commit 640f41e

Please sign in to comment.