diff options
author | Mithlesh Thukral <mithlesh@linsyssoft.com> | 2009-02-06 19:31:40 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 14:53:12 -0700 |
commit | c5e5cf5a1824f5efbe97880bc7d667053866afc3 (patch) | |
tree | 278172504048e568c49c54d2c7e45a2ed7dddb58 /drivers/staging/sxg/sxg.h | |
parent | 7c66b14b6bfd4bf1b803be5ba3cc2e2e31d784de (diff) |
Staging: sxg: Removed unnecessary checks while taking Transmit Locks
Fix the locking issue of locks in transmit code path.
There was an unnecessary check for interrupt context in transmit code path.
Removed that.
Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sxg/sxg.h')
-rw-r--r-- | drivers/staging/sxg/sxg.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/staging/sxg/sxg.h b/drivers/staging/sxg/sxg.h index 81d16803169..e937d4b8e81 100644 --- a/drivers/staging/sxg/sxg.h +++ b/drivers/staging/sxg/sxg.h @@ -244,20 +244,14 @@ struct sxg_stats { } /* SGL macros */ -#define SXG_FREE_SGL_BUFFER(_pAdapt, _Sgl, _NB, _irq) { \ - if(!_irq) \ - spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \ - else \ - spin_lock(&(_pAdapt)->SglQLock); \ +#define SXG_FREE_SGL_BUFFER(_pAdapt, _Sgl, _NB) { \ + spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \ (_pAdapt)->FreeSglBufferCount++; \ ASSERT((_pAdapt)->AllSglBufferCount >= (_pAdapt)->FreeSglBufferCount); \ ASSERT(!((_Sgl)->State & SXG_BUFFER_FREE)); \ (_Sgl)->State = SXG_BUFFER_FREE; \ InsertTailList(&(_pAdapt)->FreeSglBuffers, &(_Sgl)->FreeList); \ - if(!_irq) \ - spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags); \ - else \ - spin_unlock(&(_pAdapt)->SglQLock); \ + spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags); \ } /* @@ -280,7 +274,7 @@ struct sxg_stats { if(!_irq) \ spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \ else \ - spin_lock(&(_pAdapt)->SglQLock); \ + spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \ if((_pAdapt)->FreeSglBufferCount) { \ ASSERT(!(IsListEmpty(&(_pAdapt)->FreeSglBuffers))); \ _ple = RemoveHeadList(&(_pAdapt)->FreeSglBuffers); \ @@ -294,7 +288,7 @@ struct sxg_stats { if(!_irq) \ spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags);\ else \ - spin_unlock(&(_pAdapt)->SglQLock); \ + spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags);\ } /* |