public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/4] tst_kernel: Add safe_check_driver()
Date: Fri, 13 Oct 2023 14:24:08 +0200	[thread overview]
Message-ID: <20231013122408.GB733568@pevik> (raw)
In-Reply-To: <20231013074748.702214-2-pvorel@suse.cz>

Hi All,

...
>  int tst_check_driver(const char *driver);

> +/*
> + * Checks support for the kernel module (both built-in and loadable)
> + * and exit with TCONF if driver not available.
> + *
> + * @param driver The name of the driver.
> + * On Android it *always* passes (always expect the driver is available).
> + */
> +void safe_check_driver(const char *driver);

In the end, I haven't used this function in the second commit,
thus this function is useless (used only on single place).
I'll remove it in v2 (still waiting for more input if whole .modprobe option is
worth of merging).

Kind regards,
Petr

> +
>  #endif	/* TST_KERNEL_H__ */
> diff --git a/lib/tst_kernel.c b/lib/tst_kernel.c
> index 4b75ceadb..de4c28308 100644
> --- a/lib/tst_kernel.c
> +++ b/lib/tst_kernel.c
> @@ -198,3 +198,9 @@ int tst_check_driver(const char *driver)

>  	return -1;
>  }
> +
> +void safe_check_driver(const char *driver)
> +{
> +	if (tst_check_driver(driver))
> +		tst_brkm(TCONF, NULL, "%s driver not available", driver);
> +}
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index c2f8f503f..087c62a16 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1191,8 +1191,7 @@ static void do_setup(int argc, char *argv[])
>  		int i;

>  		for (i = 0; (name = tst_test->needs_drivers[i]); ++i)
> -			if (tst_check_driver(name))
> -				tst_brk(TCONF, "%s driver not available", name);
> +			safe_check_driver(name);
>  	}

>  	if (tst_test->mount_device)

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-10-13 12:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  7:47 [LTP] [PATCH 0/4] Add .modprobe (loading modules in C API) Petr Vorel
2023-10-13  7:47 ` [LTP] [PATCH 1/4] tst_kernel: Add safe_check_driver() Petr Vorel
2023-10-13 12:24   ` Petr Vorel [this message]
2023-10-13  7:47 ` [LTP] [PATCH 2/4] lib: Add .modprobe Petr Vorel
2023-10-13 12:09   ` Li Wang
2023-10-13 12:22     ` Petr Vorel
2023-10-16  9:05     ` Li Wang
2023-10-27 12:01     ` Petr Vorel
2023-11-01 16:33       ` Cyril Hrubis
2023-11-03 15:22         ` Petr Vorel
2023-10-13 12:30   ` Petr Vorel
2023-10-13 13:27     ` Li Wang
2023-10-13 13:50       ` Petr Vorel
2023-10-16  8:28         ` Li Wang
2023-11-01 16:26   ` Cyril Hrubis
2023-11-01 16:35     ` Cyril Hrubis
2023-11-03 15:54       ` Petr Vorel
2023-11-03 16:31         ` Edward Liaw via ltp
2023-11-03 12:12     ` Petr Vorel
2023-11-03 12:21       ` Cyril Hrubis
2023-11-03 14:58         ` Petr Vorel
2023-10-13  7:47 ` [LTP] [PATCH 3/4] madvise11: Replace .needs_drivers with .modprobe Petr Vorel
2023-10-13  7:47 ` [LTP] [PATCH 4/4] can_bcm01: Move vcan to .modprobe Petr Vorel
2023-11-02  9:22   ` Richard Palethorpe
2023-11-03 15:08     ` Petr Vorel
2023-10-16  7:47 ` [LTP] [PATCH 0/4] Add .modprobe (loading modules in C API) Richard Palethorpe
2023-10-16  8:41   ` Richard Palethorpe
2023-10-16 15:12   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231013122408.GB733568@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox