Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1ff582246de67b15e3cd2427a39875943ae895
Commit:     4d1ff582246de67b15e3cd2427a39875943ae895
Parent:     f438d914b220051d4cbc65cbc5d98e163c85c93b
Author:     Tilman Schmidt <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:27:50 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:43:10 2007 -0700

    gigaset: remove pointless locking
    
    Remove pointless taking of spinlock around reading a single pointer-sized
    or smaller variable.
    
    Signed-off-by: Tilman Schmidt <[EMAIL PROTECTED]>
    Acked-by: Karsten Keil <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/isdn/gigaset/bas-gigaset.c |    9 +--------
 drivers/isdn/gigaset/i4l.c         |   12 ++----------
 drivers/isdn/gigaset/proc.c        |    8 +-------
 drivers/isdn/gigaset/usb-gigaset.c |    7 -------
 4 files changed, 4 insertions(+), 32 deletions(-)

diff --git a/drivers/isdn/gigaset/bas-gigaset.c 
b/drivers/isdn/gigaset/bas-gigaset.c
index 00e3160..af76482 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -1936,14 +1936,7 @@ static int gigaset_write_room(struct cardstate *cs)
  */
 static int gigaset_chars_in_buffer(struct cardstate *cs)
 {
-       unsigned long flags;
-       unsigned bytes;
-
-       spin_lock_irqsave(&cs->cmdlock, flags);
-       bytes = cs->cmdbytes;
-       spin_unlock_irqrestore(&cs->cmdlock, flags);
-
-       return bytes;
+       return cs->cmdbytes;
 }
 
 /* gigaset_brkchars
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 1654fa4..9e089f0 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -109,13 +109,9 @@ EXPORT_SYMBOL_GPL(gigaset_skb_sent);
 static int command_from_LL(isdn_ctrl *cntrl)
 {
        struct cardstate *cs = gigaset_get_cs_by_id(cntrl->driver);
-       //isdn_ctrl response;
-       //unsigned long flags;
        struct bc_state *bcs;
        int retval = 0;
        struct setup_parm *sp;
-       unsigned param;
-       unsigned long flags;
 
        gigaset_debugdrivers();
 
@@ -162,12 +158,8 @@ static int command_from_LL(isdn_ctrl *cntrl)
                }
                *sp = cntrl->parm.setup;
 
-               spin_lock_irqsave(&cs->lock, flags);
-               param = bcs->at_state.seq_index;
-               spin_unlock_irqrestore(&cs->lock, flags);
-
-               if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, sp, param,
-                                      NULL)) {
+               if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, sp,
+                                      bcs->at_state.seq_index, NULL)) {
                        //FIXME what should we do?
                        kfree(sp);
                        gigaset_free_channel(bcs);
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c
index e767afa..da6f3ac 100644
--- a/drivers/isdn/gigaset/proc.c
+++ b/drivers/isdn/gigaset/proc.c
@@ -19,15 +19,9 @@
 static ssize_t show_cidmode(struct device *dev,
                            struct device_attribute *attr, char *buf)
 {
-       int ret;
-       unsigned long flags;
        struct cardstate *cs = dev_get_drvdata(dev);
 
-       spin_lock_irqsave(&cs->lock, flags);
-       ret = sprintf(buf, "%u\n", cs->cidmode);
-       spin_unlock_irqrestore(&cs->lock, flags);
-
-       return ret;
+       return sprintf(buf, "%u\n", cs->cidmode);
 }
 
 static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr,
diff --git a/drivers/isdn/gigaset/usb-gigaset.c 
b/drivers/isdn/gigaset/usb-gigaset.c
index a126301..ca4bee1 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -310,7 +310,6 @@ static void gigaset_modem_fill(unsigned long data)
        struct cardstate *cs = (struct cardstate *) data;
        struct bc_state *bcs = &cs->bcs[0]; /* only one channel */
        struct cmdbuf_t *cb;
-       unsigned long flags;
        int again;
 
        gig_dbg(DEBUG_OUTPUT, "modem_fill");
@@ -323,9 +322,7 @@ static void gigaset_modem_fill(unsigned long data)
        do {
                again = 0;
                if (!bcs->tx_skb) { /* no skb is being sent */
-                       spin_lock_irqsave(&cs->cmdlock, flags);
                        cb = cs->cmdbuf;
-                       spin_unlock_irqrestore(&cs->cmdlock, flags);
                        if (cb) { /* commands to send? */
                                gig_dbg(DEBUG_OUTPUT, "modem_fill: cb");
                                if (send_cb(cs, cb) < 0) {
@@ -546,13 +543,9 @@ static int gigaset_write_cmd(struct cardstate *cs, const 
unsigned char *buf,
 
 static int gigaset_write_room(struct cardstate *cs)
 {
-       unsigned long flags;
        unsigned bytes;
 
-       spin_lock_irqsave(&cs->cmdlock, flags);
        bytes = cs->cmdbytes;
-       spin_unlock_irqrestore(&cs->cmdlock, flags);
-
        return bytes < IF_WRITEBUF ? IF_WRITEBUF - bytes : 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to