login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
February
»
20
Re: [PATCH] ata: replace macro with static inline in libata.h
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Jeff Garzik <jeff@...>
To: Harvey Harrison <harvey.harrison@...>
Cc: Andrew Morton <akpm@...>, Alan Cox <alan@...>, LKML <linux-kernel@...>
Subject:
Re: [PATCH] ata: replace macro with static inline in libata.h
Date: Wednesday, February 20, 2008 - 1:16 pm
Harvey Harrison wrote:
quoted text
> Avoid ~70 sparse warnings like: > drivers/ata/pata_ali.c:176:14: warning: symbol '__x' shadows an earlier one > drivers/ata/pata_ali.c:176:14: originally declared here > > Due to nesting min_t macro inside max_t macro which both use a __x > identifier internally. > > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> > --- > Andrew, here is a patch that drastically reduces the number of sparse > warnings in libata. Alan Cox has suggested a clamp_t macro be added > to kernel.h instead to avoid this issue. I don't believe Jeff Garzik > has given an opinion yet (other than not applying it when originally > sent this was 5/11 of the libata sparse warnings) > > include/linux/libata.h | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/include/linux/libata.h b/include/linux/libata.h > index bc5a8d0..b5590fb 100644 > --- a/include/linux/libata.h > +++ b/include/linux/libata.h > @@ -764,7 +764,14 @@ struct ata_timing { > unsigned short udma; /* t2CYCTYP/2 */ > }; > > -#define FIT(v, vmin, vmax) max_t(short, min_t(short, v, vmax), vmin) > +static inline short FIT(short v, short vmin, short vmax) > +{ > + if (v >= vmax) > + return vmax; > + if (v <= vmin) > + return vmin; > + return v; > +}
I agree with Alan... --
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] ata: replace macro with static inline in libata.h
, Harvey Harrison
, (Mon Feb 18, 12:07 pm)
Re: [PATCH] ata: replace macro with static inline in libata.h
, Jeff Garzik
, (Wed Feb 20, 1:16 pm)
[PATCH] ata: use clamp_t macro to avoid sparse warnings
, Harvey Harrison
, (Wed Feb 20, 1:36 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mariusz Kozlowski
[PATCH 01] kmalloc + memset conversion co kzalloc
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Vladislav Bolkhovitin
Re: Integration of SCST in the mainstream Linux kernel
Jeremy Allison
Re: [RFC] Heads up on sys_fallocate()
git
:
git-commits-head
:
linux-netdev
:
Gerrit Renker
[PATCH 0/37] dccp: Feature negotiation - last call for comments
Natalie Protasevich
[BUG] New Kernel Bugs
David Miller
Re: [GIT]: Networking
Jeff Garzik
Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin"
Colocation donated by:
Who's online
There are currently
3 users
and
830 guests
online.
Online users
strcmp
shawnsample
kmatbuncitp
Syndicate