[dahdi-commits] sruffell: linux/trunk r9411 - in /linux/trunk: drivers/dahdi/ drivers/dahdi/w...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Fri Sep 24 17:44:58 CDT 2010
Author: sruffell
Date: Fri Sep 24 17:44:53 2010
New Revision: 9411
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9411
Log:
Move test for DEFINE_SPINLOCK into include/dahdi/kernel.h
The check for DEFINE_SPINLOCK was spread throughout the source tree. If
not defined we can just define it in inlucde/dahdi/kernel.h. Now
include/dahdi/kernel.h is the only place that references
SPIN_LOCK_UNLOCKED (which breaks lockdep checking if DEFINE_SPINLOCK is
otherwise defined in the kernel).
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks at digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Review: https://reviewboard.asterisk.org/r/940/
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
linux/trunk/drivers/dahdi/dahdi_dynamic.c
linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c
linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c
linux/trunk/drivers/dahdi/dahdi_transcode.c
linux/trunk/drivers/dahdi/tor2.c
linux/trunk/drivers/dahdi/wct4xxp/base.c
linux/trunk/drivers/dahdi/wcte12xp/base.c
linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h
linux/trunk/drivers/dahdi/xpp/mmapdrv.c
linux/trunk/drivers/dahdi/xpp/parport_debug.c
linux/trunk/drivers/dahdi/xpp/xbus-core.c
linux/trunk/drivers/dahdi/xpp/xbus-pcm.c
linux/trunk/drivers/dahdi/xpp/xpp_usb.c
linux/trunk/include/dahdi/kernel.h
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Fri Sep 24 17:44:53 2010
@@ -375,13 +375,8 @@
static LIST_HEAD(zaptimers);
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(zaptimerlock);
static DEFINE_SPINLOCK(bigzaplock);
-#else
-static spinlock_t zaptimerlock = SPIN_LOCK_UNLOCKED;
-static spinlock_t bigzaplock = SPIN_LOCK_UNLOCKED;
-#endif
struct dahdi_zone {
atomic_t refcount;
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic.c Fri Sep 24 17:44:53 2010
@@ -113,13 +113,8 @@
struct list_head list;
};
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(dspan_lock);
static DEFINE_SPINLOCK(driver_lock);
-#else
-static spinlock_t dspan_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
-#endif
static LIST_HEAD(dspan_list);
static LIST_HEAD(driver_list);
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c Fri Sep 24 17:44:53 2010
@@ -42,11 +42,7 @@
/* We take the raw message, put it in an ethernet frame, and add a
two byte addressing header at the top for future use */
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(zlock);
-#else
-static spinlock_t zlock = SPIN_LOCK_UNLOCKED;
-#endif
static struct sk_buff_head skbs;
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c Fri Sep 24 17:44:53 2010
@@ -129,11 +129,7 @@
/**
* Lock for adding and removing items in ethmf_list
*/
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(ethmf_lock);
-#else
-static spinlock_t ethmf_lock = SPIN_LOCK_UNLOCKED;
-#endif
/**
* The active list of all running spans
@@ -401,7 +397,7 @@
unsigned char addr[ETH_ALEN];
int spans_ready = 0, index = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10)
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
unsigned long flags;
#endif
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c Fri Sep 24 17:44:53 2010
@@ -57,11 +57,7 @@
#include <dahdi/kernel.h>
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(zlock);
-#else
-static spinlock_t zlock = SPIN_LOCK_UNLOCKED;
-#endif
static struct ztdlocal {
unsigned short key;
Modified: linux/trunk/drivers/dahdi/dahdi_transcode.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_transcode.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_transcode.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_transcode.c Fri Sep 24 17:44:53 2010
@@ -46,7 +46,7 @@
* is used as a simplistic way to spread the load amongst the different hardware
* transcoders in the system. */
static LIST_HEAD(active_list);
-static spinlock_t translock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(translock);
EXPORT_SYMBOL(dahdi_transcoder_register);
EXPORT_SYMBOL(dahdi_transcoder_unregister);
Modified: linux/trunk/drivers/dahdi/tor2.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/tor2.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/tor2.c (original)
+++ linux/trunk/drivers/dahdi/tor2.c Fri Sep 24 17:44:53 2010
@@ -1129,11 +1129,7 @@
static int syncsrc = 0;
static int syncnum = 0 /* -1 */;
static int syncspan = 0;
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(synclock);
-#else
-static spinlock_t synclock = SPIN_LOCK_UNLOCKED;
-#endif
static int tor2_findsync(struct tor2 *tor)
{
Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Fri Sep 24 17:44:53 2010
@@ -2225,11 +2225,7 @@
static int syncsrc = 0;
static int syncnum = 0 /* -1 */;
static int syncspan = 0;
-#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(synclock);
-#else
-static spinlock_t synclock = SPIN_LOCK_UNLOCKED;
-#endif
static void __t4_set_rclk_src(struct t4 *wc, int span)
{
Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Fri Sep 24 17:44:53 2010
@@ -87,7 +87,6 @@
};
static struct t1 *ifaces[WC_MAX_IFACES];
-spinlock_t ifacelock = SPIN_LOCK_UNLOCKED;
struct t1_desc {
const char *name;
Modified: linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h Fri Sep 24 17:44:53 2010
@@ -77,8 +77,6 @@
#define TYPE_T1 1
#define TYPE_E1 2
-extern spinlock_t ifacelock;
-
struct command {
struct list_head node;
struct completion complete;
Modified: linux/trunk/drivers/dahdi/xpp/mmapdrv.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/mmapdrv.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/mmapdrv.c (original)
+++ linux/trunk/drivers/dahdi/xpp/mmapdrv.c Fri Sep 24 17:44:53 2010
@@ -68,7 +68,7 @@
static xbus_t *global_xbus;
static bool tx_ready = 1;
-static spinlock_t tx_ready_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(tx_ready_lock);
static struct xframe_queue txpool;
static unsigned int pcm_in_pool_count;
static bool disconnecting;
Modified: linux/trunk/drivers/dahdi/xpp/parport_debug.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/parport_debug.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/parport_debug.c (original)
+++ linux/trunk/drivers/dahdi/xpp/parport_debug.c Fri Sep 24 17:44:53 2010
@@ -36,7 +36,7 @@
void flip_parport_bit(unsigned char bitnum)
{
static unsigned char last_value;
- spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ DEFINE_SPINLOCK(lock);
unsigned long flags;
unsigned char mask;
unsigned char value;
Modified: linux/trunk/drivers/dahdi/xpp/xbus-core.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-core.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-core.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-core.c Fri Sep 24 17:44:53 2010
@@ -78,7 +78,7 @@
static void transport_destroy(xbus_t *xbus);
/* Data structures */
-static spinlock_t xbuses_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xbuses_lock);
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_xbuses = NULL;
#endif
@@ -405,7 +405,7 @@
return (xpacket_t *)(frm->packets + newlen - len);
}
-static spinlock_t serialize_dump_xframe = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(serialize_dump_xframe);
static void do_hexdump(const char msg[], byte *data, uint16_t len)
{
Modified: linux/trunk/drivers/dahdi/xpp/xbus-pcm.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-pcm.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-pcm.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-pcm.c Fri Sep 24 17:44:53 2010
@@ -55,8 +55,8 @@
* I.e: one of our AB or dahdi_ticker
*/
static struct xpp_ticker *ref_ticker = NULL;
-static spinlock_t ref_ticker_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t elect_syncer_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ref_ticker_lock);
+static DEFINE_SPINLOCK(elect_syncer_lock);
static bool force_dahdi_sync = 0; /* from /sys/bus/astribanks/drivers/xppdrv/sync */
static xbus_t *global_ticker;
static struct xpp_ticker global_ticks_series;
Modified: linux/trunk/drivers/dahdi/xpp/xpp_usb.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xpp_usb.c?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xpp_usb.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xpp_usb.c Fri Sep 24 17:44:53 2010
@@ -242,7 +242,7 @@
};
-static spinlock_t xusb_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xusb_lock);
static xusb_t *xusb_array[MAX_BUSES] = {};
static unsigned bus_count = 0;
Modified: linux/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/kernel.h?view=diff&rev=9411&r1=9410&r2=9411
==============================================================================
--- linux/trunk/include/dahdi/kernel.h (original)
+++ linux/trunk/include/dahdi/kernel.h Fri Sep 24 17:44:53 2010
@@ -1262,6 +1262,10 @@
#endif /* 2.6.26 */
#endif /* 2.6.31 */
+#ifndef DEFINE_SPINLOCK
+#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
+#endif
+
#ifndef DMA_BIT_MASK
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
#endif
More information about the dahdi-commits
mailing list