From patchwork Mon Jun 12 14:17:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Fijalkowski X-Patchwork-Id: 13276757 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B55819E4B for ; Mon, 12 Jun 2023 14:20:17 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7502E170C for ; Mon, 12 Jun 2023 07:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686579593; x=1718115593; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hxFXge1dlw858mECWFoNvKpOjO3jcxV5ZQksWy27lCo=; b=lKYRRB1W8PcO4yfYIJpQr5PFhWYaBft4qSysUck5RE52TJQse7MCew+K WNeEieCOnyaXib9s4drn4BosZRe7cAs3gT+ay/ht+CydzosqfRLqD+4Vp NjYAoQXZlnDbL+Cr0IayihmtUR94AGXs1wPkrUcXAUrOoAlpdOB9EJjI5 dRBVCr0Anf0vrsisdCLpqNmw1ymrmkpxCX6z2SmcWkLUkAQgHdaOMJX3Y kPS9TfFRdE0bsuJCsDMv+t3nmNTA2WMFPhQeGAWI3EfZOhuK+br1udz+C 5bxztfkw0zue5v0KXXWznXp1ersFY6WbKuYgs6ibAWEblZbWUVElwnemO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="358046124" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="358046124" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 07:17:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="661609296" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="661609296" Received: from boxer.igk.intel.com ([10.102.20.173]) by orsmga003.jf.intel.com with ESMTP; 12 Jun 2023 07:17:45 -0700 From: Maciej Fijalkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, magnus.karlsson@intel.com, Maciej Fijalkowski Subject: [PATCH iwl-next] ice: use ice_down_up() where applicable Date: Mon, 12 Jun 2023 16:17:30 +0200 Message-Id: <20230612141730.331674-1-maciej.fijalkowski@intel.com> X-Mailer: git-send-email 2.35.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org ice_change_mtu() is currently using a separate ice_down() and ice_up() calls to reflect changed MTU. ice_down_up() serves this purpose, so do the refactoring here. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_main.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a1f7c8edc22f..609df077c314 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -7634,17 +7634,9 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) /* if VSI is up, bring it down and then back up */ if (!test_and_set_bit(ICE_VSI_DOWN, vsi->state)) { - err = ice_down(vsi); - if (err) { - netdev_err(netdev, "change MTU if_down err %d\n", err); - return err; - } - - err = ice_up(vsi); - if (err) { - netdev_err(netdev, "change MTU if_up err %d\n", err); + err = ice_down_up(vsi); + if (err) return err; - } } netdev_dbg(netdev, "changed MTU to %d\n", new_mtu);