From patchwork Fri Jan 29 00:43:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 374029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30579C433E0 for ; Fri, 29 Jan 2021 00:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E98C464DEB for ; Fri, 29 Jan 2021 00:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231653AbhA2Auy (ORCPT ); Thu, 28 Jan 2021 19:50:54 -0500 Received: from mga02.intel.com ([134.134.136.20]:27200 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbhA2AtW (ORCPT ); Thu, 28 Jan 2021 19:49:22 -0500 IronPort-SDR: ca+/givQbUtFYZ+Jrlk9I5dC7AGEBbmavoxehLNiySVSI0tpqp+fhGNldgChbttIrFSlqTd+OG GdO28CdOvfyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="167438976" X-IronPort-AV: E=Sophos;i="5.79,384,1602572400"; d="scan'208";a="167438976" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 16:42:53 -0800 IronPort-SDR: P/hI9I0QpOqHn40BlFWN513f34v5N7nKWi/jXq+5Ngglb+HsLoIszvmhcxQSLImOdUax5AJBiF IepASHcmfulg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,384,1602572400"; d="scan'208";a="430778723" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga001.jf.intel.com with ESMTP; 28 Jan 2021 16:42:52 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Bruce Allan , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, Dave Ertman , kernel test robot , Dan Carpenter , Tony Brelinski Subject: [PATCH net-next 15/15] ice: remove dead code Date: Thu, 28 Jan 2021 16:43:32 -0800 Message-Id: <20210129004332.3004826-16-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210129004332.3004826-1-anthony.l.nguyen@intel.com> References: <20210129004332.3004826-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bruce Allan The check for a NULL pf pointer is moot since the earlier declaration and assignment of struct device *dev already de-referenced the pointer. Also, the only caller of ice_set_dflt_mib() already ensures pf is not NULL. Cc: Dave Ertman Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Bruce Allan Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index ff6190bffff6..3ff4f0d2ff1b 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -785,15 +785,9 @@ static void ice_set_dflt_mib(struct ice_pf *pf) u8 mib_type, *buf, *lldpmib = NULL; u16 len, typelen, offset = 0; struct ice_lldp_org_tlv *tlv; - struct ice_hw *hw; + struct ice_hw *hw = &pf->hw; u32 ouisubtype; - if (!pf) { - dev_dbg(dev, "%s NULL pf pointer\n", __func__); - return; - } - - hw = &pf->hw; mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB; lldpmib = kzalloc(ICE_LLDPDU_SIZE, GFP_KERNEL); if (!lldpmib) {