lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zsito5oUdhNBg6Nn@google.com>
Date: Fri, 23 Aug 2024 08:41:23 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, Mark Brown <broonie@...nel.org>,
	linux-input@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org, patches@...nsource.cirrus.com
Subject: Re: [PATCH 06/14] Input: samsung-keypad - use guard notation to
 acquire mutex

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 <dmitry.torokhov@...il.com>
> >>>>> ---
> >>>>>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ