hash: fix doxygen of return values

rte_hash_lookup_data() and rte_hash_lookup_with_hash_data()
functions return the index of the table where the key is stored
when this is found, and not 0 as the Doxygen currently states.

Also, these functions, and rte_hash_get_key_with_position()
return negative values when keys are not found (-EINVAL and -ENOENT),
where the minus sign was missing.

Bugzilla ID: 78
Fixes: 473d1bebce43 ("hash: allow to store data in hash table")
Fixes: 6dc34e0afe7a ("hash: retrieve a key given its position")
Cc: stable@dpdk.org

Reported-by: Petr Houska <t-pehous@microsoft.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Pablo de Lara 2018-08-07 03:00:04 +01:00 committed by Thomas Monjalon
parent 4b048f352c
commit f9975d333a

View File

@ -268,8 +268,8 @@ rte_hash_del_key_with_hash(const struct rte_hash *h, const void *key, hash_sig_t
* Output containing a pointer to the key
* @return
* - 0 if retrieved successfully
* - EINVAL if the parameters are invalid.
* - ENOENT if no valid key is found in the given position.
* - -EINVAL if the parameters are invalid.
* - -ENOENT if no valid key is found in the given position.
*/
int
rte_hash_get_key_with_position(const struct rte_hash *h, const int32_t position,
@ -286,9 +286,11 @@ rte_hash_get_key_with_position(const struct rte_hash *h, const int32_t position,
* @param data
* Output with pointer to data returned from the hash table.
* @return
* 0 if successful lookup
* - EINVAL if the parameters are invalid.
* - ENOENT if the key is not found.
* - A positive value that can be used by the caller as an offset into an
* array of user data. This value is unique for this key, and is the same
* value that was returned when the key was added.
* - -EINVAL if the parameters are invalid.
* - -ENOENT if the key is not found.
*/
int
rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data);
@ -307,9 +309,11 @@ rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data);
* @param data
* Output with pointer to data returned from the hash table.
* @return
* 0 if successful lookup
* - EINVAL if the parameters are invalid.
* - ENOENT if the key is not found.
* - A positive value that can be used by the caller as an offset into an
* array of user data. This value is unique for this key, and is the same
* value that was returned when the key was added.
* - -EINVAL if the parameters are invalid.
* - -ENOENT if the key is not found.
*/
int
rte_hash_lookup_with_hash_data(const struct rte_hash *h, const void *key,