[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1373999746.1949.14.camel@joe-AO722>
Date: Tue, 16 Jul 2013 11:35:46 -0700
From: Joe Perches <joe@...ches.com>
To: Dmitry Kravkov <dkravkov@...il.com>
Cc: Dmitry Kravkov <dmitry@...adcom.com>,
Dave Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net 1/6] bnx2x: properly initialize statistic counters
On Tue, 2013-07-16 at 21:14 +0300, Dmitry Kravkov wrote:
> On Tue, Jul 16, 2013 at 7:24 PM, Joe Perches <joe@...ches.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists