From: Eric Sesterhenn / snakebyte <snakebyte@gmx.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [Patch 2/5] Cleanup MIN/MAX Macro usage in eicon/di.c
Date: Tue, 20 Dec 2005 15:05:09 +0000 [thread overview]
Message-ID: <1135091109.25956.1.camel@alice> (raw)
In-Reply-To: <1135084556.24065.6.camel@alice>
[-- 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
prev parent reply other threads:[~2005-12-20 15:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1135091109.25956.1.camel@alice \
--to=snakebyte@gmx.de \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.