aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/isdn/hardware/eicon/debug.c4
-rw-r--r--drivers/isdn/hardware/eicon/di.c8
-rw-r--r--drivers/isdn/hardware/eicon/io.c2
-rw-r--r--drivers/isdn/hardware/eicon/istream.c4
-rw-r--r--drivers/isdn/hardware/eicon/platform.h8
5 files changed, 9 insertions, 17 deletions
diff --git a/drivers/isdn/hardware/eicon/debug.c b/drivers/isdn/hardware/eicon/debug.c
index 6851c6270ce8..d835e74ecf18 100644
--- a/drivers/isdn/hardware/eicon/debug.c
+++ b/drivers/isdn/hardware/eicon/debug.c
@@ -756,14 +756,14 @@ int diva_get_driver_info (dword id, byte* data, int data_length) {
756 756
757 data_length -= 9; 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 memcpy (p, clients[id].drvName, to_copy); 760 memcpy (p, clients[id].drvName, to_copy);
761 p += to_copy; 761 p += to_copy;
762 data_length -= to_copy; 762 data_length -= to_copy;
763 if ((data_length >= 4) && clients[id].hDbg->drvTag[0]) { 763 if ((data_length >= 4) && clients[id].hDbg->drvTag[0]) {
764 *p++ = '('; 764 *p++ = '(';
765 data_length -= 1; 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 memcpy (p, clients[id].hDbg->drvTag, to_copy); 767 memcpy (p, clients[id].hDbg->drvTag, to_copy);
768 p += to_copy; 768 p += to_copy;
769 data_length -= to_copy; 769 data_length -= to_copy;
diff --git a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c
index 0617d7cabf06..e1df8d98c311 100644
--- a/drivers/isdn/hardware/eicon/di.c
+++ b/drivers/isdn/hardware/eicon/di.c
@@ -133,7 +133,7 @@ void pr_out(ADAPTER * a)
133 i = this->XCurrent; 133 i = this->XCurrent;
134 X = PTR_X(a,this); 134 X = PTR_X(a,this);
135 while(i<this->XNum && length<270) { 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 a->ram_out_buffer(a, 137 a->ram_out_buffer(a,
138 &ReqOut->XBuffer.P[length], 138 &ReqOut->XBuffer.P[length],
139 PTR_P(a,this,&X[i].P[this->XOffset]), 139 PTR_P(a,this,&X[i].P[this->XOffset]),
@@ -622,7 +622,7 @@ byte isdn_ind(ADAPTER * a,
622 sizeof(a->stream_buffer), 622 sizeof(a->stream_buffer),
623 &final, NULL, NULL); 623 &final, NULL, NULL);
624 } 624 }
625 IoAdapter->RBuffer.length = MIN(MLength, 270); 625 IoAdapter->RBuffer.length = min(MLength, (word)270);
626 if (IoAdapter->RBuffer.length != MLength) { 626 if (IoAdapter->RBuffer.length != MLength) {
627 this->complete = 0; 627 this->complete = 0;
628 } else { 628 } else {
@@ -676,9 +676,9 @@ byte isdn_ind(ADAPTER * a,
676 this->RCurrent++; 676 this->RCurrent++;
677 } 677 }
678 if (cma) { 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 } else { 680 } else {
681 clength = MIN(a->ram_inw(a, &RBuffer->length)-offset, 681 clength = min(a->ram_inw(a, &RBuffer->length)-offset,
682 R[this->RCurrent].PLength-this->ROffset); 682 R[this->RCurrent].PLength-this->ROffset);
683 } 683 }
684 if(R[this->RCurrent].P) { 684 if(R[this->RCurrent].P) {
diff --git a/drivers/isdn/hardware/eicon/io.c b/drivers/isdn/hardware/eicon/io.c
index 4a27e230b0a5..6fd9b007417d 100644
--- a/drivers/isdn/hardware/eicon/io.c
+++ b/drivers/isdn/hardware/eicon/io.c
@@ -262,7 +262,7 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
262 case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: { 262 case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: {
263 diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info; 263 diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info;
264 memset (&prms, 0x00, sizeof(prms)); 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 memset (pI, 0x00, pI->structure_length); 266 memset (pI, 0x00, pI->structure_length);
267 prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \ 267 prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \
268 DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0; 268 DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0;
diff --git a/drivers/isdn/hardware/eicon/istream.c b/drivers/isdn/hardware/eicon/istream.c
index 23139668d9b1..18f8798442fa 100644
--- a/drivers/isdn/hardware/eicon/istream.c
+++ b/drivers/isdn/hardware/eicon/istream.c
@@ -92,7 +92,7 @@ int diva_istream_write (void* context,
92 return (-1); /* was not able to write */ 92 return (-1); /* was not able to write */
93 break; /* only part of message was written */ 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 if (to_write) { 96 if (to_write) {
97 a->ram_out_buffer (a, 97 a->ram_out_buffer (a,
98#ifdef PLATFORM_GT_32BIT 98#ifdef PLATFORM_GT_32BIT
@@ -176,7 +176,7 @@ int diva_istream_read (void* context,
176 return (-1); /* was not able to read */ 176 return (-1); /* was not able to read */
177 break; 177 break;
178 } 178 }
179 to_read = MIN(max_length, tmp[1]); 179 to_read = min(max_length, (int)tmp[1]);
180 if (to_read) { 180 if (to_read) {
181 a->ram_in_buffer(a, 181 a->ram_in_buffer(a,
182#ifdef PLATFORM_GT_32BIT 182#ifdef PLATFORM_GT_32BIT
diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h
index a66836cf756c..2444811e0b38 100644
--- a/drivers/isdn/hardware/eicon/platform.h
+++ b/drivers/isdn/hardware/eicon/platform.h
@@ -83,14 +83,6 @@
83#define NULL ((void *) 0) 83#define NULL ((void *) 0)
84#endif 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#ifndef far 86#ifndef far
95#define far 87#define far
96#endif 88#endif