diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-02-07 03:16:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:33 -0500 |
commit | 319fe7c347ad2bdd99ea9b62c65ca81584ed2e1c (patch) | |
tree | 5dda5fff40846f895be81f31eda54aa06e0357c9 /drivers/char/stallion.c | |
parent | f31e6835054f577d4d3193aed1f464b149483377 (diff) |
Char: stallion, fix compiler warnings
Don't emit warnings on 64 bit platforms from min(). sizeof() on those
is not uint, neither 2 pointers difference, cast it to uint by min_t in
both cases.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/stallion.c')
-rw-r--r-- | drivers/char/stallion.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 45758d5b56ef..5050aa5533a2 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c | |||
@@ -3546,7 +3546,8 @@ static void stl_cd1400txisr(struct stlpanel *panelp, int ioaddr) | |||
3546 | } else { | 3546 | } else { |
3547 | len = min(len, CD1400_TXFIFOSIZE); | 3547 | len = min(len, CD1400_TXFIFOSIZE); |
3548 | portp->stats.txtotal += len; | 3548 | portp->stats.txtotal += len; |
3549 | stlen = min(len, ((portp->tx.buf + STL_TXBUFSIZE) - tail)); | 3549 | stlen = min_t(unsigned int, len, |
3550 | (portp->tx.buf + STL_TXBUFSIZE) - tail); | ||
3550 | outb((TDR + portp->uartaddr), ioaddr); | 3551 | outb((TDR + portp->uartaddr), ioaddr); |
3551 | outsb((ioaddr + EREG_DATA), tail, stlen); | 3552 | outsb((ioaddr + EREG_DATA), tail, stlen); |
3552 | len -= stlen; | 3553 | len -= stlen; |
@@ -3599,7 +3600,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr) | |||
3599 | outb((RDCR + portp->uartaddr), ioaddr); | 3600 | outb((RDCR + portp->uartaddr), ioaddr); |
3600 | len = inb(ioaddr + EREG_DATA); | 3601 | len = inb(ioaddr + EREG_DATA); |
3601 | if (tty == NULL || (buflen = tty_buffer_request_room(tty, len)) == 0) { | 3602 | if (tty == NULL || (buflen = tty_buffer_request_room(tty, len)) == 0) { |
3602 | len = min(len, sizeof(stl_unwanted)); | 3603 | len = min_t(unsigned int, len, sizeof(stl_unwanted)); |
3603 | outb((RDSR + portp->uartaddr), ioaddr); | 3604 | outb((RDSR + portp->uartaddr), ioaddr); |
3604 | insb((ioaddr + EREG_DATA), &stl_unwanted[0], len); | 3605 | insb((ioaddr + EREG_DATA), &stl_unwanted[0], len); |
3605 | portp->stats.rxlost += len; | 3606 | portp->stats.rxlost += len; |
@@ -4465,7 +4466,8 @@ static void stl_sc26198txisr(struct stlport *portp) | |||
4465 | } else { | 4466 | } else { |
4466 | len = min(len, SC26198_TXFIFOSIZE); | 4467 | len = min(len, SC26198_TXFIFOSIZE); |
4467 | portp->stats.txtotal += len; | 4468 | portp->stats.txtotal += len; |
4468 | stlen = min(len, ((portp->tx.buf + STL_TXBUFSIZE) - tail)); | 4469 | stlen = min_t(unsigned int, len, |
4470 | (portp->tx.buf + STL_TXBUFSIZE) - tail); | ||
4469 | outb(GTXFIFO, (ioaddr + XP_ADDR)); | 4471 | outb(GTXFIFO, (ioaddr + XP_ADDR)); |
4470 | outsb((ioaddr + XP_DATA), tail, stlen); | 4472 | outsb((ioaddr + XP_DATA), tail, stlen); |
4471 | len -= stlen; | 4473 | len -= stlen; |
@@ -4506,7 +4508,7 @@ static void stl_sc26198rxisr(struct stlport *portp, unsigned int iack) | |||
4506 | 4508 | ||
4507 | if ((iack & IVR_TYPEMASK) == IVR_RXDATA) { | 4509 | if ((iack & IVR_TYPEMASK) == IVR_RXDATA) { |
4508 | if (tty == NULL || (buflen = tty_buffer_request_room(tty, len)) == 0) { | 4510 | if (tty == NULL || (buflen = tty_buffer_request_room(tty, len)) == 0) { |
4509 | len = min(len, sizeof(stl_unwanted)); | 4511 | len = min_t(unsigned int, len, sizeof(stl_unwanted)); |
4510 | outb(GRXFIFO, (ioaddr + XP_ADDR)); | 4512 | outb(GRXFIFO, (ioaddr + XP_ADDR)); |
4511 | insb((ioaddr + XP_DATA), &stl_unwanted[0], len); | 4513 | insb((ioaddr + XP_DATA), &stl_unwanted[0], len); |
4512 | portp->stats.rxlost += len; | 4514 | portp->stats.rxlost += len; |