From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932299AbVHHWaf (ORCPT ); Mon, 8 Aug 2005 18:30:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932304AbVHHWaf (ORCPT ); Mon, 8 Aug 2005 18:30:35 -0400 Received: from coderock.org ([193.77.147.115]:29059 "EHLO trashy.coderock.org") by vger.kernel.org with ESMTP id S932299AbVHHWad (ORCPT ); Mon, 8 Aug 2005 18:30:33 -0400 Message-Id: <20050808223018.058795000@homer> References: <20050808222936.090422000@homer> Date: Tue, 09 Aug 2005 00:29:37 +0200 From: domen@coderock.org To: akpm@osdl.org Cc: linux-kernel@vger.kernel.org, Maximilian Attems , domen@coderock.org Subject: [patch 01/16] ide: min/max macros in ide-timing.h Content-Disposition: inline; filename=min-max-ide_ide-timing.h.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Clemens Buchacher I replaced the custom MIN/MAX macros with the type safe min/max macros from linux/kernel.h. >>From Clemens Buchacher Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- ide-timing.h | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) Index: quilt/drivers/ide/ide-timing.h =================================================================== --- quilt.orig/drivers/ide/ide-timing.h +++ quilt/drivers/ide/ide-timing.h @@ -27,6 +27,7 @@ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#include #include #define XFER_PIO_5 0x0d @@ -96,11 +97,9 @@ static struct ide_timing ide_timing[] = #define IDE_TIMING_UDMA 0x80 #define IDE_TIMING_ALL 0xff -#define MIN(a,b) ((a)<(b)?(a):(b)) -#define MAX(a,b) ((a)>(b)?(a):(b)) -#define FIT(v,min,max) MAX(MIN(v,max),min) -#define ENOUGH(v,unit) (((v)-1)/(unit)+1) -#define EZ(v,unit) ((v)?ENOUGH(v,unit):0) +#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) +#define ENOUGH(v,unit) (((v)-1)/(unit)+1) +#define EZ(v,unit) ((v)?ENOUGH(v,unit):0) #define XFER_MODE 0xf0 #define XFER_UDMA_133 0x48 @@ -188,14 +187,14 @@ static void ide_timing_quantize(struct i static void ide_timing_merge(struct ide_timing *a, struct ide_timing *b, struct ide_timing *m, unsigned int what) { - if (what & IDE_TIMING_SETUP ) m->setup = MAX(a->setup, b->setup); - if (what & IDE_TIMING_ACT8B ) m->act8b = MAX(a->act8b, b->act8b); - if (what & IDE_TIMING_REC8B ) m->rec8b = MAX(a->rec8b, b->rec8b); - if (what & IDE_TIMING_CYC8B ) m->cyc8b = MAX(a->cyc8b, b->cyc8b); - if (what & IDE_TIMING_ACTIVE ) m->active = MAX(a->active, b->active); - if (what & IDE_TIMING_RECOVER) m->recover = MAX(a->recover, b->recover); - if (what & IDE_TIMING_CYCLE ) m->cycle = MAX(a->cycle, b->cycle); - if (what & IDE_TIMING_UDMA ) m->udma = MAX(a->udma, b->udma); + if (what & IDE_TIMING_SETUP ) m->setup = max(a->setup, b->setup); + if (what & IDE_TIMING_ACT8B ) m->act8b = max(a->act8b, b->act8b); + if (what & IDE_TIMING_REC8B ) m->rec8b = max(a->rec8b, b->rec8b); + if (what & IDE_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b); + if (what & IDE_TIMING_ACTIVE ) m->active = max(a->active, b->active); + if (what & IDE_TIMING_RECOVER) m->recover = max(a->recover, b->recover); + if (what & IDE_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle); + if (what & IDE_TIMING_UDMA ) m->udma = max(a->udma, b->udma); } static struct ide_timing* ide_timing_find_mode(short speed) --