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: <89021934-dc01-44c4-afcd-3baafaec7d80@web.de>
Date: Tue, 17 Sep 2024 08:33:06 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Takashi Iwai <tiwai@...e.de>, linux-sound@...r.kernel.org
Cc: Takashi Iwai <tiwai@...e.com>, LKML <linux-kernel@...r.kernel.org>,
 Jaroslav Kysela <perex@...ex.cz>, Julia Lawall <julia.lawall@...ia.fr>
Subject: Re: ALSA: i2c: cs8427: Use common code in snd_cs8427_qsubcode_get()

>> Add two labels so that a bit of exception handling can be better reused
>> at the end of this function implementation.

The implementation of the function “snd_cs8427_qsubcode_get” was identified
as another update candidate.
https://elixir.bootlin.com/linux/v6.11/source/sound/i2c/cs8427.c#L385
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/sound/i2c/cs8427.c?h=v6.11


> The double goto jumps aren't nice, either.

Would you like to care to avoid a bit of duplicate code from repeated
return statements?
https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources


> I guess we can do clean up better with cleanup.h stuff.

Scope-based resource management can eventually be applied also for
snd_i2c_unlock() calls.
https://elixir.bootlin.com/linux/v6.11/source/include/sound/i2c.h#L76

How do you think about to clarify any software extensions accordingly?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ