projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'topic/kbuild-fixes-for-next' of git://git.kernel.org/pub/scm/linux...
[cascardo/linux.git]
/
drivers
/
media
/
rc
/
iguanair.c
diff --git
a/drivers/media/rc/iguanair.c
b/drivers/media/rc/iguanair.c
index
19632b1
..
fdae05c
100644
(file)
--- a/
drivers/media/rc/iguanair.c
+++ b/
drivers/media/rc/iguanair.c
@@
-207,7
+207,7
@@
static int iguanair_send(struct iguanair *ir, unsigned size)
{
int rc;
{
int rc;
-
INIT_COMPLETION(
ir->completion);
+
reinit_completion(&
ir->completion);
ir->urb_out->transfer_buffer_length = size;
rc = usb_submit_urb(ir->urb_out, GFP_KERNEL);
ir->urb_out->transfer_buffer_length = size;
rc = usb_submit_urb(ir->urb_out, GFP_KERNEL);
@@
-308,22
+308,12
@@
static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier)
cycles = DIV_ROUND_CLOSEST(24000000, carrier * 2) -
ir->cycle_overhead;
cycles = DIV_ROUND_CLOSEST(24000000, carrier * 2) -
ir->cycle_overhead;
- /* make up the the remainer of 4-cycle blocks */
- switch (cycles & 3) {
- case 0:
- sevens = 0;
- break;
- case 1:
- sevens = 3;
- break;
- case 2:
- sevens = 2;
- break;
- case 3:
- sevens = 1;
- break;
- }
-
+ /*
+ * Calculate minimum number of 7 cycles needed so
+ * we are left with a multiple of 4; so we want to have
+ * (sevens * 7) & 3 == cycles & 3
+ */
+ sevens = (4 - cycles) & 3;
fours = (cycles - sevens * 7) / 4;
/* magic happens here */
fours = (cycles - sevens * 7) / 4;
/* magic happens here */