[dpdk-dev] [PATCH v5 1/5] ethdev: add firmware version get

Remy Horton remy.horton at intel.com
Mon Jan 9 11:01:40 CET 2017


On 09/01/2017 07:16, Yang, Qiming wrote:
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen at 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..


More information about the dev mailing list