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' --
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Andi Kleen | Re: [PATCH] x86: Construct 32 bit boot time page tables in native format. |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: Possible regression in HTB |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
git: | |
