Re: [PATCH v5 2/2] firmware/fw_load: add fw_load02 for custom firmware path

Cyril Hrubis <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi!
> +static void setup(void)
> +{
> +	char fw_size_param[32];
> +	char *tmpdir = tst_tmpdir_path();
> +	struct tst_path_val fw_path = {
> +		.path = FW_PATH,
> +		.val = tmpdir,
> +		.flags = TST_SR_TCONF,
> +	};
> +
> +	tst_requires_module_signature_disabled();
> +
> +	/*
> +	 * Point the kernel firmware loader at our writable tmpdir so the
> +	 * test does not depend on a writable /lib/firmware. The previous
> +	 * value is restored automatically during cleanup.
> +	 */
> +	tst_sys_conf_save(&fw_path);

I would say that it's cleaner to add the save_restore to the tst_test
structure without the tmpdir value and use
SAFE_FILE_PRINTF(FW_PATH, "%s", tmpdir) in the test setup. Since if the
test crashes the test library will still restore the FW_PATH

-- 
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.