linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Module rewrite 2/20: bigrefs
Date: Wed, 25 Sep 2002 15:59:15 +1000	[thread overview]
Message-ID: <20020925061334.1745A2C057@lists.samba.org> (raw)
In-Reply-To: Your message of "Wed, 25 Sep 2002 13:51:28 +1000." <15761.12992.408142.964391@notabene.cse.unsw.edu.au>

In message <15761.12992.408142.964391@notabene.cse.unsw.edu.au> you write:
> On Wednesday September 25, rusty@rustcorp.com.au wrote:
> > +static inline void bigref_init(struct bigref *ref, int value)
> > +{
> > +	unsigned int i;
> > +	atomic_set(&ref->ref[0].counter, value);
> > +	for (i = 1; i < NR_CPUS; i++)
> -----------------^
> > +		atomic_set(&ref->ref[i].counter, 0);
> > +	ref->waiter = NULL; /* To trap bugs */
> > +}
> 
> Should this be '0', or should there be a comment explaining why it
> one?

No, if it were 0, it would overwrite the atomic_set() immediately
above it.  I didn't think a comment was required since this is the
most obvious way to initialize a per-cpu counter to a total value.

I could add:
	/* Set one to the value, the others to zero */

If you missed it, others probably will, too.
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

      reply	other threads:[~2002-09-25  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-25  3:00 Rusty Russell
2002-09-25  3:51 ` Neil Brown
2002-09-25  5:59   ` Rusty Russell [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=20020925061334.1745A2C057@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --subject='Re: [PATCH] Module rewrite 2/20: bigrefs' \
    /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

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).