Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] drivers/isdn: Handcrafted MIN/MAX Macro removal

Cleanups done to use min/max macros from kernel.h. Handcrafted MIN/MAX
macros are changed to use macros in kernel.h

[akpm@osdl.org: warning fix]
Signed-off-by: Amol Lad <amol@verismonetworks.com>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Amol Lad and committed by
Linus Torvalds
e2de257c 90cc3018

+9 -17
+2 -2
drivers/isdn/hardware/eicon/debug.c
··· 756 756 757 757 data_length -= 9; 758 758 759 - if ((to_copy = MIN(strlen(clients[id].drvName), data_length-1))) { 759 + if ((to_copy = min(strlen(clients[id].drvName), (size_t)(data_length-1)))) { 760 760 memcpy (p, clients[id].drvName, to_copy); 761 761 p += to_copy; 762 762 data_length -= to_copy; 763 763 if ((data_length >= 4) && clients[id].hDbg->drvTag[0]) { 764 764 *p++ = '('; 765 765 data_length -= 1; 766 - if ((to_copy = MIN(strlen(clients[id].hDbg->drvTag), data_length-2))) { 766 + if ((to_copy = min(strlen(clients[id].hDbg->drvTag), (size_t)(data_length-2)))) { 767 767 memcpy (p, clients[id].hDbg->drvTag, to_copy); 768 768 p += to_copy; 769 769 data_length -= to_copy;
+4 -4
drivers/isdn/hardware/eicon/di.c
··· 133 133 i = this->XCurrent; 134 134 X = PTR_X(a,this); 135 135 while(i<this->XNum && length<270) { 136 - clength = MIN((word)(270-length),X[i].PLength-this->XOffset); 136 + clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset)); 137 137 a->ram_out_buffer(a, 138 138 &ReqOut->XBuffer.P[length], 139 139 PTR_P(a,this,&X[i].P[this->XOffset]), ··· 622 622 sizeof(a->stream_buffer), 623 623 &final, NULL, NULL); 624 624 } 625 - IoAdapter->RBuffer.length = MIN(MLength, 270); 625 + IoAdapter->RBuffer.length = min(MLength, (word)270); 626 626 if (IoAdapter->RBuffer.length != MLength) { 627 627 this->complete = 0; 628 628 } else { ··· 676 676 this->RCurrent++; 677 677 } 678 678 if (cma) { 679 - clength = MIN(MLength, R[this->RCurrent].PLength-this->ROffset); 679 + clength = min(MLength, (word)(R[this->RCurrent].PLength-this->ROffset)); 680 680 } else { 681 - clength = MIN(a->ram_inw(a, &RBuffer->length)-offset, 681 + clength = min(a->ram_inw(a, &RBuffer->length)-offset, 682 682 R[this->RCurrent].PLength-this->ROffset); 683 683 } 684 684 if(R[this->RCurrent].P) {
+1 -1
drivers/isdn/hardware/eicon/io.c
··· 262 262 case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: { 263 263 diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info; 264 264 memset (&prms, 0x00, sizeof(prms)); 265 - prms.structure_length = MIN(sizeof(prms), pI->structure_length); 265 + prms.structure_length = min_t(size_t, sizeof(prms), pI->structure_length); 266 266 memset (pI, 0x00, pI->structure_length); 267 267 prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \ 268 268 DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0;
+2 -2
drivers/isdn/hardware/eicon/istream.c
··· 92 92 return (-1); /* was not able to write */ 93 93 break; /* only part of message was written */ 94 94 } 95 - to_write = MIN(length, DIVA_DFIFO_DATA_SZ); 95 + to_write = min(length, DIVA_DFIFO_DATA_SZ); 96 96 if (to_write) { 97 97 a->ram_out_buffer (a, 98 98 #ifdef PLATFORM_GT_32BIT ··· 176 176 return (-1); /* was not able to read */ 177 177 break; 178 178 } 179 - to_read = MIN(max_length, tmp[1]); 179 + to_read = min(max_length, (int)tmp[1]); 180 180 if (to_read) { 181 181 a->ram_in_buffer(a, 182 182 #ifdef PLATFORM_GT_32BIT
-8
drivers/isdn/hardware/eicon/platform.h
··· 83 83 #define NULL ((void *) 0) 84 84 #endif 85 85 86 - #ifndef MIN 87 - #define MIN(a,b) ((a)>(b) ? (b) : (a)) 88 - #endif 89 - 90 - #ifndef MAX 91 - #define MAX(a,b) ((a)>(b) ? (a) : (b)) 92 - #endif 93 - 94 86 #ifndef far 95 87 #define far 96 88 #endif