From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harvey Harrison Subject: [PATCH 05/11] ata: replace macro with static inline in libata.h Date: Wed, 13 Feb 2008 21:14:18 -0800 Message-ID: <1202966058.2748.19.camel@brick> References: <3ad7c41048d88a3f8aad098570b9fac9ff719aff.1202965399.git.harvey.harrison@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from wx-out-0506.google.com ([66.249.82.231]:8412 "EHLO wx-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758804AbYBNFOV (ORCPT ); Thu, 14 Feb 2008 00:14:21 -0500 Received: by wx-out-0506.google.com with SMTP id h31so224555wxd.4 for ; Wed, 13 Feb 2008 21:14:21 -0800 (PST) In-Reply-To: <3ad7c41048d88a3f8aad098570b9fac9ff719aff.1202965399.git.harvey.harrison@gmail.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Jeff Garzik , Tejun Heo Cc: LKML , linux-ide Avoid a metric ton of 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 --- include/linux/libata.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/include/linux/libata.h b/include/linux/libata.h index bc5a8d0..2845983 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -764,7 +764,11 @@ 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) +{ + short tmp = min_t(short, v, vmax); + return max_t(short, tmp, vmin); +} extern const unsigned long sata_deb_timing_normal[]; extern const unsigned long sata_deb_timing_hotplug[]; -- 1.5.4.1.1278.gc75be