From: Joe Perches <joe@perches.com>
To: Dmitry Kravkov <dkravkov@gmail.com>
Cc: Dmitry Kravkov <dmitry@broadcom.com>,
Dave Miller <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net 1/6] bnx2x: properly initialize statistic counters
Date: Tue, 16 Jul 2013 11:35:46 -0700 [thread overview]
Message-ID: <1373999746.1949.14.camel@joe-AO722> (raw)
In-Reply-To: <CAM8tLiPqKWxO7w9kL2LjGxFNth6oRV7-JccU+LXiFk9Roass5w@mail.gmail.com>
On Tue, 2013-07-16 at 21:14 +0300, Dmitry Kravkov wrote:
> On Tue, Jul 16, 2013 at 7:24 PM, Joe Perches <joe@perches.com> wrote:
> > It might be better to remove init_fw_counter from
> > stack and use a #define or just use cpu_to_le16(0xffff)
> > in each init.
>
> I'm not feel well for using same value in each init, probably is better to use
> multiple assignment like this:
> counters->xstats_counter =
> counters->tstats_counter =
> counters->ustats_counter =
> counters->cstats_counter = cpu_to_le16(0xffff);
Your choice though maybe here's a couple of things
to consider:
I do think aligning all the counter variables useful
when reading so
count->xstats_counter =
count->tstats_counter =
count->ustats_counter =
count->cstats_counter = foo;
would be better. Unfortunately grep wouldn't show
that actual initialization where:
count->xstats_counter = foo;
count->tstats_counter = foo;
count->ustats_counter = foo;
count->cstats_counter = foo;
would and the compiler would do the same thing as
the a = b = c = d = foo; case.
next prev parent reply other threads:[~2013-07-16 18:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 15:21 [PATCH net 0/6] bnx2x: fixes Dmitry Kravkov
2013-07-16 15:21 ` [PATCH net 1/6] bnx2x: properly initialize statistic counters Dmitry Kravkov
2013-07-16 16:24 ` Joe Perches
2013-07-16 18:14 ` Dmitry Kravkov
2013-07-16 18:35 ` Joe Perches [this message]
2013-07-16 15:21 ` [PATCH net 2/6] bnx2x: prevent statistics update flow to act before statistics are started Dmitry Kravkov
2013-07-16 18:14 ` Sergei Shtylyov
2013-07-16 15:21 ` [PATCH net 3/6] bnx2x: update fairness parameters following DCB negotiation Dmitry Kravkov
2013-07-16 15:21 ` [PATCH net 4/6] bnx2x: fix memory leak in VF Dmitry Kravkov
2013-07-16 18:12 ` Sergei Shtylyov
2013-07-16 15:21 ` [PATCH net 5/6] bnx2x: fix PTE write access error Dmitry Kravkov
2013-07-16 15:21 ` [PATCH net 6/6] bnx2x: prevent crash in shutdown flow with CNIC Dmitry Kravkov
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=1373999746.1949.14.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=dkravkov@gmail.com \
--cc=dmitry@broadcom.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