diff options
author | Dimitris Michailidis <dm@chelsio.com> | 2010-12-14 16:36:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-16 16:16:02 -0500 |
commit | ba27816cd8167c64652406d86ca78bcc5989f20f (patch) | |
tree | 8185a4d973b641db929557ea81998d196e9793d6 /drivers/net/cxgb4 | |
parent | 8cd18ac47f9642bcd0d30d4b3521359b1896c208 (diff) |
cxgb4: correct formatting of MSI-X interrupt names
The last byte of the buffer for MSI-X names could not be used due to a
bogus -1. Also do not explicitly clear the last byte, snprintf will do
the right thing.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4')
-rw-r--r-- | drivers/net/cxgb4/cxgb4_main.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c index 089b753b8a2f..7e26fe5efbbf 100644 --- a/drivers/net/cxgb4/cxgb4_main.c +++ b/drivers/net/cxgb4/cxgb4_main.c | |||
@@ -522,39 +522,32 @@ static irqreturn_t t4_nondata_intr(int irq, void *cookie) | |||
522 | */ | 522 | */ |
523 | static void name_msix_vecs(struct adapter *adap) | 523 | static void name_msix_vecs(struct adapter *adap) |
524 | { | 524 | { |
525 | int i, j, msi_idx = 2, n = sizeof(adap->msix_info[0].desc) - 1; | 525 | int i, j, msi_idx = 2, n = sizeof(adap->msix_info[0].desc); |
526 | 526 | ||
527 | /* non-data interrupts */ | 527 | /* non-data interrupts */ |
528 | snprintf(adap->msix_info[0].desc, n, "%s", adap->name); | 528 | snprintf(adap->msix_info[0].desc, n, "%s", adap->name); |
529 | adap->msix_info[0].desc[n] = 0; | ||
530 | 529 | ||
531 | /* FW events */ | 530 | /* FW events */ |
532 | snprintf(adap->msix_info[1].desc, n, "%s-FWeventq", adap->name); | 531 | snprintf(adap->msix_info[1].desc, n, "%s-FWeventq", adap->name); |
533 | adap->msix_info[1].desc[n] = 0; | ||
534 | 532 | ||
535 | /* Ethernet queues */ | 533 | /* Ethernet queues */ |
536 | for_each_port(adap, j) { | 534 | for_each_port(adap, j) { |
537 | struct net_device *d = adap->port[j]; | 535 | struct net_device *d = adap->port[j]; |
538 | const struct port_info *pi = netdev_priv(d); | 536 | const struct port_info *pi = netdev_priv(d); |
539 | 537 | ||
540 | for (i = 0; i < pi->nqsets; i++, msi_idx++) { | 538 | for (i = 0; i < pi->nqsets; i++, msi_idx++) |
541 | snprintf(adap->msix_info[msi_idx].desc, n, "%s-Rx%d", | 539 | snprintf(adap->msix_info[msi_idx].desc, n, "%s-Rx%d", |
542 | d->name, i); | 540 | d->name, i); |
543 | adap->msix_info[msi_idx].desc[n] = 0; | ||
544 | } | ||
545 | } | 541 | } |
546 | 542 | ||
547 | /* offload queues */ | 543 | /* offload queues */ |
548 | for_each_ofldrxq(&adap->sge, i) { | 544 | for_each_ofldrxq(&adap->sge, i) |
549 | snprintf(adap->msix_info[msi_idx].desc, n, "%s-ofld%d", | 545 | snprintf(adap->msix_info[msi_idx++].desc, n, "%s-ofld%d", |
550 | adap->name, i); | 546 | adap->name, i); |
551 | adap->msix_info[msi_idx++].desc[n] = 0; | 547 | |
552 | } | 548 | for_each_rdmarxq(&adap->sge, i) |
553 | for_each_rdmarxq(&adap->sge, i) { | 549 | snprintf(adap->msix_info[msi_idx++].desc, n, "%s-rdma%d", |
554 | snprintf(adap->msix_info[msi_idx].desc, n, "%s-rdma%d", | ||
555 | adap->name, i); | 550 | adap->name, i); |
556 | adap->msix_info[msi_idx++].desc[n] = 0; | ||
557 | } | ||
558 | } | 551 | } |
559 | 552 | ||
560 | static int request_msix_queue_irqs(struct adapter *adap) | 553 | static int request_msix_queue_irqs(struct adapter *adap) |