login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
March
»
29
Re: [PATCH] treewide: Add and use ADD_MOD macro
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Joe Perches
Subject:
Re: [PATCH] treewide: Add and use ADD_MOD macro
Date: Monday, March 29, 2010 - 1:00 pm
On Mon, 2010-03-29 at 12:47 -0700, Randy Dunlap wrote:
quoted text
> On Sun, 28 Mar 2010 14:57:27 -0700 Joe Perches wrote: > > Add a macro for the somewhat common use of > > (something + value) % value > > because the test uses ADD_MOD > > --- a/include/linux/kernel.h > > +++ b/include/linux/kernel.h > > +#define ADD_MOD(x, y) (((x) + (y)) % (y)) > It would be better not to evaluate y more than one time.
That could be said for nearly all the convenience macros in kernel.h
quoted text
> Also it's not safe for 64-bit 'y' on i386, right? > Looks like it would cause missing reference to __imoddi3 > or whatever it is called.
Which is also true for nearly all the convenience macros in kernel.h
quoted text
> so it can easily be misused IMO.
etc. --
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] treewide: Add and use ADD_MOD macro
, Joe Perches
, (Sun Mar 28, 2:57 pm)
Re: [PATCH] treewide: Add and use ADD_MOD macro
, Randy Dunlap
, (Mon Mar 29, 12:47 pm)
Re: [PATCH] treewide: Add and use ADD_MOD macro
, Joe Perches
, (Mon Mar 29, 1:00 pm)
[PATCH] kernel.h: Convert rounding macros to statement exp ...
, Joe Perches
, (Mon Mar 29, 2:09 pm)
Re: [PATCH] kernel.h: Convert rounding macros to statement ...
, Randy Dunlap
, (Mon Mar 29, 2:49 pm)
[PATCH V2] kernel.h: Convert rounding macros to statement ...
, Joe Perches
, (Mon Mar 29, 3:18 pm)
Re: [PATCH V2] kernel.h: Convert rounding macros to statem ...
, Andrew Morton
, (Mon Apr 5, 3:12 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Russell King
Re: ARM defconfig files
Jesse Barnes
Re: PCI MSI breaks when booting with nosmp
James Morris
Re: [AppArmor 01/41] Pass struct vfsmount to the inode_create LSM hook
Philip Langdale
[PATCH 2.6.19] mmc: Add support for SDHC cards (Take 4)
Oren Laadan
[PATCH v21 073/100] c/r: Add AF_UNIX support (v12)
git
:
Felipe Contreras
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Paolo Ciarrocchi
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Johannes Schindelin
[PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
Johannes Schindelin
Re: [PATCH] Fix install-doc-quick target
Peter Oberndorfer
Subject: [PATCH] fix stg edit command
linux-netdev
:
Ursula Braun
[patch 2/8] [PATCH] af_iucv: sync sk shutdown flag if iucv path is quiesced
Andi Kleen
Re: RFC: Nagle latency tuning
David Miller
Re: [RFC 0/5] generic rx recycling
Gary Thomas
Re: Marvell 88E609x switch?
Chuck Lever
Re: [RFC] ipv6: Change %pI6 format to output compacted addresses?
git-commits-head
:
Linux Kernel Mailing List
New device ID for sc92031 [1088:2031]
Linux Kernel Mailing List
e1000e: Expose MDI-X status via ethtool change
Linux Kernel Mailing List
arm/imx/gpio: GPIO_INT_{HIGH,LOW}_LEV are not necessarily constant
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
trivial: fix comment typo in fs/compat.c
openbsd-misc
:
Theo de Raadt
Re: RES: OpenBSD on IBM System X3550 7879
Bret S. Lambert
Re: any web management gui for pf ?
Rob Shepherd
x86 hardware for router system
Flickr Photo Map for iPad and iPhone
Thanks for the Great Launch of Flickr Photo Map for iPad + iPhone
Nick Holland
Re: Install OpenBSD from USB ?
Colocation donated by:
Syndicate