All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] [PATCH] clean up  drivers/scsi/pcmcia/nsp_cs
Date: Wed, 07 Apr 2004 23:40:35 +0000	[thread overview]
Message-ID: <20040407164035.1efaff4e.rddunlap@osdl.org> (raw)
In-Reply-To: <407340C0.7050401@gmx.net>

[-- Attachment #1: Type: text/plain, Size: 1727 bytes --]

On Wed, 7 Apr 2004 09:49:11 +0200 Daniele Bellucci wrote:

| On Wed, Apr 07, 2004 at 01:44:00AM +0200, Michael Veeck wrote:
| |This patch (against 2.6.5) removes some unnecessary macros from 
| |drivers/scsi/pcmcia/nsp_cs.c and .h
| |
| |One Question: Like MIN/MAX and ARRAY_SIZE, it seems that BIT(x) is also 
| | defined a thousand times in the kernel. But which macro should be 
| |used? Here I included linux/input.h, but I do appreciate feedback on 
| |which version is the safest.

Having one version of BIT() would make some sense.
If there is truly only one version, it should end up in
linux/bitops.h.  If there is one version per arch, then it
should end up in include/asm-*/bitops.h.

Some arch-es use 1ULL to shift, some use 1UL, some use 1.
Only input.h does a modulo operator on the shift count AFAICT.
I would hope that the '%' isn't needed in general.
However, input.h's BIT() is the only one that is non-arch-specific
and potentially used (tested) on all arches.


| .. the problem occours with the dbg/info/warn macros defined in include/linux/usb.h
| 
| there are many other places where macro like that are defined in a different way,
| why don't we store all these usefull macros to a different file?

Like we have in include/linux/device.h ?   E.g.:

#define dev_err(dev, format, arg...)		\
	dev_printk(KERN_ERR , dev , format , ## arg)
#define dev_info(dev, format, arg...)		\
	dev_printk(KERN_INFO , dev , format , ## arg)
#define dev_warn(dev, format, arg...)		\
	dev_printk(KERN_WARNING , dev , format , ## arg)

However, these require a struct device <dev>.

--
~Randy
"We have met the enemy and he is us."  -- Pogo (by Walt Kelly)
(Again.  Sometimes I think ln -s /usr/src/linux/.config .signature)

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

      parent reply	other threads:[~2004-04-07 23:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 23:44 [Kernel-janitors] [PATCH] clean up drivers/scsi/pcmcia/nsp_cs Michael Veeck
2004-04-07  7:49 ` Daniele Bellucci
2004-04-07  7:56 ` Michael Veeck
2004-04-07 23:40 ` Randy.Dunlap [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=20040407164035.1efaff4e.rddunlap@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=kernel-janitors@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 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.