Re: [PATCH net-next v2 1/2] net: mana: introduce helper to get a master netdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +/* the caller should hold rcu_read_lock */ struct net_device
> > +*mana_get_master_netdev_rcu(struct mana_context *ac, u32 port_index)
> > +{
> > +	struct net_device *ndev;
> 
>  From the comments, this function requires rcu_read_lock. Can the following
> be added in this function?
> 
> RCU_LOCKDEP_WARN(!rcu_read_lock_held(), "no rcu read lock held");
> 
> If rcu_read_lock is not held, this function will notify the caller.
> This can explicitly ensure that rcu_read_lock should be held before this
> fuction is called.

Thanks! Great idea!

> 
> Best Regards,
> 
> Zhu Yanjun
> 





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux