Re: [PATCH] floppy.c #defines

Zwane Mwaikambo (zwane@linux.realnet.co.sz)
Sun, 2 Dec 2001 15:28:57 +0200 (SAST)


--- linux-2.5.1-pre5/drivers/block/floppy.c Sun Dec 2 14:26:22 2001
+++ linux-2.5.1-pre5-test/drivers/block/floppy.c Sun Dec 2 15:25:07 2001
@@ -496,7 +496,7 @@

#define NO_SIGNAL (!interruptible || !signal_pending(current))
#define CALL(x) if ((x) == -EINTR) return -EINTR
-#define ECALL(x) if ((ret = (x))) return ret;
+#define ECALL(x) if ((ret = (x))) return ret
#define _WAIT(x,i) CALL(ret=wait_til_done((x),i))
#define WAIT(x) _WAIT((x),interruptible)
#define IWAIT(x) _WAIT((x),1)
@@ -663,23 +663,8 @@
timeout_message = message;
}

-static int maximum(int a, int b)
-{
- if (a > b)
- return a;
- else
- return b;
-}
-#define INFBOUND(a,b) (a)=maximum((a),(b));
-
-static int minimum(int a, int b)
-{
- if (a < b)
- return a;
- else
- return b;
-}
-#define SUPBOUND(a,b) (a)=minimum((a),(b));
+#define INFBOUND(a,b) (a)=max((a),(b))
+#define SUPBOUND(a,b) (a)=min((a),(b))

/*
@@ -2474,12 +2459,12 @@
int size;

max_sector = transfer_size(ssize,
- minimum(max_sector, max_sector_2),
+ min(max_sector, max_sector_2),
CURRENT->nr_sectors);

if (current_count_sectors <= 0 && CT(COMMAND) == FD_WRITE &&
buffer_max > fsector_t + CURRENT->nr_sectors)
- current_count_sectors = minimum(buffer_max - fsector_t,
+ current_count_sectors = min(buffer_max - fsector_t,
CURRENT->nr_sectors);

remaining = current_count_sectors << 9;
@@ -2497,7 +2482,7 @@
}
#endif

- buffer_max = maximum(max_sector, buffer_max);
+ buffer_max = max(max_sector, buffer_max);

dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9);

@@ -2653,7 +2638,7 @@
if ((_floppy->rate & FD_2M) && (!TRACK) && (!HEAD)){
max_sector = 2 * _floppy->sect / 3;
if (fsector_t >= max_sector){
- current_count_sectors = minimum(_floppy->sect - fsector_t,
+ current_count_sectors = min(_floppy->sect - fsector_t,
CURRENT->nr_sectors);
return 1;
}
@@ -3506,7 +3491,7 @@
/* copyin */
CLEARSTRUCT(&inparam);
if (_IOC_DIR(cmd) & _IOC_WRITE)
- ECALL(fd_copyin((void *)param, &inparam, size))
+ ECALL(fd_copyin((void *)param, &inparam, size));

switch (cmd) {
case FDEJECT:

-
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/