[LTP] [PATCH] lapi/tls.h: Cleanup ifdefs
Li Wang
liwang@redhat.com
Fri Jan 23 02:24:02 CET 2026
Reviewed-by: Li Wang <liwang@redhat.com>
--
Regards,
Li Wang
On Fri, Jan 23, 2026 at 1:54 AM Petr Vorel <pvorel@suse.cz> wrote:
>
> fe24196ce3 added .supported_archs into clone10. Therefore there is no
> need to keep architecture check also in lapi/tls.h.
>
> Moreover "Unsupported architecture for TLS" was misleading as it looked
> as a missing arch support in kernel, but it's our allocate_tls_area()
> implementation which does support only 3 architectures.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi,
>
> based on a recent discussion on ML
> https://lore.kernel.org/ltp/20260122130634.GA71214@pevik/
>
> Kind regards,
> Petr
>
> include/lapi/tls.h | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/include/lapi/tls.h b/include/lapi/tls.h
> index f7e2f483fe..468fe3086d 100644
> --- a/include/lapi/tls.h
> +++ b/include/lapi/tls.h
> @@ -52,22 +52,16 @@ static inline void *allocate_tls_area(void)
>
> static inline void init_tls(void)
> {
> -#if defined(__x86_64__) || defined(__aarch64__) || defined(__s390x__)
> tls_ptr = allocate_tls_area();
> -#else
> - tst_brk(TCONF, "Unsupported architecture for TLS");
> -#endif
> }
>
> static inline void free_tls(void)
> {
> usleep(10000);
> -#if defined(__x86_64__) || defined(__aarch64__) || defined(__s390x__)
> if (tls_ptr) {
> free(tls_ptr);
> tls_ptr = NULL;
> }
> -#endif
> }
>
> #endif /* LAPI_TLS_H__ */
> --
> 2.51.0
>
--
Regards,
Li Wang
More information about the ltp
mailing list