All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/igt_core: Don't return too early in common_init_config
Date: Wed, 4 Nov 2020 12:34:10 +0200	[thread overview]
Message-ID: <20201104103410.GP7444@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <87eelanii5.wl-ashutosh.dixit@intel.com>

On Tue, Nov 03, 2020 at 03:11:14PM -0800, Dixit, Ashutosh wrote:
> On Tue, 03 Nov 2020 00:05:13 -0800, Petri Latvala wrote:
> >
> > On Mon, Nov 02, 2020 at 09:13:25PM -0800, Dixit, Ashutosh wrote:
> > > On Mon, 26 Oct 2020 01:48:40 -0700, Petri Latvala wrote:
> > > >
> > > > common_init_config is responsible for adding the device filters
> > > > supplied through the environment to the filter list. If the .igtrc
> > > > file cannot be opened, make sure the filter is added still.
> > > >
> > > > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > > > Cc: Arkadiusz Hiler <arek@hiler.eu>
> > > > ---
> > > >  lib/igt_core.c | 18 +++++++++---------
> > > >  1 file changed, 9 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/lib/igt_core.c b/lib/igt_core.c
> > > > index b358173f..8f9d925b 100644
> > > > --- a/lib/igt_core.c
> > > > +++ b/lib/igt_core.c
> > > > @@ -775,21 +775,20 @@ GKeyFile *igt_load_igtrc(void)
> > > >  static void common_init_config(void)
> > > >  {
> > > >	GError *error = NULL;
> > > > -	int ret;
> > > > +	int ret = 0;
> > > >
> > > >	igt_key_file = igt_load_igtrc();
> > > > -	if (!igt_key_file)
> > > > -		return;
> > >
> > > I believe the only change needed is the one above. The remaining
> > > igt_key_file checks below are not needed because it looks like if we pass
> > > NULL igt_key_file g_key_file_get_string will return NULL and
> > > g_key_file_get_integer will return 0 (that is previously initialized values
> > > are undisturbed).
> > >
> > > At the link below it is not clearly stated what happens when GKeyFile is
> > > NULL so I am mostly inferring from the way it is handling other error
> > > cases, so if we want to do this we'll probably need to test it out:
> >
> > If it's not documented to work that way, I'm wary of calling those
> > functions with NULL. It could behave differently in different versions
> > of glib.
> 
> OK, once again:
> 
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

Thanks, merged.


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

      reply	other threads:[~2020-11-04 10:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  8:48 [igt-dev] [PATCH i-g-t] lib/igt_core: Don't return too early in common_init_config Petri Latvala
2020-10-26  9:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-10-26 11:22 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-11-03  5:13 ` [igt-dev] [PATCH i-g-t] " Dixit, Ashutosh
2020-11-03  8:05   ` Petri Latvala
2020-11-03 23:11     ` Dixit, Ashutosh
2020-11-04 10:34       ` Petri Latvala [this message]

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=20201104103410.GP7444@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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.