[media] tvaudio: fix compiler warnings
[pandora-kernel.git] / drivers / media / rc / nuvoton-cir.c
index ce595f9..eae05b5 100644 (file)
@@ -546,24 +546,18 @@ static int nvt_set_tx_carrier(struct rc_dev *dev, u32 carrier)
  * number may larger than TXFCONT (0xff). So in interrupt_handler, it has to
  * set TXFCONT as 0xff, until buf_count less than 0xff.
  */
-static int nvt_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
+static int nvt_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned n)
 {
        struct nvt_dev *nvt = dev->priv;
        unsigned long flags;
-       size_t cur_count;
        unsigned int i;
        u8 iren;
        int ret;
 
        spin_lock_irqsave(&nvt->tx.lock, flags);
 
-       if (n >= TX_BUF_LEN) {
-               nvt->tx.buf_count = cur_count = TX_BUF_LEN;
-               ret = TX_BUF_LEN;
-       } else {
-               nvt->tx.buf_count = cur_count = n;
-               ret = n;
-       }
+       ret = min((unsigned)(TX_BUF_LEN / sizeof(unsigned)), n);
+       nvt->tx.buf_count = (ret * sizeof(unsigned));
 
        memcpy(nvt->tx.buf, txbuf, nvt->tx.buf_count);