From: Oliver W. <oli...@ol...> - 2012-05-18 21:26:33
|
Hi, The following fixes the sparse warnings: "context imbalance in 'xyz()' - different lock contexts for basic block". I tried different possibilities, but finally it boiled down to a conditional __acquire(), which achieves a balanced count on the "&adev->spinlock"-context for all cases (I suppose). If that's Ok, I'll commit it. -Oliver --- > diff --git a/inlines.h b/inlines.h > index 868f20e..803015d 100644 > --- a/inlines.h > +++ b/inlines.h > @@ -66,11 +66,15 @@ > #define acxmem_lock_flags unsigned long flags = 0 > #define acxmem_lock() \ > if (IS_MEM(adev)) \ > - spin_lock_irqsave(&adev->spinlock, flags) > + spin_lock_irqsave(&adev->spinlock, flags); \ > + else \ > + __acquire(&adev->spinlock) > > -#define acxmem_unlock() \ > - if (IS_MEM(adev)) \ > - spin_unlock_irqrestore(&adev->spinlock, flags) > +#define acxmem_unlock() \ > + if (IS_MEM(adev)) \ > + spin_unlock_irqrestore(&adev->spinlock, flags);\ > + else \ > + __release(&adev->spinlock) > > /* Endianess: read[lw], write[lw] do little-endian conversion internally */ > #define acx_readl(v) readl((v)) --- |