Staging: hv: remove MIN and MAX usages

The kernel has the "correct" min() and max() functions, so use those.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-07-15 11:05:14 -07:00
parent 22ae0bea09
commit fc6a4b2609
2 changed files with 2 additions and 5 deletions

View file

@ -67,9 +67,6 @@
#define ALIGN_DOWN(value, align) ( (value) & ~(align-1) )
#define NUM_PAGES_SPANNED(addr, len) ( (ALIGN_UP(addr+len, PAGE_SIZE) - ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT )
#define MIN(a, b) ((a) < (b)? (a): (b))
#define MAX(a, b) ((a) > (b)? (a): (b))
#define LOWORD(dw) ((unsigned short) (dw))
#define HIWORD(dw) ((unsigned short) (((unsigned int) (dw) >> 16) & 0xFFFF))

View file

@ -623,7 +623,7 @@ static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl, struct s
dest = bounce_addr + bounce_sgl[j].length;
destlen = PAGE_SIZE - bounce_sgl[j].length;
copylen = MIN(srclen, destlen);
copylen = min(srclen, destlen);
memcpy((void*)dest, (void*)src, copylen);
total_copied += copylen;
@ -698,7 +698,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, struct
src = bounce_addr + bounce_sgl[j].offset;
srclen = bounce_sgl[j].length - bounce_sgl[j].offset;
copylen = MIN(srclen, destlen);
copylen = min(srclen, destlen);
memcpy((void*)dest, (void*)src, copylen);
total_copied += copylen;