public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* about include/linux/macros.h ...
@ 2001-07-04 23:33 Davide Libenzi
  2001-07-05 22:17 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Davide Libenzi @ 2001-07-04 23:33 UTC (permalink / raw)
  To: linux-kernel


What about the creation of such file containing useful macros like min(),
max(), abs(), etc.. that otherwise everyone is forced to define like :

#ifndef ...
#define ...
#endif




- Davide


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: about include/linux/macros.h ...
  2001-07-04 23:33 about include/linux/macros.h Davide Libenzi
@ 2001-07-05 22:17 ` Greg KH
  2001-07-05 22:35   ` Davide Libenzi
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2001-07-05 22:17 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: linux-kernel

On Wed, Jul 04, 2001 at 04:33:51PM -0700, Davide Libenzi wrote:
> 
> What about the creation of such file containing useful macros like min(),
> max(), abs(), etc.. that otherwise everyone is forced to define like :

See include/linux/netfilter.h, around line 164 for the reason why there
isn't a kernel wide min() or max() macro.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: about include/linux/macros.h ...
  2001-07-05 22:17 ` Greg KH
@ 2001-07-05 22:35   ` Davide Libenzi
  2001-07-05 23:00     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Davide Libenzi @ 2001-07-05 22:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel


On 05-Jul-2001 Greg KH wrote:
> On Wed, Jul 04, 2001 at 04:33:51PM -0700, Davide Libenzi wrote:
>> 
>> What about the creation of such file containing useful macros like min(),
>> max(), abs(), etc.. that otherwise everyone is forced to define like :
> 
> See include/linux/netfilter.h, around line 164 for the reason why there
> isn't a kernel wide min() or max() macro.

Ok, let's continue like this :

./fs/ufs/util.h:#define min(x,y)                ((x)<(y)?(x):(y))
./fs/ntfs/macros.h:#define min(a,b)     ((a) <= (b) ? (a) : (b))
./include/linux/mtd/cfi.h:#define min(x,y) ( (x)<(y)?(x):(y) )
./include/linux/wanpipe.h:#define min(a,b) (((a)<(b))?(a):(b))
./include/linux/cyclomx.h:#define min(a,b) (((a)<(b))?(a):(b))
./include/linux/lvm.h:#define min(a,b) (((a)<(b))?(a):(b))
./net/khttpd/prototypes.h:#define min(a,b)  ( (a) < (b) ? (a) : (b) )
./drivers/net/wan/comx.h:#define min(a,b)               ((a) > (b) ? (b) : (a))
./drivers/net/hamradio/soundmodem/sm.h:#define min(a, b) (((a) < (b)) ? (a):(b))
./drivers/char/agp/agp.h:#define min(a,b)       (((a)<(b))?(a):(b))
./drivers/scsi/eata_generic.h:#define min(a,b) ((a<b)?(a):(b))
./drivers/sound/emu10k1/hwaccess.h:#define min(x,y) ((x) < (y)) ? (x) : (y)
./drivers/sound/dmasound/dmasound.h:#define min(x, y)   ((x) < (y) ? (x) : (y))
./drivers/video/cyberfb.h:#define min(a,b)      ((a) < (b) ? (a) : (b))
./drivers/acorn/scsi/acornscsi.h:#define min(x,y) ((x) < (y) ? (x) : (y))
./drivers/usb/usb-ohci.h:#define min(a,b) (((a)<(b))?(a):(b))
./drivers/usb/usb-uhci.h:#define min(a,b) (((a)<(b))?(a):(b))
./drivers/telephony/ixj.h:#define min(a,b) (((a)<(b))?(a):(b))
./arch/cris/drivers/usb-host.h:#define min(a,b) (((a)<(b))?(a):(b))            
./fs/ufs/util.h:#define max(x,y)  ((x)>(y)?(x):(y))
./fs/ntfs/macros.h:#define max(a,b)     ((a) >= (b) ? (a) : (b))
./include/linux/wanpipe.h:#define max(a,b) (((a)>(b))?(a):(b))
./include/linux/cyclomx.h:#define max(a,b) (((a)>(b))?(a):(b))
./include/linux/lvm.h:#define max(a,b) (((a)>(b))?(a):(b))
./net/khttpd/prototypes.h:#define max(a,b)  ( (a) > (b) ? (a) : (b) )
./drivers/net/wan/comx.h:#define max(a,b)               ((a) > (b) ? (a) : (b))
./drivers/net/hamradio/soundmodem/sm.h:#define max(a, b) (((a) > (b)) ? (a):(b))
./drivers/video/cyberfb.h:#define max(a,b)      ((a) > (b) ? (a) : (b))
./drivers/acorn/scsi/acornscsi.h:#define max(x,y) ((x) < (y) ? (y) : (x))
./drivers/telephony/ixj.h:#define max(a,b) (((a)>(b))?(a):(b))                 
                                             



- Davide


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: about include/linux/macros.h ...
  2001-07-05 22:35   ` Davide Libenzi
@ 2001-07-05 23:00     ` Greg KH
  2001-07-06  9:39       ` GOTO Masanori
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2001-07-05 23:00 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: linux-kernel

On Thu, Jul 05, 2001 at 03:35:03PM -0700, Davide Libenzi wrote:
> 
> Ok, let's continue like this :

I know, look at the ones that I am personally responsible for:

./drivers/usb/serial/usbserial.c:#define MAX(a,b)    (((a)>(b))?(a):(b))
./drivers/usb/serial/io_edgeport.h:  #define MAX(a,b)        (((a)>(b))?(a):(b))

I'm not disagreeing about the current mess, just trying to explain why
this mess is there.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: about include/linux/macros.h ...
  2001-07-05 23:00     ` Greg KH
@ 2001-07-06  9:39       ` GOTO Masanori
  0 siblings, 0 replies; 5+ messages in thread
From: GOTO Masanori @ 2001-07-06  9:39 UTC (permalink / raw)
  To: greg; +Cc: davidel, linux-kernel

At Thu, 5 Jul 2001 16:00:33 -0700,
Greg KH <greg@kroah.com> wrote:
> > 
> > Ok, let's continue like this :
> 
> I know, look at the ones that I am personally responsible for:
> 
> ./drivers/usb/serial/usbserial.c:#define MAX(a,b)    (((a)>(b))?(a):(b))
> ./drivers/usb/serial/io_edgeport.h:  #define MAX(a,b)        (((a)>(b))?(a):(b))
> 
> I'm not disagreeing about the current mess, just trying to explain why
> this mess is there.

Me too. Merging them into one header is good idea, IMHO.

-- gotom



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-06  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-04 23:33 about include/linux/macros.h Davide Libenzi
2001-07-05 22:17 ` Greg KH
2001-07-05 22:35   ` Davide Libenzi
2001-07-05 23:00     ` Greg KH
2001-07-06  9:39       ` GOTO Masanori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox