public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Jan Stancek <jstancek@redhat.com>
Cc: LTP <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH V3] lib: add tst_kvercmp2 to compare specific vendor extra kernel versions
Date: Thu, 11 Jul 2013 11:37:07 +0200	[thread overview]
Message-ID: <20130711093707.GA6142@rei.suse.cz> (raw)
In-Reply-To: <1212845049.2016896.1373481206257.JavaMail.root@redhat.com>

Hi!
> > > +static int tst_kexvcmp(char *tst_exv, char *cur_ver)
> > > +{
> > > +	int c1 = 0, c2 = 0, t1 = 0, t2 = 0;
> > > +	int ret;
> > > +
> > > +	sscanf(cur_ver, "%*d.%*d.%*d-%d.%d", &c1, &c2);
> > > +	sscanf(tst_exv, "%d.%d", &t1, &t2);
> > > +	if ((ret = c1 - t1))
> > 
> > not sure if the brackets are duplicated...
> 
> What caught my (and checkpatch's) eye is that these are assignments in if condition,
> but I'm not sure how strictly we take checkpatch output.

Assignment inside of condition is generally considered as a tricky
statement which is why checkpatch gives a warning.

I'm personally not against it as long as it's simple statement like this
but if other people here disagree I'm fine with treating it as a wrong
thing to do.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      parent reply	other threads:[~2013-07-11  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1373356491-15338-1-git-send-email-gaowanlong@cn.fujitsu.com>
2013-07-10 13:38 ` [LTP] [PATCH V3] lib: add tst_kvercmp2 to compare specific vendor extra kernel versions chrubis
     [not found] ` <51DD9B64.7050802@casparzhang.com>
2013-07-10 18:33   ` Jan Stancek
2013-07-11  1:14     ` Wanlong Gao
2013-07-11  9:37     ` chrubis [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=20130711093707.GA6142@rei.suse.cz \
    --to=chrubis@suse.cz \
    --cc=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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