From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4388BC52D7C for ; Fri, 23 Aug 2024 15:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YjB9ZMnHKgYRM/l7XHxIgiTwIdgJ4z4hI/q0GewkKyo=; b=G8zHIl3dOfo1Y82loAiJUmu28x FZCCmQZ8THjl6GE3LhZNqPu0IEPyo7zkW32F8YkcnhzCJXenCZdiSA8Xt0IktmaUbUqi43Odd0cuN Zb8rb45t4ayOUPq4e/WZy2lSd8V5KAzofSqBwcC30WtzXl5YuJez9spcB5rtJySwzNh+GjPIyRYjV fzYGK1NEj34Ds6qFJV1DUqmS1p3tn8jHPcQ/BWoECvugpkHkzdVof2eLp1Cd7dAYTyPnNcJMs84gD 4bDzr4BAGoRlu0PyGok1n10c9fRX9zTODX5cPm5jOBF/o16+VBCwVq03B9Ex+COMpiBNDeMxJsBLx o5mInkDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shWUf-0000000HNQk-0CAD; Fri, 23 Aug 2024 15:46:29 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shWPo-0000000HLqK-1JwM for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 15:41:32 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7106cf5771bso1862880b3a.2 for ; Fri, 23 Aug 2024 08:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724427687; x=1725032487; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YjB9ZMnHKgYRM/l7XHxIgiTwIdgJ4z4hI/q0GewkKyo=; b=XhcbuRGEc3+XbxRRD/XOUeaJXjGt8CqpfRMbdEhSkXiQV0EwLLdM3HUPl55jMAVqle 7/PV4bslL9Mxmqy9eCTzMKwuRnFEWqDbGIyEVuJt4Q3hIWOpWbheD+SZlAAlwUSkiFPT bqY01EqWY4jY8cyxpqU1o+jkG0EIdIk5NRqS3C6rtCeJPTBZWMH831hNTN/zbKP1wDFP DOkkBSaV9HFLIUg/9LQDeDqHoi8H1ql8hOjdUEObUaR4uL2dYdvYi/1cCG2A+sRd+9ge m50EzP3QaMiAcEmL32WKY/zwEAjqL/2nk4+81XJnL3+rV5l5LNksZ+NpcOrcBOyVAhGi tWnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724427687; x=1725032487; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YjB9ZMnHKgYRM/l7XHxIgiTwIdgJ4z4hI/q0GewkKyo=; b=vZR1HP+9uOxajD8ULw6xHCxF52V0b0y5MWi7WeOwLt4vq5tsUpqOnc2ez2zbeL1gbx H5w2PxCm1lBSj8j2qYf0Sz3ChO6JMLeFV97qHl4SkkBgqqtlznihk6TBK2gCO5txv6Y2 oSIhhrykHzRliBw/otfqleym/QHdT+YP2/sTicn4tEweoc0fmwg1EL2gH1rQlvzWXwSg ZjT3WPGxhakwNPfbp5IOEf//5Be2YII8ZgoxaXFptloXnR0G+yV1sam92jasi+AjQOMA PDX2iKW5+YvmbxJLj91C4pmg3Fg6210qoDnYbxAG+P4QO1RcrpzHFt97QlW9TeF82m8t VQQg== X-Forwarded-Encrypted: i=1; AJvYcCWyZ8sN2NWSfTbs1bYQJhaEtf5Mhyk2Xwap/uQ5jcfddEdpjxjZtZIDlXr3Qc5urqZDLlW7ef2rmYdS9FImOy2w@lists.infradead.org X-Gm-Message-State: AOJu0Yxf+kj3JAm3hNJ8h7nbQeNEgFAmB28MZ1cgentLJG3qk/m2f09i dAz2H6K151f86MEzSChVAs/3rB2xtbVtk2ZcM6mWMQsDPSfFnoXg X-Google-Smtp-Source: AGHT+IFuyqyaZHnTmSqiJ3FlOdH0Cc0Z5cRjdNS0bL90sFcrAxgdrMRqebKNcikPNQpMrVWtXPIGDQ== X-Received: by 2002:a05:6a00:4f8d:b0:714:2d0d:8a90 with SMTP id d2e1a72fcca58-71445772525mr3202824b3a.9.1724427686966; Fri, 23 Aug 2024 08:41:26 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:75c:5a5a:d7dc:18f6]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7cd9acdcf7dsm2914549a12.50.2024.08.23.08.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 08:41:26 -0700 (PDT) Date: Fri, 23 Aug 2024 08:41:23 -0700 From: Dmitry Torokhov To: Krzysztof Kozlowski Cc: Arnd Bergmann , Mark Brown , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH 06/14] Input: samsung-keypad - use guard notation to acquire mutex Message-ID: References: <20240819045813.2154642-1-dmitry.torokhov@gmail.com> <20240819045813.2154642-7-dmitry.torokhov@gmail.com> <0afadefb-ecb1-4ec8-a862-bfa06d171457@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_084128_543622_8CE71485 X-CRM114-Status: GOOD ( 20.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 23, 2024 at 10:52:54AM +0200, Krzysztof Kozlowski wrote: > On 23/08/2024 10:32, Dmitry Torokhov wrote: > > On Fri, Aug 23, 2024 at 08:06:17AM +0200, Krzysztof Kozlowski wrote: > >> On 22/08/2024 20:07, Dmitry Torokhov wrote: > >>> On Thu, Aug 22, 2024 at 05:48:33PM +0200, Krzysztof Kozlowski wrote: > >>>> On Sun, Aug 18, 2024 at 09:58:03PM -0700, Dmitry Torokhov wrote: > >>>>> Guard notation is more compact and ensures that the mutex will be > >>>>> released when control leaves the function. > >>>>> > >>>>> Signed-off-by: Dmitry Torokhov > >>>>> --- > >>>>> drivers/input/keyboard/samsung-keypad.c | 8 ++------ > >>>>> 1 file changed, 2 insertions(+), 6 deletions(-) > >>>>> > >>>> > >>>> You need to include cleanup.h (unless some other patch already did it > >>>> and I missed it?) > >>> > >>> Guard for mutexes defined in mutex.h which is pulled in indirectly, and > >> > >> guard() is not in mutex.h and in general we are including headers for > >> the things directly used in the unit. > > > > Oh, but it is: > > > > https://elixir.bootlin.com/linux/v6.10/source/include/linux/mutex.h#L196 > > > > DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T)) > > That's DEFINE_GUARD, not guard(). OK, I see what you mean. I believe that cleanup.h is too low level to include directly by anyone who does not actually define a new guard or destructor routine. The concrete implementations of needed guards and all necessary support is pulled together with the headers defining the primary objects (mutex, spinlock, etc). Thanks. -- Dmitry