All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Amritha Nambiar <amritha.nambiar@intel.com>
Cc: netdev@vger.kernel.org, alexander.h.duyck@intel.com,
	kiran.patil@intel.com, sridhar.samudrala@intel.com,
	mitch.a.williams@intel.com, alexander.duyck@gmail.com,
	neerav.parikh@intel.com, carolyn.wyborny@intel.com,
	jeffrey.t.kirsher@intel.com
Subject: Re: [PATCH RFC, iproute2] tc/mirred: Extend the mirred/redirect action to accept additional traffic class parameter
Date: Mon, 31 Jul 2017 20:51:33 -0700	[thread overview]
Message-ID: <20170731205133.5e58e47c@xeon-e3> (raw)
In-Reply-To: <150154805003.4819.12498976860683140342.stgit@anamdev.jf.intel.com>

On Mon, 31 Jul 2017 17:40:50 -0700
Amritha Nambiar <amritha.nambiar@intel.com> wrote:
The concept is fine, bu t the code looks different than the rest which
is never a good sign.


> +				if ((argc > 0) && (matches(*argv, "tc") == 0)) {

Extra () are unnecessary in compound conditional.

> +					tc = atoi(*argv);

Prefer using strtoul since it has better error handling than atoi()

> +					argc--;
> +					argv++;
> +				}


Use NEXT_ARG() construct like rest of the code.

  reply	other threads:[~2017-08-01  3:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01  0:40 [PATCH RFC, iproute2] tc/mirred: Extend the mirred/redirect action to accept additional traffic class parameter Amritha Nambiar
2017-08-01  3:51 ` Stephen Hemminger [this message]
2017-08-01 15:12   ` David Laight
2017-08-02 18:28     ` Nambiar, Amritha
2017-08-01 14:02 ` Roman Mashak
2017-08-02 18:41 ` Roopa Prabhu
2017-08-02 18:58   ` Nambiar, Amritha

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=20170731205133.5e58e47c@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=alexander.duyck@gmail.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=amritha.nambiar@intel.com \
    --cc=carolyn.wyborny@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=kiran.patil@intel.com \
    --cc=mitch.a.williams@intel.com \
    --cc=neerav.parikh@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@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 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.