Files
wolfssl/linuxkm
Sameeh Jubran 9a699c04ea linuxkm: Fix spinlock initialization on Tegra kernels for __SPIN_LOCK_UNLOCKED macro incompatibility
Tegra vendor kernels (L4T / NVIDIA Yocto BSP) fail to compile the
wolfSSL Linux kernel module due to the use of the legacy assignment form
of the spinlock initializer:

    m->lock = __SPIN_LOCK_UNLOCKED(m);

On Tegra, __SPIN_LOCK_UNLOCKED() expands to a braced-struct initializer
that is *not* valid as an assignment expression, causing:

    error: expected expression before '{' token

This patch applies a Tegra-specific workaround by replacing the
assignment with the stable kernel API:

    spin_lock_init(&m->lock);

This is guarded behind CONFIG_ARCH_TEGRA so that non-Tegra platforms
retain the current initialization behavior until further validation is
completed.

This fix restores successful kernel module builds on NVIDIA Tegra-based
Yocto images without modifying behavior on other architectures.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2025-11-27 10:08:55 +02:00
..