Search Linux Wireless

Re: [PATCH 3/4] rfkill: document the rfkill struct locking

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

 



On Sat, 19 Jul 2008, Ivo van Doorn wrote:
> On Tuesday 15 July 2008, Henrique de Moraes Holschuh wrote:
> > Reorder fields in struct rfkill and add comments to make it clear
> > which fields are protected by rfkill->mutex.
> > 
> > Signed-off-by: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
> > Cc: Ivo van Doorn <IvDoorn@xxxxxxxxx>
> > ---
> >  include/linux/rfkill.h |    7 ++++---
> >  1 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> > index c5f6e54..630b573 100644
> > --- a/include/linux/rfkill.h
> > +++ b/include/linux/rfkill.h
> > @@ -89,13 +89,14 @@ struct rfkill {
> >  	const char *name;
> >  	enum rfkill_type type;
> >  
> > -	enum rfkill_state state;
> > +	void *data;
> >  	bool user_claim_unsupported;
> >  	bool user_claim;
> >  
> > +	/* the mutex serializes callbacks and also protects
> > +	 * the state */
> 
> Please move/copy the comment into the kerneldoc above the
> structure declaration as well.

Done.

> >  	struct mutex mutex;
> > -
> > -	void *data;
> 
> Not a real problem, but the data pointer doesn't need to be moved,
> since it is only used for the callback functions. So technically it is
> under the protection of the mutex as well.

Ok, I won't move it then, since it means any changes (not that anyone
should BE changing that field) would need to be under the mutex.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux