Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9394817pxu; Mon, 28 Dec 2020 15:05:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF66RpMKz004j3pnqEINCzXR8iB2MmyJDkDOWDa9M4FVCp5srnmowrUSdv7nZIN3GJcpCG X-Received: by 2002:a17:906:b217:: with SMTP id p23mr4332028ejz.461.1609196702118; Mon, 28 Dec 2020 15:05:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609196702; cv=none; d=google.com; s=arc-20160816; b=F/t1Wk3C7Bery8jNDOphmYCX/EpS4nnwTekRLdLiJkWkd2/0AA+XmjoXpUAptgbRFI NVVCY6l21g5vj+SMNSSRC/oz4FzFbicSRZPIgHyDhnImGeDIISOeFM/Y3uwqlovduvFE BNdwW1AGntf5zhhLTA4pEtOYVlknqMsDI6y2D8P2g5v1KApCiU9Z+MohRCr+uB8LHOrc hpwTgwuxj08KgryTewgWFL6e9jAXGSqbdUiFOBf+er8DpS39s2jL48diIj301+tWDDFh mdOQoea1H9n+QM5tChIwT51M3kXd18TJj0n7nullMaOLE3UoLvMkBAjmGDEElZqMRNOF Y2Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EoV4hbTXZr4vtC6H1W50DQr82gEE7p477gidKIx6Icw=; b=Rd8pl7dhBoCyMzAdU+VCRcO8wXnLEBBUqIPezF4gkylSL8kMO3fDigwRd55inkAUiW 5NV2x8GhtOnx85/XWpe2Z3mC/U5UpSAuR21BAFbWViWh5ZIz90BLOKyNoWM58rVVckId yzUPhlxel5lxDz8Z4K+inMNkhp/VATLtB8nWQkSdA/sToqGJ1/2FR2Ms8chKJwEKxWRB 9n8ZoME/9enOD/wEkqxxL1QmmtrlbNQdx00hWo/F5wyipQhp+Qf31+/S/up7e75NioT0 KE3BYVI/bQUSdksJ6d/bHHGCn2jAj/sXl9Fs+nj5h7/5syhhzG4/g38eI2KvyIf/1DJC JiQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pCBbsqw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si18410484ejb.632.2020.12.28.15.04.40; Mon, 28 Dec 2020 15:05:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pCBbsqw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437957AbgL1OHD (ORCPT + 99 others); Mon, 28 Dec 2020 09:07:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:40964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438030AbgL1OGZ (ORCPT ); Mon, 28 Dec 2020 09:06:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6140020791; Mon, 28 Dec 2020 14:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164345; bh=JbWe6qSVwitlPQ+Pm52RIbChupxTdkNohd7NcGW6PJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pCBbsqw8FXXPPvOy1KfW/YMsZ3979mRvOYloiP7bWMum6BeU1b+UAFBQ+DCKAZAec EVYKGNg74nIACNedbjfOrWWdYzLJytl+h7onEQvnDq4/kmX/poTdeaFyQZp/dy8mEm CyAqjKywCsYw2VH0DyPoDAdGFBrJ2+S/NM4Ta8wM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , Saeed Mahameed , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 116/717] ionic: flatten calls to ionic_lif_rx_mode Date: Mon, 28 Dec 2020 13:41:54 +0100 Message-Id: <20201228125026.520493831@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shannon Nelson [ Upstream commit e94f76bb206333efcd0c02da5dbb142518c941a2 ] The _ionic_lif_rx_mode() is only used once and really doesn't need to be broken out. Signed-off-by: Shannon Nelson Reviewed-by: Saeed Mahameed Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../net/ethernet/pensando/ionic/ionic_lif.c | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 724df18400165..7ad9f0cc1af66 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1129,29 +1129,10 @@ static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode) lif->rx_mode = rx_mode; } -static void _ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode, - bool from_ndo) -{ - struct ionic_deferred_work *work; - - if (from_ndo) { - work = kzalloc(sizeof(*work), GFP_ATOMIC); - if (!work) { - netdev_err(lif->netdev, "%s OOM\n", __func__); - return; - } - work->type = IONIC_DW_TYPE_RX_MODE; - work->rx_mode = rx_mode; - netdev_dbg(lif->netdev, "deferred: rx_mode\n"); - ionic_lif_deferred_enqueue(&lif->deferred, work); - } else { - ionic_lif_rx_mode(lif, rx_mode); - } -} - static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) { struct ionic_lif *lif = netdev_priv(netdev); + struct ionic_deferred_work *work; unsigned int nfilters; unsigned int rx_mode; @@ -1197,8 +1178,21 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) rx_mode &= ~IONIC_RX_MODE_F_ALLMULTI; } - if (lif->rx_mode != rx_mode) - _ionic_lif_rx_mode(lif, rx_mode, from_ndo); + if (lif->rx_mode != rx_mode) { + if (from_ndo) { + work = kzalloc(sizeof(*work), GFP_ATOMIC); + if (!work) { + netdev_err(lif->netdev, "%s OOM\n", __func__); + return; + } + work->type = IONIC_DW_TYPE_RX_MODE; + work->rx_mode = rx_mode; + netdev_dbg(lif->netdev, "deferred: rx_mode\n"); + ionic_lif_deferred_enqueue(&lif->deferred, work); + } else { + ionic_lif_rx_mode(lif, rx_mode); + } + } } static void ionic_ndo_set_rx_mode(struct net_device *netdev) -- 2.27.0