From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Kirsher Subject: [net 4/7] ice: Use capability count returned by the firmware Date: Wed, 24 Oct 2018 14:47:28 -0700 Message-ID: <20181024214731.26036-5-jeffrey.t.kirsher@intel.com> References: <20181024214731.26036-1-jeffrey.t.kirsher@intel.com> Cc: Anirudh Venkataramanan , netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, Jeff Kirsher To: davem@davemloft.net Return-path: Received: from mga07.intel.com ([134.134.136.100]:63762 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727302AbeJYGNr (ORCPT ); Thu, 25 Oct 2018 02:13:47 -0400 In-Reply-To: <20181024214731.26036-1-jeffrey.t.kirsher@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Anirudh Venkataramanan The firmware now returns the capability count in the command buffer. Use it. Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ice/ice_common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index c52f450f2c0d..78df54b25bf1 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1531,9 +1531,7 @@ ice_aq_discover_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count, if (!status) ice_parse_caps(hw, buf, le32_to_cpu(cmd->count), opc); else if (hw->adminq.sq_last_status == ICE_AQ_RC_ENOMEM) - *cap_count = - DIV_ROUND_UP(le16_to_cpu(desc.datalen), - sizeof(struct ice_aqc_list_caps_elem)); + *cap_count = le32_to_cpu(cmd->count); return status; } -- 2.17.2