Skip to content

Commit 6e2e59e

Browse files
committed
Merge branch 'ionic-driver-updates'
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. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 86213f8 + ecea8bb commit 6e2e59e

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

drivers/net/ethernet/pensando/ionic/ionic_dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ int ionic_heartbeat_check(struct ionic *ionic)
206206
if (fw_status_ready != idev->fw_status_ready) {
207207
bool trigger = false;
208208

209+
idev->fw_status_ready = fw_status_ready;
210+
209211
if (!fw_status_ready && lif &&
210212
!test_bit(IONIC_LIF_F_FW_RESET, lif->state) &&
211213
!test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) {
@@ -222,8 +224,6 @@ int ionic_heartbeat_check(struct ionic *ionic)
222224
if (trigger) {
223225
struct ionic_deferred_work *work;
224226

225-
idev->fw_status_ready = fw_status_ready;
226-
227227
work = kzalloc(sizeof(*work), GFP_ATOMIC);
228228
if (work) {
229229
work->type = IONIC_DW_TYPE_LIF_RESET;

drivers/net/ethernet/pensando/ionic/ionic_ethtool.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ static void ionic_get_drvinfo(struct net_device *netdev,
7474
struct ionic_lif *lif = netdev_priv(netdev);
7575
struct ionic *ionic = lif->ionic;
7676

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,
7979
sizeof(drvinfo->fw_version));
80-
strlcpy(drvinfo->bus_info, ionic_bus_info(ionic),
80+
strscpy(drvinfo->bus_info, ionic_bus_info(ionic),
8181
sizeof(drvinfo->bus_info));
8282
}
8383

drivers/net/ethernet/pensando/ionic/ionic_if.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ enum ionic_txq_desc_opcode {
759759
* IONIC_TXQ_DESC_OPCODE_CSUM_HW:
760760
* Offload 16-bit checksum computation to hardware.
761761
* 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
763763
* checksum is updated. If @encap is set then encap header
764764
* checksums are also updated.
765765
*
@@ -1368,9 +1368,9 @@ union ionic_port_config {
13681368
* @status: link status (enum ionic_port_oper_status)
13691369
* @id: port id
13701370
* @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
13721372
* @fec_type: fec type (enum ionic_port_fec_type)
1373-
* @xcvr: tranceiver status
1373+
* @xcvr: transceiver status
13741374
*/
13751375
struct ionic_port_status {
13761376
__le32 id;

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,11 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq)
393393
ionic_qcq_intr_free(lif, qcq);
394394

395395
if (qcq->cq.info) {
396-
devm_kfree(dev, qcq->cq.info);
396+
vfree(qcq->cq.info);
397397
qcq->cq.info = NULL;
398398
}
399399
if (qcq->q.info) {
400-
devm_kfree(dev, qcq->q.info);
400+
vfree(qcq->q.info);
401401
qcq->q.info = NULL;
402402
}
403403
}
@@ -528,8 +528,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
528528
new->q.dev = dev;
529529
new->flags = flags;
530530

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));
533532
if (!new->q.info) {
534533
netdev_err(lif->netdev, "Cannot allocate queue info\n");
535534
err = -ENOMEM;
@@ -550,8 +549,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
550549
if (err)
551550
goto err_out;
552551

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));
555553
if (!new->cq.info) {
556554
netdev_err(lif->netdev, "Cannot allocate completion queue info\n");
557555
err = -ENOMEM;
@@ -640,14 +638,14 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
640638
err_out_free_q:
641639
dma_free_coherent(dev, new->q_size, new->q_base, new->q_base_pa);
642640
err_out_free_cq_info:
643-
devm_kfree(dev, new->cq.info);
641+
vfree(new->cq.info);
644642
err_out_free_irq:
645643
if (flags & IONIC_QCQ_F_INTR) {
646644
devm_free_irq(dev, new->intr.vector, &new->napi);
647645
ionic_intr_free(lif->ionic, new->intr.index);
648646
}
649647
err_out_free_q_info:
650-
devm_kfree(dev, new->q.info);
648+
vfree(new->q.info);
651649
err_out_free_qcq:
652650
devm_kfree(dev, new);
653651
err_out:
@@ -3303,7 +3301,7 @@ static void ionic_lif_set_netdev_info(struct ionic_lif *lif)
33033301
},
33043302
};
33053303

3306-
strlcpy(ctx.cmd.lif_setattr.name, lif->netdev->name,
3304+
strscpy(ctx.cmd.lif_setattr.name, lif->netdev->name,
33073305
sizeof(ctx.cmd.lif_setattr.name));
33083306

33093307
ionic_adminq_post_wait(lif, &ctx);

drivers/net/ethernet/pensando/ionic/ionic_stats.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = {
151151
IONIC_RX_STAT_DESC(vlan_stripped),
152152
};
153153

154-
155154
#define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc)
156155
#define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc)
157156
#define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc)

drivers/net/ethernet/pensando/ionic/ionic_txrx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "ionic_lif.h"
1111
#include "ionic_txrx.h"
1212

13-
1413
static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell,
1514
ionic_desc_cb cb_func, void *cb_arg)
1615
{

0 commit comments

Comments
 (0)