From: Jani Nikula <jani.nikula@intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 4/7] lib/params: add igt_params_open() which will return path
Date: Fri, 08 May 2020 14:07:20 +0300 [thread overview]
Message-ID: <87r1vu65xz.fsf@intel.com> (raw)
In-Reply-To: <20200507190944.19520-5-juhapekka.heikkila@gmail.com>
On Thu, 07 May 2020, Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> wrote:
> From: Jani Nikula <jani.nikula@intel.com>
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
I no longer have recollection how much of this is mine, and how much is
JP's. In any case, for the parts I've contributed,
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Feel free to retain or take authorship as you feel just.
BR,
Jani.
> ---
> lib/igt_params.c | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/lib/igt_params.c b/lib/igt_params.c
> index b5ac1266..fe4b1df3 100644
> --- a/lib/igt_params.c
> +++ b/lib/igt_params.c
> @@ -107,17 +107,7 @@ static void igt_params_save(int dir, const char *path, const char *name)
> module_params = data;
> }
>
> -/**
> - * igt_params_open:
> - * @device: fd of the device
> - *
> - * This opens the module parameters directory (under sysfs) corresponding
> - * to the device for use with igt_sysfs_set() and igt_sysfs_get().
> - *
> - * Returns:
> - * The directory fd, or -1 on failure.
> - */
> -int igt_params_open(int device)
> +static int __igt_params_open(int device, char **outpath)
> {
> int dir, params = -1;
>
> @@ -141,11 +131,28 @@ int igt_params_open(int device)
>
> sprintf(path, "/sys/module/%s/parameters", name);
> params = open(path, O_RDONLY);
> + if (params >= 0 && outpath)
> + *outpath = strdup(path);
> }
>
> return params;
> }
>
> +/**
> + * igt_params_open:
> + * @device: fd of the device
> + *
> + * This opens the module parameters directory (under sysfs) corresponding
> + * to the device for use with igt_sysfs_set() and igt_sysfs_get().
> + *
> + * Returns:
> + * The directory fd, or -1 on failure.
> + */
> +int igt_params_open(int device)
> +{
> + return __igt_params_open(device, NULL);
> +}
> +
> /**
> * igt_params_set:
> * @device: fd of the device
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-05-08 11:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-07 19:09 [igt-dev] [PATCH i-g-t 0/7] Use device dependant module parameters Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 1/7] lib/params: add igt_params.c for module parameter access Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 2/7] lib/params: start renaming functions igt_params_* Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 3/7] lib/params: overhaul param saving Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 4/7] lib/params: add igt_params_open() which will return path Juha-Pekka Heikkila
2020-05-08 11:07 ` Jani Nikula [this message]
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 5/7] igt/params: add generic saving module parameter set Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 6/7] igt/params: use igt_params_set_save for igt_set_module_param* Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 7/7] tests/gem_eio: switch to using igt_params_set() Juha-Pekka Heikkila
2020-05-07 21:10 ` [igt-dev] ✗ Fi.CI.BAT: failure for Use device dependant module parameters (rev6) Patchwork
2020-05-08 4:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for Use device dependant module parameters (rev7) Patchwork
2020-05-08 5:00 ` [igt-dev] ✗ Fi.CI.BAT: failure for Use device dependant module parameters (rev8) Patchwork
2020-05-08 7:09 ` [igt-dev] ✓ Fi.CI.BAT: success for Use device dependant module parameters (rev9) Patchwork
2020-05-08 10:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2020-04-28 20:22 [igt-dev] [PATCH i-g-t 0/7] Use device dependant module parameters Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 4/7] lib/params: add igt_params_open() which will return path Juha-Pekka Heikkila
2020-05-05 7:07 ` Petri Latvala
2020-05-05 18:44 ` Juha-Pekka Heikkila
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=87r1vu65xz.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.com \
--cc=petri.latvala@intel.com \
/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