bitrate: fix registration to match API description
authorKevin Traynor <ktraynor@redhat.com>
Fri, 9 Jul 2021 15:19:36 +0000 (16:19 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 1 Oct 2021 13:29:21 +0000 (15:29 +0200)
commit06ae9f0f92cf3bb85549f66dc3dfa11011d7db0f
tree7ab4a8015a905319c2cfa62399e5eb48a5aa1680
parent71ecc415c5c5c746c89472f30fb4b63b9c968ac3
bitrate: fix registration to match API description

rte_stats_bitrate_reg() API states it returns 'Zero on success'.

However, the implementation directly returns the return of
rte_metrics_reg_names() which may be zero or positive on success,
with a positive value also indicating the index.

The user of rte_stats_bitrate_reg() should not care about the
index as it is stored in the opaque rte_stats_bitrates struct.

Change the implementation of rte_stats_bitrate_reg() to match
the API description by always returning zero on success.

Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
lib/bitratestats/rte_bitrate.c