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] [day] [month] [year] [list]
Message-ID: <s5hzh2ntm4j.wl-tiwai@suse.de>
Date:   Wed, 09 Dec 2020 09:33:00 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     Connor McAdams <conmanx360@...il.com>
Cc:     Jaroslav Kysela <perex@...ex.cz>, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/5] ALSA: hda/ca0132 - Add 8051 exram helper functions.

On Tue, 08 Dec 2020 22:25:43 +0100,
Connor McAdams wrote:
> 
> +static void chipio_8051_write_exram(struct hda_codec *codec,
> +		unsigned int addr, unsigned int data, bool use_mutex)
> +{
> +	struct ca0132_spec *spec = codec->spec;
> +	unsigned int tmp;
> +
> +	if (use_mutex)
> +		mutex_lock(&spec->chipio_mutex);

This can be better to split to two functions: a core helper function
without mutex and a helper function to take the mutex lock and call
the former function.  Applying the lock conditionally is often
error-prone.


thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ