diff options
author | Tilman Schmidt <tilman@imap.cc> | 2007-10-16 04:27:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:10 -0400 |
commit | 4d1ff582246de67b15e3cd2427a39875943ae895 (patch) | |
tree | 659e1afb58fbaaf9ed70a830cb6fc6f69398d6e6 /drivers/isdn/gigaset | |
parent | f438d914b220051d4cbc65cbc5d98e163c85c93b (diff) |
gigaset: remove pointless locking
Remove pointless taking of spinlock around reading a single pointer-sized
or smaller variable.
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r-- | drivers/isdn/gigaset/bas-gigaset.c | 9 | ||||
-rw-r--r-- | drivers/isdn/gigaset/i4l.c | 12 | ||||
-rw-r--r-- | drivers/isdn/gigaset/proc.c | 8 | ||||
-rw-r--r-- | 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 00e31609a238..af7648274b38 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) | |||
1936 | */ | 1936 | */ |
1937 | static int gigaset_chars_in_buffer(struct cardstate *cs) | 1937 | static int gigaset_chars_in_buffer(struct cardstate *cs) |
1938 | { | 1938 | { |
1939 | unsigned long flags; | 1939 | return cs->cmdbytes; |
1940 | unsigned bytes; | ||
1941 | |||
1942 | spin_lock_irqsave(&cs->cmdlock, flags); | ||
1943 | bytes = cs->cmdbytes; | ||
1944 | spin_unlock_irqrestore(&cs->cmdlock, flags); | ||
1945 | |||
1946 | return bytes; | ||
1947 | } | 1940 | } |
1948 | 1941 | ||
1949 | /* gigaset_brkchars | 1942 | /* gigaset_brkchars |
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 1654fa413575..9e089f06a942 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c | |||
@@ -109,13 +109,9 @@ EXPORT_SYMBOL_GPL(gigaset_skb_sent); | |||
109 | static int command_from_LL(isdn_ctrl *cntrl) | 109 | static int command_from_LL(isdn_ctrl *cntrl) |
110 | { | 110 | { |
111 | struct cardstate *cs = gigaset_get_cs_by_id(cntrl->driver); | 111 | struct cardstate *cs = gigaset_get_cs_by_id(cntrl->driver); |
112 | //isdn_ctrl response; | ||
113 | //unsigned long flags; | ||
114 | struct bc_state *bcs; | 112 | struct bc_state *bcs; |
115 | int retval = 0; | 113 | int retval = 0; |
116 | struct setup_parm *sp; | 114 | struct setup_parm *sp; |
117 | unsigned param; | ||
118 | unsigned long flags; | ||
119 | 115 | ||
120 | gigaset_debugdrivers(); | 116 | gigaset_debugdrivers(); |
121 | 117 | ||
@@ -162,12 +158,8 @@ static int command_from_LL(isdn_ctrl *cntrl) | |||
162 | } | 158 | } |
163 | *sp = cntrl->parm.setup; | 159 | *sp = cntrl->parm.setup; |
164 | 160 | ||
165 | spin_lock_irqsave(&cs->lock, flags); | 161 | if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, sp, |
166 | param = bcs->at_state.seq_index; | 162 | bcs->at_state.seq_index, NULL)) { |
167 | spin_unlock_irqrestore(&cs->lock, flags); | ||
168 | |||
169 | if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, sp, param, | ||
170 | NULL)) { | ||
171 | //FIXME what should we do? | 163 | //FIXME what should we do? |
172 | kfree(sp); | 164 | kfree(sp); |
173 | gigaset_free_channel(bcs); | 165 | gigaset_free_channel(bcs); |
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c index e767afa55abf..da6f3acf9fd0 100644 --- a/drivers/isdn/gigaset/proc.c +++ b/drivers/isdn/gigaset/proc.c | |||
@@ -19,15 +19,9 @@ | |||
19 | static ssize_t show_cidmode(struct device *dev, | 19 | static ssize_t show_cidmode(struct device *dev, |
20 | struct device_attribute *attr, char *buf) | 20 | struct device_attribute *attr, char *buf) |
21 | { | 21 | { |
22 | int ret; | ||
23 | unsigned long flags; | ||
24 | struct cardstate *cs = dev_get_drvdata(dev); | 22 | struct cardstate *cs = dev_get_drvdata(dev); |
25 | 23 | ||
26 | spin_lock_irqsave(&cs->lock, flags); | 24 | return sprintf(buf, "%u\n", cs->cidmode); |
27 | ret = sprintf(buf, "%u\n", cs->cidmode); | ||
28 | spin_unlock_irqrestore(&cs->lock, flags); | ||
29 | |||
30 | return ret; | ||
31 | } | 25 | } |
32 | 26 | ||
33 | static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, | 27 | 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 a1263019df5e..ca4bee173cfb 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) | |||
310 | struct cardstate *cs = (struct cardstate *) data; | 310 | struct cardstate *cs = (struct cardstate *) data; |
311 | struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ | 311 | struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ |
312 | struct cmdbuf_t *cb; | 312 | struct cmdbuf_t *cb; |
313 | unsigned long flags; | ||
314 | int again; | 313 | int again; |
315 | 314 | ||
316 | gig_dbg(DEBUG_OUTPUT, "modem_fill"); | 315 | gig_dbg(DEBUG_OUTPUT, "modem_fill"); |
@@ -323,9 +322,7 @@ static void gigaset_modem_fill(unsigned long data) | |||
323 | do { | 322 | do { |
324 | again = 0; | 323 | again = 0; |
325 | if (!bcs->tx_skb) { /* no skb is being sent */ | 324 | if (!bcs->tx_skb) { /* no skb is being sent */ |
326 | spin_lock_irqsave(&cs->cmdlock, flags); | ||
327 | cb = cs->cmdbuf; | 325 | cb = cs->cmdbuf; |
328 | spin_unlock_irqrestore(&cs->cmdlock, flags); | ||
329 | if (cb) { /* commands to send? */ | 326 | if (cb) { /* commands to send? */ |
330 | gig_dbg(DEBUG_OUTPUT, "modem_fill: cb"); | 327 | gig_dbg(DEBUG_OUTPUT, "modem_fill: cb"); |
331 | if (send_cb(cs, cb) < 0) { | 328 | if (send_cb(cs, cb) < 0) { |
@@ -546,13 +543,9 @@ static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf, | |||
546 | 543 | ||
547 | static int gigaset_write_room(struct cardstate *cs) | 544 | static int gigaset_write_room(struct cardstate *cs) |
548 | { | 545 | { |
549 | unsigned long flags; | ||
550 | unsigned bytes; | 546 | unsigned bytes; |
551 | 547 | ||
552 | spin_lock_irqsave(&cs->cmdlock, flags); | ||
553 | bytes = cs->cmdbytes; | 548 | bytes = cs->cmdbytes; |
554 | spin_unlock_irqrestore(&cs->cmdlock, flags); | ||
555 | |||
556 | return bytes < IF_WRITEBUF ? IF_WRITEBUF - bytes : 0; | 549 | return bytes < IF_WRITEBUF ? IF_WRITEBUF - bytes : 0; |
557 | } | 550 | } |
558 | 551 | ||