From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1CB57152A for ; Mon, 9 Jan 2017 11:01:43 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 09 Jan 2017 02:01:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,339,1477983600"; d="scan'208";a="1080821841" Received: from rhorton-mobl.ger.corp.intel.com (HELO [10.252.2.241]) ([10.252.2.241]) by orsmga001.jf.intel.com with ESMTP; 09 Jan 2017 02:01:41 -0800 To: "Yang, Qiming" , Stephen Hemminger References: <1483531428-14481-1-git-send-email-qiming.yang@intel.com> <1483848695-44643-1-git-send-email-qiming.yang@intel.com> <1483848695-44643-2-git-send-email-qiming.yang@intel.com> <20170108150513.6a57d4f0@xeon-e3> Cc: "dev@dpdk.org" , "Yigit, Ferruh" , "Zhang, Helin" From: Remy Horton Organization: Intel Shannon Limited Message-ID: <8c746d3c-abb2-9ec5-80d0-2315f854e5bf@intel.com> Date: Mon, 9 Jan 2017 10:01:40 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 1/5] ethdev: add firmware version get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:01:44 -0000 On 09/01/2017 07:16, Yang, Qiming wrote: > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] [..] >> void >> +rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, int >> +fw_length) { >> + struct rte_eth_dev *dev; >> + >> + RTE_ETH_VALID_PORTID_OR_RET(port_id); >> + dev = &rte_eth_devices[port_id]; >> + >> + RTE_FUNC_PTR_OR_RET(*dev->dev_ops->fw_version_get); >> + (*dev->dev_ops->fw_version_get)(dev, fw_version, fw_length); } > > Maybe dev argument to fw_version_get should be: > const struct rte_eth_dev *dev > Qiming: do you means the argument to ops fw_version_get? > why should add 'const'? both two are OK, but we usually use struct rte_eth_dev *dev. Does seem a bit odd to me as I don't think any of the other rte_dev_ops entrypoints use const. Maybe they should but if that's now policy (I've been under a rock recently) probably better to do them all in a seperate cleanup patchset..