Shannon Nelson says: ==================== ionic: driver updates These are a couple of checkpatch cleanup patches, a bug fix, and something to alleviate memory pressure in tight places. ====================
Unified · Split
| @@ -206,6 +206,8 @@ do_check_time: · 205 unmodified lines | ||
| 206 | 206 | if (fw_status_ready != idev->fw_status_ready) { |
| 207 | 207 | bool trigger = false; |
| 208 | 208 | |
| 209 | + idev->fw_status_ready = fw_status_ready; | |
| 210 | + | |
| 209 | 211 | if (!fw_status_ready && lif && |
| 210 | 212 | !test_bit(IONIC_LIF_F_FW_RESET, lif->state) && |
| 211 | 213 | !test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) { |
| @@ -222,8 +224,6 @@ do_check_time: · 10 unmodified lines | ||
| 222 | 224 | if (trigger) { |
| 223 | 225 | struct ionic_deferred_work *work; |
| 224 | 226 | |
| 225 | − idev->fw_status_ready = fw_status_ready; | |
| 226 | − | |
| 227 | 227 | work = kzalloc(sizeof(*work), GFP_ATOMIC); |
| 228 | 228 | if (work) { |
| 229 | 229 | work->type = IONIC_DW_TYPE_LIF_RESET; |
| @@ -74,10 +74,10 @@ static void ionic_get_drvinfo(struct net_device *netdev, · 73 unmodified lines | ||
| 74 | 74 | struct ionic_lif *lif = netdev_priv(netdev); |
| 75 | 75 | struct ionic *ionic = lif->ionic; |
| 76 | 76 | |
| 77 | − strlcpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver)); | |
| 78 | − strlcpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version, | |
| 77 | + strscpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver)); | |
| 78 | + strscpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version, | |
| 79 | 79 | sizeof(drvinfo->fw_version)); |
| 80 | − strlcpy(drvinfo->bus_info, ionic_bus_info(ionic), | |
| 80 | + strscpy(drvinfo->bus_info, ionic_bus_info(ionic), | |
| 81 | 81 | sizeof(drvinfo->bus_info)); |
| 82 | 82 | } |
| 83 | 83 | |
| @@ -759,7 +759,7 @@ enum ionic_txq_desc_opcode { · 758 unmodified lines | ||
| 759 | 759 | * IONIC_TXQ_DESC_OPCODE_CSUM_HW: |
| 760 | 760 | * Offload 16-bit checksum computation to hardware. |
| 761 | 761 | * If @csum_l3 is set then the packet's L3 checksum is |
| 762 | − * updated. Similarly, if @csum_l4 is set the the L4 | |
| 762 | + * updated. Similarly, if @csum_l4 is set the L4 | |
| 763 | 763 | * checksum is updated. If @encap is set then encap header |
| 764 | 764 | * checksums are also updated. |
| 765 | 765 | * |
| @@ -1368,9 +1368,9 @@ union ionic_port_config { · 602 unmodified lines | ||
| 1368 | 1368 | * @status: link status (enum ionic_port_oper_status) |
| 1369 | 1369 | * @id: port id |
| 1370 | 1370 | * @speed: link speed (in Mbps) |
| 1371 | − * @link_down_count: number of times link went from from up to down | |
| 1371 | + * @link_down_count: number of times link went from up to down | |
| 1372 | 1372 | * @fec_type: fec type (enum ionic_port_fec_type) |
| 1373 | − * @xcvr: tranceiver status | |
| 1373 | + * @xcvr: transceiver status | |
| 1374 | 1374 | */ |
| 1375 | 1375 | struct ionic_port_status { |
| 1376 | 1376 | __le32 id; |
| @@ -393,11 +393,11 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq) · 392 unmodified lines | ||
| 393 | 393 | ionic_qcq_intr_free(lif, qcq); |
| 394 | 394 | |
| 395 | 395 | if (qcq->cq.info) { |
| 396 | − devm_kfree(dev, qcq->cq.info); | |
| 396 | + vfree(qcq->cq.info); | |
| 397 | 397 | qcq->cq.info = NULL; |
| 398 | 398 | } |
| 399 | 399 | if (qcq->q.info) { |
| 400 | − devm_kfree(dev, qcq->q.info); | |
| 400 | + vfree(qcq->q.info); | |
| 401 | 401 | qcq->q.info = NULL; |
| 402 | 402 | } |
| 403 | 403 | } |
| @@ -528,8 +528,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, · 124 unmodified lines | ||
| 528 | 528 | new->q.dev = dev; |
| 529 | 529 | new->flags = flags; |
| 530 | 530 | |
| 531 | − new->q.info = devm_kcalloc(dev, num_descs, sizeof(*new->q.info), | |
| 532 | − GFP_KERNEL); | |
| 531 | + new->q.info = vzalloc(num_descs * sizeof(*new->q.info)); | |
| 533 | 532 | if (!new->q.info) { |
| 534 | 533 | netdev_err(lif->netdev, "Cannot allocate queue info\n"); |
| 535 | 534 | err = -ENOMEM; |
| @@ -550,8 +549,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, · 14 unmodified lines | ||
| 550 | 549 | if (err) |
| 551 | 550 | goto err_out; |
| 552 | 551 | |
| 553 | − new->cq.info = devm_kcalloc(dev, num_descs, sizeof(*new->cq.info), | |
| 554 | − GFP_KERNEL); | |
| 552 | + new->cq.info = vzalloc(num_descs * sizeof(*new->cq.info)); | |
| 555 | 553 | if (!new->cq.info) { |
| 556 | 554 | netdev_err(lif->netdev, "Cannot allocate completion queue info\n"); |
| 557 | 555 | err = -ENOMEM; |
| @@ -640,14 +638,14 @@ err_out_free_cq: · 82 unmodified lines | ||
| 640 | 638 | err_out_free_q: |
| 641 | 639 | dma_free_coherent(dev, new->q_size, new->q_base, new->q_base_pa); |
| 642 | 640 | err_out_free_cq_info: |
| 643 | − devm_kfree(dev, new->cq.info); | |
| 641 | + vfree(new->cq.info); | |
| 644 | 642 | err_out_free_irq: |
| 645 | 643 | if (flags & IONIC_QCQ_F_INTR) { |
| 646 | 644 | devm_free_irq(dev, new->intr.vector, &new->napi); |
| 647 | 645 | ionic_intr_free(lif->ionic, new->intr.index); |
| 648 | 646 | } |
| 649 | 647 | err_out_free_q_info: |
| 650 | − devm_kfree(dev, new->q.info); | |
| 648 | + vfree(new->q.info); | |
| 651 | 649 | err_out_free_qcq: |
| 652 | 650 | devm_kfree(dev, new); |
| 653 | 651 | err_out: |
| @@ -3303,7 +3301,7 @@ static void ionic_lif_set_netdev_info(struct ionic_lif *lif) · 2649 unmodified lines | ||
| 3303 | 3301 | }, |
| 3304 | 3302 | }; |
| 3305 | 3303 | |
| 3306 | − strlcpy(ctx.cmd.lif_setattr.name, lif->netdev->name, | |
| 3304 | + strscpy(ctx.cmd.lif_setattr.name, lif->netdev->name, | |
| 3307 | 3305 | sizeof(ctx.cmd.lif_setattr.name)); |
| 3308 | 3306 | |
| 3309 | 3307 | ionic_adminq_post_wait(lif, &ctx); |
| @@ -151,7 +151,6 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = { · 150 unmodified lines | ||
| 151 | 151 | IONIC_RX_STAT_DESC(vlan_stripped), |
| 152 | 152 | }; |
| 153 | 153 | |
| 154 | − | |
| 155 | 154 | #define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc) |
| 156 | 155 | #define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc) |
| 157 | 156 | #define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc) |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | #include "ionic_lif.h" |
| 11 | 11 | #include "ionic_txrx.h" |
| 12 | 12 | |
| 13 | − | |
| 14 | 13 | static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell, |
| 15 | 14 | ionic_desc_cb cb_func, void *cb_arg) |
| 16 | 15 | { |