From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DC263415DD DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BDE4A4159C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p5431h7tNgILKX6a9//swea+hULDSePDtpNj0HhZQJI=; b=p62OobRNoHFv+uRZIVZzpqf1Uq97sZ1imjf1xbzY5neT5ZxaHchcLQbqyvvItog/i1epAw3p0M2WZCA4fZhNVAkFrsCAoQwEcSiiKNYWfokY6FeyBJpJzx0+Q5vNJEQtJ8tClekwuLmTLX4izK3hqHD8T5r2uHKE7v+eAp8Ia14= Date: Sun, 29 Jan 2023 19:39:41 +0100 From: Simon Horman Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: MIME-Version: 1.0 Subject: Re: [Bridge] [PATCH net-next v2] netlink: provide an ability to set default extack message List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leon Romanovsky Cc: Steffen Klassert , Andrew Lunn , Florian Fainelli , Herbert Xu , netdev@vger.kernel.org, Nikolay Aleksandrov , bridge@lists.linux-foundation.org, Eric Dumazet , Vladimir Oltean , Roopa Prabhu , Jakub Kicinski , Paolo Abeni , "David S . Miller" On Sun, Jan 29, 2023 at 06:51:37PM +0200, Leon Romanovsky wrote: > In netdev common pattern, extack pointer is forwarded to the drivers > to be filled with error message. However, the caller can easily > overwrite the filled message. > > Instead of adding multiple "if (!extack->_msg)" checks before any > NL_SET_ERR_MSG() call, which appears after call to the driver, let's > add new macro to common code. > > [1] https://lore.kernel.org/all/Y9Irgrgf3uxOjwUm@unreal > Signed-off-by: Leon Romanovsky Reviewed-by: Simon Horman