🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11448

Re: [PATCH net-next 4/5] net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110

#11448
From: 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
Technical Details
Message-ID: <5ef1e25b-2d6d-4cb1-8030-756d60c37c47@lunn.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356933-linux-kernel-netdev=dewy.ru
References: <20261103160918.409701-1-iustin.stolniceanu@analog.com> <20261103160918.409701-5-iustin.stolniceanu@analog.com> <aus-LdkVRPxR6lFu@analog.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356933-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 4/5] net: ethernet: adi: adin1110: Add OA TC6
 protocol support for ADIN1110
Date: Wed, 4 Nov 2026 22:06:40 +0100
Organization: Usenet Network
Message-ID: <5ef1e25b-2d6d-4cb1-8030-756d60c37c47@lunn.ch>
References: <20261103160918.409701-1-iustin.stolniceanu@analog.com>
 <20261103160918.409701-5-iustin.stolniceanu@analog.com>
 <aus-LdkVRPxR6lFu@analog.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3542354"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2Kz4PMF8u/X/+d+8GEK5iln1r6s= sha256:g57kuaELUa78J5AaUHpND47JoOvj+dGT3oeQYrdFmNM=
	sha1:DuqLMQkmgfv6yaNKA+NS4r9xur8= sha256:bjhQtM4qRAZMwkDiMevR8sNpFQNDd7fV3/5v12QnIOg=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id C46E9112E5A; Thu,  5 Nov 2026 05:22:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.951
X-Spam-Status: No, score=-1.951 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id sxRIxVF_ZgdE;
	Thu,  5 Nov 2026 05:22:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-356933-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 4455B112E51; Thu,  5 Nov 2026 05:22:26 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 3B0AF1A814E; Wed,  4 Nov 2026 21:36:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793826412;
	b=Atn/+F20Wq20VSd418XwRrfmK9RG5y2toJNyyoxPft224wVjaCrueEFHhjR2YER6y07U
	 P6SsrsMcSWFWZFgUqEjX9dpqwOjMdFSKeb0f9sBE6fKBoK48c3zOSIT9lyA4n7vwwOJKa
	 i1qdgImHkpsiYvNNelRaSlzn1KONyN17up63Hon8eAHpT08hyPZYF1AJVdrBWDH5sUb8U
	 ut0XUYgEs2HRZAmF37ZK/fiFOYrCv+bMmQfID2/2tK23Tfa6Tx7PrLKPFjDIu5gW/ecPM
	 L7CmgAwJ29khG+dE4QbK7CMtmZ0r9Pm3oSJLe5UTJihKO1TgW0+o84Hml3U8M6aRXuQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793826412;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=bmyZRAr/fzqETDf7KUmFNioNYdP8sCPB2LYnaAnEY1M=;
	b=bL4+1SKYh+FoQfztADcde1zDvnbwFgbBndhKsBRC5H8xk0lZMG+tfeaYixTZnpOM5fmc
	 dZNPmITuAIp/ZAgLAqfKisUgYdVuaQM3kivIqzoyqbyYFxR38kpigOauwqR0UOkIFrrGN
	 MU2hVEYHEKa2dw8tgkxp6BnHNegc1KXIxLsgxOhnAqYq9Z2qTMI/B+wiTgR1com8QWWgW
	 CMPxyG9TyYkI+NhrT0WglzKOV9U4vGKq2vCdlvGHaxuvx+Qv3PNrdRMZlGhes4Kunk2OL
	 JqZJ8nMqkAS43VR9NjGgDTxFt6mbL2dQsJ1NCt1/xjhvBKIQJvQhBj29T5aSds0I4LQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=3w3rUZun;
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 757EB606E805;
	Wed,  4 Nov 2026 21:06:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=3w3rUZun
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793826411;
	b=ZHkDON/HOdb9bO7JIh77NAzLRocbPvjrKfIn1ZIhRiKG7ox45UYx+c2zYRJESE101pXC
	 VgFSFEZR58a0LAK8OxaXNvtJ7RzWjmAWg6RMpulrz9EX08ss9AE6rZNPCRqOVPMkFKTqR
	 v0nyIhEVBpNNCgHb36n9yIGUJcAp++pZd2EJNhPPCL/R+8D4CkXcHae5Wf08jaTHE6sSq
	 hagV//Q+y77gf91Z4EAlo4txeUGMKvhCwHVRoreGywQmqYFP0P7RVxjjgZ+Uh8skQkh8W
	 I+Y30DRgMUq/FaRWabjCjSYdWIQhS9PPjU/yCaadUgGCknA8gsjjTT2JIpL/BE4ookA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793826411;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=bmyZRAr/fzqETDf7KUmFNioNYdP8sCPB2LYnaAnEY1M=;
	b=GcHjYpWI3Myh3+3nGdzHjrajlIllN6vsaOyQ1djyVIq+12rQNmtSnTpDrdanbKFvGrJl
	 eG3UqpY5PZYk9t7kcS+Y+hyMFuC3Bhy++LEanjs8md0/wiQaxagPUuO/tx/faR3WN9FzP
	 iuK+3svll5VI6vadfoYMrK1TEllMq4eqZ1cFO/vtXOGFN8kANt+IB3bvVwaYdOZ1AVj/E
	 hT54wkJvRSknGCs5w0N8Bvbl3GZMImWB7TvO7m8q3tFoP42teQXEm1G7bf+Lc9NNABKVW
	 GrpYBgOIeLsqATe3TRDZksGteEVKX9fFfgZIqTIGC4oFTUUbFbFKxzmhgNLyP8BJK+Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=3w3rUZun;
	arc=none smtp.remote-ip=156.67.10.101
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 335CA606D834;
	Wed,  4 Nov 2026 21:06:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 335CA606D834
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From:
	Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:
	Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition:
	In-Reply-To:References; bh=bmyZRAr/fzqETDf7KUmFNioNYdP8sCPB2LYnaAnEY1M=; b=3w
	3rUZun2YsXj23IZuBmoF5mP9RNEn61KLtokMC95mGNYEVmeQ5LRKM+EeStHEnK/IahlJq6rJk4JS5
	u9i8JRW4Z3Cmv2BTLGhRRCi/90aK5wR3KhyUb8/hWW9L/IeqvrkgkfEQyOKeOnmz7ZNDh9u0jPmov
	2cFKQnwvTUdSdJ4=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xOiBs-00EO5q-Cx; Wed, 04 Nov 2026 22:06:40 +0100
X-Cc: Iustin Stolniceanu <iustin.stolniceanu@analog.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Marcelo Schmitt <marcelo.schmitt@analog.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Ciprian Regus <ciprian.regus@analog.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <aus-LdkVRPxR6lFu@analog.com>