Re: [Fwd: extra spinlocking in forcedeth 0.25]
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 23 lines · you
Andrew,
could you have a look at the attached mail regarding spinlocking in your WOL patch for forcedeth?
In 0.23 -> 0.25 forcedeth diff I noticed this:
+ case
ETHTOOL_GWOL:
+ {
+ structethtool_wolinfowolinfo;
+memset(&wolinfo, 0, sizeof(wolinfo));
+ wolinfo.supported =WAKE_MAGIC;(quoted diff) +10
-0+ + spin_lock_irq(&np->lock); + if (np->wolenabled) + wolinfo.wolopts = WAKE_MAGIC; + spin_unlock_irq(&np->lock); + + if (copy_to_user(useraddr, &wolinfo, sizeof(wolinfo))) + return -EFAULT; + return 0; + }
Quoted 2 lines
IMHO this pair of lock()/unlock() is not needed
and can be safely removed.
Yeah, he's right. Absolutely no need for it there.