On Thu, 2008-03-20 at 15:27 -0700, Andrew Morton wrote:#define __SPIN_LOCK_UNLOCKED(lockname) seems pretty suggestive to me, also DEFINE_SPINLOCK(x) shows the proper usage; the right thing would have been: static struct diu_hw dr = { .mode = MFB_MODE1, - .reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init), + .reg_lock = __SPIN_LOCK_UNLOCKED(dr.reg_lock), }; Where 'dr.reg_lock' is the expression to locate the actual object. Does something like this make sense to you: --- Subject: lockdep: document __SPIN_LOCK_UNLOCKED() usage Small comment clarifying the intended usage of __SPIN_LOCK_UNLOCKED() [ for the observant readers; yes this prescribes a usage that is more than strictly needed, it does however enable interesting future uses ] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> --- diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index 68d88f7..4278558 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -63,6 +63,10 @@ typedef struct { # define RW_DEP_MAP_INIT(lockname) #endif +/* + * __*_LOCK_UNLOCKED(lockname), where 'lockname' is a valid C expression + * that evaluates to the actual object being initialized. + */ #ifdef CONFIG_DEBUG_SPINLOCK # define __SPIN_LOCK_UNLOCKED(lockname) \ (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ --- Perhaps I should make the macros do something like: typecheck(spinlock_t, lockname) And sweep the tree to make it compile again. FWIW, I prefer the form: GFP_type | __GFP_modifiers For instance: 'GFP_KERNEL | __GFP_DMA | __GFP_ZERO' --
| Arjan van de Ven | [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Tilman Schmidt | git guidance |
| Vu Pham | Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| David Miller | Re: Git and GCC |
| Mike | I don't want the .git directory next to my code. |
| Steffen Prohaska | merge vs rebase: Is visualization in gitk the only problem? |
| David Kastrup | What is the idea for bare repositories? |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Falk Brockerhoff | ftp-proxy and no route to host issue |
| Pieter Verberne | Remove escape characters from file |
| Chuck Lever | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Stefan Richter | Re: [GIT]: Networking |
| jamal | Re: [LARTC] ifb and ppp |
