🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Andrew Lunn Wed, 04 Nov 2026 21:06
Re: [PATCH net-next 4/5] net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110
#11448
Author: Andrew Lunn
Date: Wed, 04 Nov 2026 21:06
33 lines
10000 bytes
> > +static int adin1110_set_rx_mode_tc6(struct net_device *dev,
> > +				    struct netdev_hw_addr_list *uc,
> > +				    struct netdev_hw_addr_list *mc)
> > +{
> > +	struct adin1110_port_priv *port_priv = netdev_priv(dev);
> > +	struct adin1110_priv *priv = port_priv->priv;
> > +	int ret;
> > +
> > +	mutex_lock(&priv->lock);
> 
> guard(mutex)(&priv->lock)?

netdev Maintainers have a strong dislike for this sort of guard. Not
in this case, but often it protects too much, since the end of the
function is frequently passed the end of the critical section.

The scoped variant can be used, since that explicitly marks the end of
the critical section.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

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.

	Andrew
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads