Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp493642rdb; Thu, 22 Feb 2024 09:48:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW5b6hZLBExvW8nOWh7JU0F9byiiv+sKVDh+xFQLMvNcwMokEWzX52ok183Pd3qmHBXr+Nf7Fls1QDarRRzqATlP/H8FB3MPw0biybCvg== X-Google-Smtp-Source: AGHT+IEyEgwBbvztNMOKuKRLpko7ZEgWHqjCp8hm1zHKwJMMPHpO9XTYLrgt/eTw/su1om9DiCAm X-Received: by 2002:a05:6a20:9598:b0:1a0:8a96:a6b9 with SMTP id iu24-20020a056a20959800b001a08a96a6b9mr19153728pzb.29.1708624106837; Thu, 22 Feb 2024 09:48:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708624106; cv=pass; d=google.com; s=arc-20160816; b=v5I093Asge9OLbteh6QXc7+0gkHa3EfPf8NGW5c3nawD2RsmbK1q+Qp/cmG6gX4JYI q9BzFeyMckqqGLZ7YV8VfU3Qv+0ZvH4K9YTPglpQcrS/Dlut9Q+pJSe4qMyRFod3Fos9 mJm5k4u6OBEKImioNsm3VcqUNGtuhe7tPbmMxo1j947hYnhvwP42sa7JphOAB7hkLUFN TNyWIFClXOzD6h6AExd3yI92YYI9cDf6LtazK0LyQg/cghSkm0fKEoN4lTLttKAGUo1Y Q1YuvVgGfLcVVPNkCHhDiAy+sJ16Lk+FlehOwsJA0tGRIl2ds/Xi8lVE73lCHmYbXlq0 PXcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=X3I/R/8qE9M+CRJjU12CIPkeWv2RmJWu64GPRTejT9A=; fh=aYDbW87XmM6KobSJr2wo5djkMlWqufEjSp8gSypKDSo=; b=xdpM57gtgeTfIloyymiS4v6ZIfyEo526UTFA8xamAJsf14GzQeub6PF+IOm7bRLZBZ Kgz10dHd5NdiXQkE6/xdvrOuvSZlK6gIxHzXwSe0lcXgj3n39xM+UGe+fgHIXoK69d2m XZbhUNuHQgHUxFynR63klrLe0n5shwwFkuKXMiebqe9C92DdP4gL9G35EbV6xhuNqeA1 5NofsuY2r16e9+aRiGzkeOkP2lhUmzZ1sZUf9Jtu5wJEHuuS27uqCdbhD9LXNSMX4zUb 1Etc4IHVof19fx1if4dSkjBXg35Dl7x33PRT/XBrD2NxwcGwvt48nPSBHKOieMcoCi2H dbCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Gn9siWgG; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-77008-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e26-20020a63745a000000b005d8c1b5a3bdsi10707076pgn.216.2024.02.22.09.48.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:48:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77008-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Gn9siWgG; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-77008-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3742E28B34B for ; Thu, 22 Feb 2024 17:46:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79A4D15698F; Thu, 22 Feb 2024 17:45:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Gn9siWgG" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E955D156964; Thu, 22 Feb 2024 17:45:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708623912; cv=none; b=KPu5PpD9z5YoRWZ8raxl7nNJQJjE6GqxYLMXwK036UIJgdg2NH/swrE98IYN+m3IB7t2rBCq9zqFNQ07laOyf46P8kBHe/NIvl/NV7hLuwL2jrC0PFxDQHhhBc686lzuTcUvvJAdyEl3wlDUo0M6UtB5b9p09Kjt/1JtyMDEcLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708623912; c=relaxed/simple; bh=t5zt+TWCiEVitoTsZfoCUCenxBToFiWAiBgB3/Iqy6E=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cN5quN1Vl3u6T5d38uizvZl6rEzuJP2KqOpPllmiEmOqZ71iVPGY0oCloRvxqaLW3f8ZSVmxF7fIziHYV4iZt3TBDlvYWg+YQ6VU73WGPOMtD+V4O10pbOJaAcNVW1etZzp8lYW+sSIu/fHd/NLV2xZzUTV9I4jGBuUu+sIRmfk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Gn9siWgG; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 245471C0006; Thu, 22 Feb 2024 17:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708623908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X3I/R/8qE9M+CRJjU12CIPkeWv2RmJWu64GPRTejT9A=; b=Gn9siWgGy58upwjuxgZs1XPEf1GDRTbpcvMhGVQfa6tZlTi2lsfyZpcQxf8FkXeGe9tIJ3 yXjKmoW/ka+D12sjQlBQsSvGJWwZt/OmrV8PwIcpGmozoCEoRTcEIHnQfIB5NS9nuYUe3w 6NNZ5+JB8LXFqUdqSjDStf+Re/To2Y1SMcEuNpRdnRJBWyF99+PvOGoGMwWH9B+MemlYfA j5ppLi6XsOPUBeewQUOqqILuWdqhnUNixduxT7ASbeeFv+tIAFO7M9bCFbOz9b1yKy0Ly+ 7Zf7N5aeK2sdiydUrmEj0FgyhvYGlOpTdaf2raQ0ULfAcGMmE05QtMlI+GR49A== Date: Thu, 22 Feb 2024 18:45:05 +0100 From: Herve Codina To: Andy Shevchenko Cc: Vadim Fedorenko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yury Norov , Rasmus Villemoes , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Andrew Lunn , Mark Brown , Christophe Leroy , Thomas Petazzoni Subject: Re: [PATCH v4 1/5] net: wan: Add support for QMC HDLC Message-ID: <20240222184505.7350df2e@bootlin.com> In-Reply-To: References: <20240222142219.441767-1-herve.codina@bootlin.com> <20240222142219.441767-2-herve.codina@bootlin.com> <20240222174501.4cbe03ab@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Andy, Jakub, On Thu, 22 Feb 2024 18:56:26 +0200 Andy Shevchenko wrote: > On Thu, Feb 22, 2024 at 05:45:01PM +0100, Herve Codina wrote: > > On Thu, 22 Feb 2024 17:29:05 +0200 > > Andy Shevchenko wrote: > > > On Thu, Feb 22, 2024 at 03:22:14PM +0100, Herve Codina wrote: > > ... > > > > > + spin_lock_irqsave(&qmc_hdlc->tx_lock, flags); > > > > > > Why not using cleanup.h from day 1? > > > > I don't know about cleanup.h. > > Can you tell me more ? > > How should I use it ? > > > > > > +end: > > > > > > This label, in particular, will not be needed with above in place. > > > > > > > + spin_unlock_irqrestore(&qmc_hdlc->tx_lock, flags); > > > > + return ret; > > > > +} > > Here are the examples: > 6191e49de389 ("pinctrl: baytrail: Simplify code with cleanup helpers") > 1d1b4770d4b6 ("platform/x86/intel/vsec: Use cleanup.h") > e2eeddefb046 ("pstore: inode: Convert mutex usage to guard(mutex)") > > Some advanced stuff: > ced085ef369a ("PCI: Introduce cleanup helpers for device reference counts and locks") > > Hope this helps. Sure, thanks for the pointer. Jakub, nothing in drivers/net seems to use the guard() (from cleanup.h) family macro. Are you ok with having this HDLC driver that uses guard() macros ? Best regards, Hervé -- Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com