* [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c
@ 2005-12-20 13:15 Eric Sesterhenn / snakebyte
2005-12-20 13:54 ` Matthew Wilcox
2005-12-20 15:05 ` Eric Sesterhenn / snakebyte
0 siblings, 2 replies; 3+ messages in thread
From: Eric Sesterhenn / snakebyte @ 2005-12-20 13:15 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]
hi,
This patch changes eicon/di.c from MIN/MAX usage
to min/max.
Signed-of-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.15-rc6/drivers/isdn/hardware/eicon/di.c.orig 2005-12-20 09:56:54.000000000 +0100
+++ linux-2.6.15-rc6/drivers/isdn/hardware/eicon/di.c 2005-12-20 10:09:56.000000000 +0100
@@ -133,7 +133,7 @@ void pr_out(ADAPTER * a)
i = this->XCurrent;
X = PTR_X(a,this);
while(i<this->XNum && length<270) {
- clength = MIN((word)(270-length),X[i].PLength-this->XOffset);
+ clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset));
a->ram_out_buffer(a,
&ReqOut->XBuffer.P[length],
PTR_P(a,this,&X[i].P[this->XOffset]),
@@ -622,7 +622,7 @@ byte isdn_ind(ADAPTER * a,
sizeof(a->stream_buffer),
&final, NULL, NULL);
}
- IoAdapter->RBuffer.length = MIN(MLength, 270);
+ IoAdapter->RBuffer.length = min((word)MLength, (word)270);
if (IoAdapter->RBuffer.length != MLength) {
this->complete = 0;
} else {
@@ -676,9 +676,9 @@ byte isdn_ind(ADAPTER * a,
this->RCurrent++;
}
if (cma) {
- clength = MIN(MLength, R[this->RCurrent].PLength-this->ROffset);
+ clength = min(MLength, (word)(R[this->RCurrent].PLength-this->ROffset));
} else {
- clength = MIN(a->ram_inw(a, &RBuffer->length)-offset,
+ clength = min(a->ram_inw(a, &RBuffer->length)-offset,
R[this->RCurrent].PLength-this->ROffset);
}
if(R[this->RCurrent].P) {
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c
2005-12-20 13:15 [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c Eric Sesterhenn / snakebyte
@ 2005-12-20 13:54 ` Matthew Wilcox
2005-12-20 15:05 ` Eric Sesterhenn / snakebyte
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2005-12-20 13:54 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 572 bytes --]
On Tue, Dec 20, 2005 at 02:15:56PM +0100, Eric Sesterhenn / snakebyte wrote:
> - clength = MIN((word)(270-length),X[i].PLength-this->XOffset);
> + clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset));
perhaps you should use min_t?
> - IoAdapter->RBuffer.length = MIN(MLength, 270);
> + IoAdapter->RBuffer.length = min((word)MLength, (word)270);
likewise.
> - clength = MIN(MLength, R[this->RCurrent].PLength-this->ROffset);
> + clength = min(MLength, (word)(R[this->RCurrent].PLength-this->ROffset));
likewise.
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c
2005-12-20 13:15 [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c Eric Sesterhenn / snakebyte
2005-12-20 13:54 ` Matthew Wilcox
@ 2005-12-20 15:05 ` Eric Sesterhenn / snakebyte
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sesterhenn / snakebyte @ 2005-12-20 15:05 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1995 bytes --]
hi,
On Tue, 2005-12-20 at 06:54 -0700, Matthew Wilcox wrote:
> On Tue, Dec 20, 2005 at 02:15:56PM +0100, Eric Sesterhenn / snakebyte wrote:
> > - clength = MIN((word)(270-length),X[i].PLength-this->XOffset);
> > + clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset));
>
> perhaps you should use min_t?
revisited patch, it now uses min_t instead of min,
compile tested.
Signed-of-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.15-rc6/drivers/isdn/hardware/eicon/di.c.orig 2005-12-20 09:56:54.000000000 +0100
+++ linux-2.6.15-rc6/drivers/isdn/hardware/eicon/di.c 2005-12-20 15:06:28.000000000 +0100
@@ -133,7 +133,7 @@ void pr_out(ADAPTER * a)
i = this->XCurrent;
X = PTR_X(a,this);
while(i<this->XNum && length<270) {
- clength = MIN((word)(270-length),X[i].PLength-this->XOffset);
+ clength = min_t(word, 270-length, X[i].PLength-this->XOffset);
a->ram_out_buffer(a,
&ReqOut->XBuffer.P[length],
PTR_P(a,this,&X[i].P[this->XOffset]),
@@ -622,7 +622,7 @@ byte isdn_ind(ADAPTER * a,
sizeof(a->stream_buffer),
&final, NULL, NULL);
}
- IoAdapter->RBuffer.length = MIN(MLength, 270);
+ IoAdapter->RBuffer.length = min_t(word, MLength, 270);
if (IoAdapter->RBuffer.length != MLength) {
this->complete = 0;
} else {
@@ -676,9 +676,9 @@ byte isdn_ind(ADAPTER * a,
this->RCurrent++;
}
if (cma) {
- clength = MIN(MLength, R[this->RCurrent].PLength-this->ROffset);
+ clength = min_t(word, MLength, R[this->RCurrent].PLength-this->ROffset);
} else {
- clength = MIN(a->ram_inw(a, &RBuffer->length)-offset,
+ clength = min(a->ram_inw(a, &RBuffer->length)-offset,
R[this->RCurrent].PLength-this->ROffset);
}
if(R[this->RCurrent].P) {
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-12-20 15:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-20 13:15 [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c Eric Sesterhenn / snakebyte
2005-12-20 13:54 ` Matthew Wilcox
2005-12-20 15:05 ` Eric Sesterhenn / snakebyte
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.