tools: ynl-gen: fix enum index in _decode_enum(..)
authorArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tue, 25 Jul 2023 10:16:41 +0000 (12:16 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Jul 2023 20:38:23 +0000 (13:38 -0700)
commitd7ddf5f4269fcaf19aafe971e635d91897423a3a
tree04fa5b7e6659265ddcde9b1fbafb7d94f4ec4b34
parentd4a7ce642100765119a872d4aba1bf63e3a22c8a
tools: ynl-gen: fix enum index in _decode_enum(..)

Remove wrong index adjustment, which is leftover from adding
support for sparse enums.
enum.entries_by_val() function shall not subtract the start-value, as
it is indexed with real enum value.

Fixes: c311aaa74ca1 ("tools: ynl: fix enum-as-flags in the generic CLI")
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20230725101642.267248-2-arkadiusz.kubalewski@intel.com
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/ynl.py