From: Matias Elo <matias....@nokia.com> Signed-off-by: Matias Elo <matias....@nokia.com> --- /** Email created from pull request 667 (matiaselo:dev/abi_clean_invalid) ** https://github.com/Linaro/odp/pull/667 ** Patch: https://github.com/Linaro/odp/pull/667.patch ** Base sha: 7c87b66edc84e8c713fefc68d46464660adaf71e ** Merge commit sha: 0c5d0fdd232cad0a55d68e819ff9f707fea014f5 **/ include/odp/api/abi-default/ipsec.h | 2 +- platform/linux-generic/include-abi/odp/api/abi/ipsec.h | 2 +- platform/linux-generic/odp_ipsec_sad.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/odp/api/abi-default/ipsec.h b/include/odp/api/abi-default/ipsec.h index 7ec433721..2c95fd4f5 100644 --- a/include/odp/api/abi-default/ipsec.h +++ b/include/odp/api/abi-default/ipsec.h @@ -28,7 +28,7 @@ typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_ipsec_sa_t; typedef _odp_abi_ipsec_sa_t *odp_ipsec_sa_t; -#define ODP_IPSEC_SA_INVALID ((odp_ipsec_sa_t)0xffffffff) +#define ODP_IPSEC_SA_INVALID ((odp_ipsec_sa_t)0) /** * @} diff --git a/platform/linux-generic/include-abi/odp/api/abi/ipsec.h b/platform/linux-generic/include-abi/odp/api/abi/ipsec.h index b91da7959..a04bb1741 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/ipsec.h +++ b/platform/linux-generic/include-abi/odp/api/abi/ipsec.h @@ -26,7 +26,7 @@ extern "C" { typedef ODP_HANDLE_T(odp_ipsec_sa_t); -#define ODP_IPSEC_SA_INVALID _odp_cast_scalar(odp_ipsec_sa_t, 0xffffffff) +#define ODP_IPSEC_SA_INVALID _odp_cast_scalar(odp_ipsec_sa_t, 0) /** * @} diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 3b1686b86..11f37fd8f 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -38,12 +38,12 @@ static inline ipsec_sa_t *ipsec_sa_entry(uint32_t ipsec_sa_idx) static inline ipsec_sa_t *ipsec_sa_entry_from_hdl(odp_ipsec_sa_t ipsec_sa_hdl) { - return ipsec_sa_entry(_odp_typeval(ipsec_sa_hdl)); + return ipsec_sa_entry(_odp_typeval(ipsec_sa_hdl) - 1); } static inline odp_ipsec_sa_t ipsec_sa_index_to_handle(uint32_t ipsec_sa_idx) { - return _odp_cast_scalar(odp_ipsec_sa_t, ipsec_sa_idx); + return _odp_cast_scalar(odp_ipsec_sa_t, ipsec_sa_idx + 1); } int _odp_ipsec_sad_init_global(void)