[media] rc-core: lirc use unsigned int
Durations can never be negative, so it makes sense to consistently use unsigned int for LIRC transmission. Contrary to the initial impression, this shouldn't actually change the userspace API. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
8a8cc952d3
commit
5588dc2b02
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user