All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: igt-dev@lists.freedesktop.org, Jani Nikula <jani.nikula@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 5/7] igt/params: add generic saving module parameter set
Date: Wed, 6 May 2020 13:09:04 +0300	[thread overview]
Message-ID: <20200506100904.GV9497@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <68a9eb1a-4ed7-7ca1-7161-7b3ec740b319@gmail.com>

On Wed, May 06, 2020 at 12:54:37PM +0300, Juha-Pekka Heikkila wrote:
> On 6.5.2020 12.05, Arkadiusz Hiler wrote:
> > On Tue, May 05, 2020 at 11:00:03PM +0300, Juha-Pekka Heikkila wrote:
> > > On 5.5.2020 21.46, Juha-Pekka Heikkila wrote:
> > > > On 5.5.2020 17.09, Arkadiusz Hiler wrote:
> > > > > On Tue, Apr 28, 2020 at 11:22:53PM +0300, Juha-Pekka Heikkila wrote:
> > > > > > From: Jani Nikula <jani.nikula@intel.com>
> > > > > > 
> > > > > > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > > > > > Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> > > > > > ---
> > > > > >    lib/igt_params.c | 57 ++++++++++++++++++++++++++++++++++++++++--------
> > > > > >    lib/igt_params.h |  3 +++
> > > > > >    2 files changed, 51 insertions(+), 9 deletions(-)
> > > > > > 
> > > > > > diff --git a/lib/igt_params.c b/lib/igt_params.c
> > > > > > index fe4b1df3..d9cf986c 100644
> > > > > > --- a/lib/igt_params.c
> > > > > > +++ b/lib/igt_params.c
> > > > > > @@ -153,6 +153,29 @@ int igt_params_open(int device)
> > > > > >        return __igt_params_open(device, NULL);
> > > > > >    }
> > > > > > +__attribute__((format(printf, 3, 0)))
> > > > > 
> > > > > this is using a va_list, not "...", so this format attirbue should not
> > > > > be here
> > > > > 
> > > > 
> > > > Good catch
> > > > 
> > > 
> > > Looking it with bit more thought, what's wrong with it? I think it is
> > > required there.
> > 
> > I found it a bit useless that we do printf format checking without
> > having any arugments to match types for as they are wrapped in va_list,
> > but if compilers are screeming that it's necessary so be it.
> > 
> > Not sure what benefit does it provide though.
> 
> Benefit is not to get compiler warning which would be caused from later
> usage of vsnprintf. Other way to avoid it is to take out
> "missing-format-attribute" warnings.

First I thought format_arg(3) is proper here but after checking the
docs, it is as J-P says:

"For functions where the arguments are not available to be checked
(such as vprintf), specify the third parameter as zero. In this case
the compiler only checks the format string for consistency."


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-05-06 10:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/7] lib/params: add igt_params.c for module parameter access Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 2/7] lib/params: start renaming functions igt_params_* Juha-Pekka Heikkila
2020-05-05 14:04   ` Arkadiusz Hiler
2020-05-05 18:43     ` Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 3/7] lib/params: overhaul param saving Juha-Pekka Heikkila
2020-05-05  7:05   ` Petri Latvala
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
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 5/7] igt/params: add generic saving module parameter set Juha-Pekka Heikkila
2020-05-05  7:16   ` Petri Latvala
2020-05-05 18:44     ` Juha-Pekka Heikkila
2020-05-05 14:09   ` Arkadiusz Hiler
2020-05-05 18:46     ` Juha-Pekka Heikkila
2020-05-05 20:00       ` Juha-Pekka Heikkila
2020-05-06  9:05         ` Arkadiusz Hiler
2020-05-06  9:54           ` Juha-Pekka Heikkila
2020-05-06 10:09             ` Petri Latvala [this message]
2020-04-28 20:22 ` [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-05  7:20   ` Petri Latvala
2020-05-05 14:22   ` Arkadiusz Hiler
2020-05-06  7:34   ` Petri Latvala
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 7/7] tests/gem_eio: switch to using igt_params_set() Juha-Pekka Heikkila
2020-05-05  7:41   ` Petri Latvala
2020-04-28 21:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Use device dependant module parameters (rev5) Patchwork
2020-04-29  1:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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 5/7] igt/params: add generic saving module parameter set 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=20200506100904.GV9497@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=juhapekka.heikkila@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.