netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrea Claudi <aclaudi@redhat.com>
Cc: netdev@vger.kernel.org, dsahern@gmail.com, haliu@redhat.com
Subject: Re: [PATCH iproute2] lib: bpf_glue: remove useless assignment
Date: Wed, 11 Aug 2021 09:08:15 -0700	[thread overview]
Message-ID: <20210811090815.0a6363db@hermes.local> (raw)
In-Reply-To: <YROUi1WhHneQR/qz@renaissance-vector>

On Wed, 11 Aug 2021 11:12:43 +0200
Andrea Claudi <aclaudi@redhat.com> wrote:

> On Tue, Aug 10, 2021 at 08:00:48PM -0700, Stephen Hemminger wrote:
> > On Sat,  7 Aug 2021 18:58:02 +0200
> > Andrea Claudi <aclaudi@redhat.com> wrote:
> >   
> > > -	while ((s = fgets(buf, sizeof(buf), fp)) != NULL) {
> > > +	while (fgets(buf, sizeof(buf), fp) != NULL) {
> > >  		if ((s = strstr(buf, "libbpf.so.")) != NULL) {  
> > 
> > Ok. but it would be good to get rid of the unnecessary assignment in conditional as well.
> >   
> Hi Stephen,
> That's not unnecessary, s is used as the second parameter in the following strncpy().
> 


It is bad style in C to do assignment in a conditional.
It causes errors, and is not anymore efficient.


  reply	other threads:[~2021-08-11 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 16:58 [PATCH iproute2] lib: bpf_glue: remove useless assignment Andrea Claudi
2021-08-11  3:00 ` Stephen Hemminger
2021-08-11  9:12   ` Andrea Claudi
2021-08-11 16:08     ` Stephen Hemminger [this message]
2021-08-12  9:01       ` Andrea Claudi
2021-08-12 16:26         ` Stephen Hemminger

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=20210811090815.0a6363db@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aclaudi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=haliu@redhat.com \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).