Re: [PATCH net-next v2 6/8] net: xilinx: tsn: add the endpoint RX data path
From: Jakub Kicinski
Date: Tue Sep 15 2026 - 20:27:22 EST
On Wed, 9 Sep 2026 00:49:54 +0530 Srinivas Neeli wrote:
> + guard(spinlock_bh)(&xchan->rx_lock);
Quoting documentation:
Using device-managed and cleanup.h constructs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Netdev remains skeptical about promises of all "auto-cleanup" APIs,
including even ``devm_`` helpers, historically. They are not the preferred
style of implementation, merely an acceptable one.
Use of ``guard()`` is discouraged within any function longer than 20 lines,
``scoped_guard()`` is considered more readable. Using normal lock/unlock is
still (weakly) preferred.
Low level cleanup constructs (such as ``__free()``) can be used when building
APIs and helpers, especially scoped iterators. However, direct use of
``__free()`` within networking core and drivers is discouraged.
Similar guidance applies to declaring variables mid-function.
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs