diff options
author | Clemens Buchacher <drizzd@aon.at> | 2005-09-10 03:27:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 13:06:31 -0400 |
commit | 2665b891c42ef67eb4cb51d665b523892f992749 (patch) | |
tree | a2888f33b1f70f12e0ed2f97f97717b73822ee69 /drivers/ide/ide-timing.h | |
parent | ecec4cb7a9df5f61fe00710d2f2c69ce9a3b1d40 (diff) |
[PATCH] janitor: ide: min/max macros in ide-timing.h
I replaced the custom MIN/MAX macros with the type safe min/max macros
from linux/kernel.h.
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
Signed-off-by: Domen Puncer <domen@coderock.org>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/ide-timing.h')
-rw-r--r-- | drivers/ide/ide-timing.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/ide/ide-timing.h b/drivers/ide/ide-timing.h index c1196ce15b4..2fcfac6e967 100644 --- a/drivers/ide/ide-timing.h +++ b/drivers/ide/ide-timing.h | |||
@@ -27,6 +27,7 @@ | |||
27 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | 27 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/kernel.h> | ||
30 | #include <linux/hdreg.h> | 31 | #include <linux/hdreg.h> |
31 | 32 | ||
32 | #define XFER_PIO_5 0x0d | 33 | #define XFER_PIO_5 0x0d |
@@ -96,11 +97,9 @@ static struct ide_timing ide_timing[] = { | |||
96 | #define IDE_TIMING_UDMA 0x80 | 97 | #define IDE_TIMING_UDMA 0x80 |
97 | #define IDE_TIMING_ALL 0xff | 98 | #define IDE_TIMING_ALL 0xff |
98 | 99 | ||
99 | #define MIN(a,b) ((a)<(b)?(a):(b)) | 100 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) |
100 | #define MAX(a,b) ((a)>(b)?(a):(b)) | 101 | #define ENOUGH(v,unit) (((v)-1)/(unit)+1) |
101 | #define FIT(v,min,max) MAX(MIN(v,max),min) | 102 | #define EZ(v,unit) ((v)?ENOUGH(v,unit):0) |
102 | #define ENOUGH(v,unit) (((v)-1)/(unit)+1) | ||
103 | #define EZ(v,unit) ((v)?ENOUGH(v,unit):0) | ||
104 | 103 | ||
105 | #define XFER_MODE 0xf0 | 104 | #define XFER_MODE 0xf0 |
106 | #define XFER_UDMA_133 0x48 | 105 | #define XFER_UDMA_133 0x48 |
@@ -188,14 +187,14 @@ static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int | |||
188 | 187 | ||
189 | static void ide_timing_merge(struct ide_timing *a, struct ide_timing *b, struct ide_timing *m, unsigned int what) | 188 | static void ide_timing_merge(struct ide_timing *a, struct ide_timing *b, struct ide_timing *m, unsigned int what) |
190 | { | 189 | { |
191 | if (what & IDE_TIMING_SETUP ) m->setup = MAX(a->setup, b->setup); | 190 | if (what & IDE_TIMING_SETUP ) m->setup = max(a->setup, b->setup); |
192 | if (what & IDE_TIMING_ACT8B ) m->act8b = MAX(a->act8b, b->act8b); | 191 | if (what & IDE_TIMING_ACT8B ) m->act8b = max(a->act8b, b->act8b); |
193 | if (what & IDE_TIMING_REC8B ) m->rec8b = MAX(a->rec8b, b->rec8b); | 192 | if (what & IDE_TIMING_REC8B ) m->rec8b = max(a->rec8b, b->rec8b); |
194 | if (what & IDE_TIMING_CYC8B ) m->cyc8b = MAX(a->cyc8b, b->cyc8b); | 193 | if (what & IDE_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b); |
195 | if (what & IDE_TIMING_ACTIVE ) m->active = MAX(a->active, b->active); | 194 | if (what & IDE_TIMING_ACTIVE ) m->active = max(a->active, b->active); |
196 | if (what & IDE_TIMING_RECOVER) m->recover = MAX(a->recover, b->recover); | 195 | if (what & IDE_TIMING_RECOVER) m->recover = max(a->recover, b->recover); |
197 | if (what & IDE_TIMING_CYCLE ) m->cycle = MAX(a->cycle, b->cycle); | 196 | if (what & IDE_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle); |
198 | if (what & IDE_TIMING_UDMA ) m->udma = MAX(a->udma, b->udma); | 197 | if (what & IDE_TIMING_UDMA ) m->udma = max(a->udma, b->udma); |
199 | } | 198 | } |
200 | 199 | ||
201 | static struct ide_timing* ide_timing_find_mode(short speed) | 200 | static struct ide_timing* ide_timing_find_mode(short speed) |