Commit c7dc0c0a authored by Maximilian Attems's avatar Maximilian Attems Committed by Linus Torvalds

[PATCH] drivers/char/synclinkmp.c MIN/MAX removal

Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0c976022
...@@ -515,10 +515,6 @@ static struct tty_driver *serial_driver; ...@@ -515,10 +515,6 @@ static struct tty_driver *serial_driver;
/* number of characters left in xmit buffer before we ask for more */ /* number of characters left in xmit buffer before we ask for more */
#define WAKEUP_CHARS 256 #define WAKEUP_CHARS 256
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* tty callbacks */ /* tty callbacks */
...@@ -1000,8 +996,8 @@ static int write(struct tty_struct *tty, int from_user, ...@@ -1000,8 +996,8 @@ static int write(struct tty_struct *tty, int from_user,
} }
for (;;) { for (;;) {
c = MIN(count, c = min_t(int, count,
MIN(info->max_frame_size - info->tx_count - 1, min(info->max_frame_size - info->tx_count - 1,
info->max_frame_size - info->tx_put)); info->max_frame_size - info->tx_put));
if (c <= 0) if (c <= 0)
break; break;
...@@ -1144,7 +1140,7 @@ static void wait_until_sent(struct tty_struct *tty, int timeout) ...@@ -1144,7 +1140,7 @@ static void wait_until_sent(struct tty_struct *tty, int timeout)
char_time = 1; char_time = 1;
if (timeout) if (timeout)
char_time = MIN(char_time, timeout); char_time = min_t(unsigned long, char_time, timeout);
if ( info->params.mode == MGSL_MODE_HDLC ) { if ( info->params.mode == MGSL_MODE_HDLC ) {
while (info->tx_active) { while (info->tx_active) {
...@@ -5026,7 +5022,7 @@ int rx_get_frame(SLMP_INFO *info) ...@@ -5026,7 +5022,7 @@ int rx_get_frame(SLMP_INFO *info)
if ( debug_level >= DEBUG_LEVEL_DATA ) if ( debug_level >= DEBUG_LEVEL_DATA )
trace_block(info,info->rx_buf_list_ex[StartIndex].virt_addr, trace_block(info,info->rx_buf_list_ex[StartIndex].virt_addr,
MIN(framesize,SCABUFSIZE),0); min_t(int, framesize,SCABUFSIZE),0);
if (framesize) { if (framesize) {
if (framesize > info->max_frame_size) if (framesize > info->max_frame_size)
...@@ -5041,7 +5037,7 @@ int rx_get_frame(SLMP_INFO *info) ...@@ -5041,7 +5037,7 @@ int rx_get_frame(SLMP_INFO *info)
info->icount.rxok++; info->icount.rxok++;
while(copy_count) { while(copy_count) {
int partial_count = MIN(copy_count,SCABUFSIZE); int partial_count = min(copy_count,SCABUFSIZE);
memcpy( ptmp, memcpy( ptmp,
info->rx_buf_list_ex[index].virt_addr, info->rx_buf_list_ex[index].virt_addr,
partial_count ); partial_count );
...@@ -5098,14 +5094,14 @@ void tx_load_dma_buffer(SLMP_INFO *info, const char *buf, unsigned int count) ...@@ -5098,14 +5094,14 @@ void tx_load_dma_buffer(SLMP_INFO *info, const char *buf, unsigned int count)
SCADESC_EX *desc_ex; SCADESC_EX *desc_ex;
if ( debug_level >= DEBUG_LEVEL_DATA ) if ( debug_level >= DEBUG_LEVEL_DATA )
trace_block(info,buf, MIN(count,SCABUFSIZE), 1); trace_block(info,buf, min_t(int, count,SCABUFSIZE), 1);
/* Copy source buffer to one or more DMA buffers, starting with /* Copy source buffer to one or more DMA buffers, starting with
* the first transmit dma buffer. * the first transmit dma buffer.
*/ */
for(i=0;;) for(i=0;;)
{ {
copy_count = MIN(count,SCABUFSIZE); copy_count = min_t(unsigned short,count,SCABUFSIZE);
desc = &info->tx_buf_list[i]; desc = &info->tx_buf_list[i];
desc_ex = &info->tx_buf_list_ex[i]; desc_ex = &info->tx_buf_list_ex[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment