mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel.crashing.org>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][RESEND] Cleanup (BIN|BCD)_TO_(BCD|BIN) usage/macros
Date: Tue, 17 Sep 2002 11:49:49 -0700	[thread overview]
Message-ID: <20020917184949.GB726@opus.bloom.county> (raw)
In-Reply-To: <3D8776FF.3050504@mandrakesoft.com>

On Tue, Sep 17, 2002 at 02:39:59PM -0400, Jeff Garzik wrote:
> Tom Rini wrote:
> >Right now there's a bit of a mess with all of the BIN_TO_BCD/BCD_TO_BIN
> >macros in the kernel.  It's defined in a half dozen places, and worse
> >yet, not all places use them the same way.  Most users do something
> >like:
> >if ( ... )
> >   BIN_TO_BCD(x);
> >
> >But in a few places, it's used as:
> >if ( ... )
> >   y = BIN_TO_BCD(x);
> >
> >The following creates include/linux/bcd.h which has the 'normal'
> >BIN_TO_BCD macros, as well as CONVERT_{BIN,BCD}_TO_{BCD,BIN},
> >which are for the second case.
> 
> hmmm... removing all the private definitions certainly makes good sense, 
> but having both CONVERT_foo and foo seems a bit wonky...
> 
> IMO it would be better to have BIN_TO_BCD which returns a value, and 
> __BIN_TO_BCD which has side effects but returns no value...

Well, this was done in part to minimize change.  The version which
returns no value is far more common than the one which does, and would
require changing a lot more files (and would also make getting this into
2.4 harder too, which I would like to do someday if this gets into 2.5). 
The other reason is that CONVERT_foo makes it quite obvious what is being
done, where as __xxx at least in my mind has namespace imlpications
(like how it's used in libc, etc.  But kernel namespace isn't like the
rest I know..).

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

  reply	other threads:[~2002-09-17 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-17 18:29 Tom Rini
2002-09-17 18:39 ` Jeff Garzik
2002-09-17 18:49   ` Tom Rini [this message]
2002-09-20 14:39   ` Tom Rini
2002-09-20 14:56     ` Jeff Garzik

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=20020917184949.GB726@opus.bloom.county \
    --to=trini@kernel.crashing.org \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®