Commit 3d2f670a authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'ionic-updates'

Shannon Nelson says:

====================
ionic updates

These are a pair of small code cleanups.
====================

Link: https://lore.kernel.org/r/20201201002546.4123-1-snelson@pensando.io


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 832913c3 79ba55a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ int ionic_heartbeat_check(struct ionic *ionic)

			work = kzalloc(sizeof(*work), GFP_ATOMIC);
			if (!work) {
				dev_err(ionic->dev, "%s OOM\n", __func__);
				dev_err(ionic->dev, "LIF reset trigger dropped\n");
			} else {
				work->type = IONIC_DW_TYPE_LIF_RESET;
				if (fw_status & IONIC_FW_STS_F_RUNNING &&
+7 −7
Original line number Diff line number Diff line
@@ -842,7 +842,7 @@ static bool ionic_notifyq_service(struct ionic_cq *cq,
	case IONIC_EVENT_RESET:
		work = kzalloc(sizeof(*work), GFP_ATOMIC);
		if (!work) {
			netdev_err(lif->netdev, "%s OOM\n", __func__);
			netdev_err(lif->netdev, "Reset event dropped\n");
		} else {
			work->type = IONIC_DW_TYPE_LIF_RESET;
			ionic_lif_deferred_enqueue(&lif->deferred, work);
@@ -1051,10 +1051,8 @@ static int ionic_lif_addr(struct ionic_lif *lif, const u8 *addr, bool add,

	if (!can_sleep) {
		work = kzalloc(sizeof(*work), GFP_ATOMIC);
		if (!work) {
			netdev_err(lif->netdev, "%s OOM\n", __func__);
		if (!work)
			return -ENOMEM;
		}
		work->type = add ? IONIC_DW_TYPE_RX_ADDR_ADD :
				   IONIC_DW_TYPE_RX_ADDR_DEL;
		memcpy(work->addr, addr, ETH_ALEN);
@@ -1183,7 +1181,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool can_sleep)
		if (!can_sleep) {
			work = kzalloc(sizeof(*work), GFP_ATOMIC);
			if (!work) {
				netdev_err(lif->netdev, "%s OOM\n", __func__);
				netdev_err(lif->netdev, "rxmode change dropped\n");
				return;
			}
			work->type = IONIC_DW_TYPE_RX_MODE;
@@ -1467,12 +1465,14 @@ static int ionic_change_mtu(struct net_device *netdev, int new_mtu)
	if (err)
		return err;

	netdev->mtu = new_mtu;
	/* if we're not running, nothing more to do */
	if (!netif_running(netdev))
	if (!netif_running(netdev)) {
		netdev->mtu = new_mtu;
		return 0;
	}

	ionic_stop_queues_reconfig(lif);
	netdev->mtu = new_mtu;
	return ionic_start_queues_reconfig(lif);
}

+1 −3
Original line number Diff line number Diff line
@@ -511,11 +511,9 @@ int ionic_port_init(struct ionic *ionic)
						     idev->port_info_sz,
						     &idev->port_info_pa,
						     GFP_KERNEL);
		if (!idev->port_info) {
			dev_err(ionic->dev, "Failed to allocate port info\n");
		if (!idev->port_info)
			return -ENOMEM;
	}
	}

	sz = min(sizeof(ident->port.config), sizeof(idev->dev_cmd_regs->data));