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]
Date: Fri, 15 Dec 2023 17:24:22 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: davidgow@...gle.com
Cc: Rae Moar <rmoar@...gle.com>,
	Brendan Higgins <brendan.higgins@...ux.dev>,
	Matti Vaittinen <mazziesaccount@...il.com>,
	Stephen Boyd <sboyd@...nel.org>,
	Shuah Khan <skhan@...uxfoundation.org>,
	Jonathan Corbet <corbet@....net>, Kees Cook <keescook@...omium.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>, Maxime Ripard <mripard@...nel.org>,
	linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-hardening@...r.kernel.org, linux-sound@...r.kernel.org
Subject: Re: [PATCH v4 1/5] kunit: Add APIs for managing devices

On Fri, Dec 15, 2023 at 03:39:08PM +0800, davidgow@...gle.com wrote:
> Tests for drivers often require a struct device to pass to other
> functions. While it's possible to create these with
> root_device_register(), or to use something like a platform device, this
> is both a misuse of those APIs, and can be difficult to clean up after,
> for example, a failed assertion.
> 
> Add some KUnit-specific functions for registering and unregistering a
> struct device:
> - kunit_device_register()
> - kunit_device_register_with_driver()
> - kunit_device_unregister()
> 
> These helpers allocate a on a 'kunit' bus which will either probe the
> driver passed in (kunit_device_register_with_driver), or will create a
> stub driver (kunit_device_register) which is cleaned up on test shutdown.
> 
> Devices are automatically unregistered on test shutdown, but can be
> manually unregistered earlier with kunit_device_unregister() in order
> to, for example, test device release code.
> 
> Reviewed-by: Matti Vaittinen <mazziesaccount@...il.com>
> Reviewed-by: Maxime Ripard <mripard@...nel.org>
> Signed-off-by: David Gow <davidgow@...gle.com>

Nice work!

Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Powered by blists - more mailing lists