lkml.org 
[lkml]   [2001]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: about include/linux/macros.h ...

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:56    [W:0.046 / U:3.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site