From e65dea5a70478975f51cd014b21f9575f5de8555 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Sun, 25 Jan 2004 11:50:56 +0000 Subject: use {min,max}_t instead of home-brewed my_{min,max} macros. straight-forward. patch compiles, and tested. (from Eugene Teo ) --- linux/drivers/media/common/saa7146_hlp.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index 044d37a76..bcba0ab48 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -1,10 +1,6 @@ +#include #include -#define my_min(type,x,y) \ - ({ type __x = (x), __y = (y); __x < __y ? __x: __y; }) -#define my_max(type,x,y) \ - ({ type __x = (x), __y = (y); __x > __y ? __x: __y; }) - static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) { /* clear out the necessary bits */ @@ -398,11 +394,11 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa b = y[i]+h[i]; /* insert left/right coordinates */ - pixel_list[ 2*i ] = my_min(int, l, width); - pixel_list[(2*i)+1] = my_min(int, r, width); + pixel_list[ 2*i ] = min_t(int, l, width); + pixel_list[(2*i)+1] = min_t(int, r, width); /* insert top/bottom coordinates */ - line_list[ 2*i ] = my_min(int, t, height); - line_list[(2*i)+1] = my_min(int, b, height); + line_list[ 2*i ] = min_t(int, t, height); + line_list[(2*i)+1] = min_t(int, b, height); } /* sort and eliminate lists */ @@ -411,9 +407,9 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa sort_and_eliminate( &line_list[0], &cnt_line ); /* calculate the number of used u32s */ - numdwords = my_max(int, (cnt_line+1), (cnt_pixel+1))*2; - numdwords = my_max(int, 4, numdwords); - numdwords = my_min(int, 64, numdwords); + numdwords = max_t(int, (cnt_line+1), (cnt_pixel+1))*2; + numdwords = max_t(int, 4, numdwords); + numdwords = min_t(int, 64, numdwords); /* fill up cliptable */ for(i = 0; i < cnt_pixel; i++) { -- cgit v1.2.3