aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2014-12-10 07:41:55 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-10 15:06:09 -0500
commitf99a6fde9ab3614adbff03580a15b107f6e0e25b (patch)
treed97986bb1e3fbfd77d11a5d3688d94778abde7bb /drivers/isdn/gigaset
parentf650dd28051f5dc66986407f7b2d50e5828642cb (diff)
isdn/gigaset: elliminate unnecessary argument from send_cb()
No need to pass a member of the cardstate structure as a separate argument if the entire structure is already passed. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index c31d74626498..5f306e2eece5 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -293,7 +293,7 @@ static int gigaset_close_bchannel(struct bc_state *bcs)
293} 293}
294 294
295static int write_modem(struct cardstate *cs); 295static int write_modem(struct cardstate *cs);
296static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb); 296static int send_cb(struct cardstate *cs);
297 297
298 298
299/* Write tasklet handler: Continue sending current skb, or send command, or 299/* Write tasklet handler: Continue sending current skb, or send command, or
@@ -303,7 +303,6 @@ static void gigaset_modem_fill(unsigned long data)
303{ 303{
304 struct cardstate *cs = (struct cardstate *) data; 304 struct cardstate *cs = (struct cardstate *) data;
305 struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ 305 struct bc_state *bcs = &cs->bcs[0]; /* only one channel */
306 struct cmdbuf_t *cb;
307 306
308 gig_dbg(DEBUG_OUTPUT, "modem_fill"); 307 gig_dbg(DEBUG_OUTPUT, "modem_fill");
309 308
@@ -314,10 +313,9 @@ static void gigaset_modem_fill(unsigned long data)
314 313
315again: 314again:
316 if (!bcs->tx_skb) { /* no skb is being sent */ 315 if (!bcs->tx_skb) { /* no skb is being sent */
317 cb = cs->cmdbuf; 316 if (cs->cmdbuf) { /* commands to send? */
318 if (cb) { /* commands to send? */
319 gig_dbg(DEBUG_OUTPUT, "modem_fill: cb"); 317 gig_dbg(DEBUG_OUTPUT, "modem_fill: cb");
320 if (send_cb(cs, cb) < 0) { 318 if (send_cb(cs) < 0) {
321 gig_dbg(DEBUG_OUTPUT, 319 gig_dbg(DEBUG_OUTPUT,
322 "modem_fill: send_cb failed"); 320 "modem_fill: send_cb failed");
323 goto again; /* no callback will be called! */ 321 goto again; /* no callback will be called! */
@@ -425,9 +423,9 @@ static void gigaset_write_bulk_callback(struct urb *urb)
425 spin_unlock_irqrestore(&cs->lock, flags); 423 spin_unlock_irqrestore(&cs->lock, flags);
426} 424}
427 425
428static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb) 426static int send_cb(struct cardstate *cs)
429{ 427{
430 struct cmdbuf_t *tcb; 428 struct cmdbuf_t *cb = cs->cmdbuf;
431 unsigned long flags; 429 unsigned long flags;
432 int count; 430 int count;
433 int status = -ENOENT; 431 int status = -ENOENT;
@@ -435,26 +433,27 @@ static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb)
435 433
436 do { 434 do {
437 if (!cb->len) { 435 if (!cb->len) {
438 tcb = cb;
439
440 spin_lock_irqsave(&cs->cmdlock, flags); 436 spin_lock_irqsave(&cs->cmdlock, flags);
441 cs->cmdbytes -= cs->curlen; 437 cs->cmdbytes -= cs->curlen;
442 gig_dbg(DEBUG_OUTPUT, "send_cb: sent %u bytes, %u left", 438 gig_dbg(DEBUG_OUTPUT, "send_cb: sent %u bytes, %u left",
443 cs->curlen, cs->cmdbytes); 439 cs->curlen, cs->cmdbytes);
444 cs->cmdbuf = cb = cb->next; 440 cs->cmdbuf = cb->next;
445 if (cb) { 441 if (cs->cmdbuf) {
446 cb->prev = NULL; 442 cs->cmdbuf->prev = NULL;
447 cs->curlen = cb->len; 443 cs->curlen = cs->cmdbuf->len;
448 } else { 444 } else {
449 cs->lastcmdbuf = NULL; 445 cs->lastcmdbuf = NULL;
450 cs->curlen = 0; 446 cs->curlen = 0;
451 } 447 }
452 spin_unlock_irqrestore(&cs->cmdlock, flags); 448 spin_unlock_irqrestore(&cs->cmdlock, flags);
453 449
454 if (tcb->wake_tasklet) 450 if (cb->wake_tasklet)
455 tasklet_schedule(tcb->wake_tasklet); 451 tasklet_schedule(cb->wake_tasklet);
456 kfree(tcb); 452 kfree(cb);
453
454 cb = cs->cmdbuf;
457 } 455 }
456
458 if (cb) { 457 if (cb) {
459 count = min(cb->len, ucs->bulk_out_size); 458 count = min(cb->len, ucs->bulk_out_size);
460 gig_dbg(DEBUG_OUTPUT, "send_cb: send %d bytes", count); 459 gig_dbg(DEBUG_OUTPUT, "send_cb: send %d bytes", count);