* [PATCH 0/4] IR fixes for v4.11
@ 2017-01-20 13:08 Sean Young
2017-01-20 13:08 ` [PATCH 1/4] [media] lirc: fix transmit-only read features Sean Young
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Sean Young @ 2017-01-20 13:08 UTC (permalink / raw)
To: linux-media
Testing of lirc uncovered some issue with tx-only devices, and some
other minor issues.
Sean Young (4):
[media] lirc: fix transmit-only read features
[media] rc: remove excessive spaces from error message
[media] lirc: LIRC_GET_MIN_TIMEOUT should be in range
[media] lirc: fix null dereference for tx-only devices
drivers/media/rc/ir-lirc-codec.c | 7 ++++---
drivers/media/rc/lirc_dev.c | 2 +-
drivers/media/rc/rc-main.c | 3 +--
3 files changed, 6 insertions(+), 6 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] [media] lirc: fix transmit-only read features
2017-01-20 13:08 [PATCH 0/4] IR fixes for v4.11 Sean Young
@ 2017-01-20 13:08 ` Sean Young
2017-01-20 23:06 ` kbuild test robot
2017-01-20 23:29 ` kbuild test robot
2017-01-20 13:08 ` [PATCH 2/4] [media] rc: remove excessive spaces from error message Sean Young
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Sean Young @ 2017-01-20 13:08 UTC (permalink / raw)
To: linux-media
An RC device which is transmit-only shouldn't have the
LIRC_CAN_REC_MODE2 feature.
Signed-off-by: Sean Young <sean@mess.org>
---
drivers/media/rc/ir-lirc-codec.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index 9e41305..e944507 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -347,7 +347,7 @@ static int ir_lirc_register(struct rc_dev *dev)
struct lirc_driver *drv;
struct lirc_buffer *rbuf;
int rc = -ENOMEM;
- unsigned long features;
+ unsigned long features = 0;
drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
if (!drv)
@@ -361,7 +361,8 @@ static int ir_lirc_register(struct rc_dev *dev)
if (rc)
goto rbuf_init_failed;
- features = LIRC_CAN_REC_MODE2;
+ if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
+ features |= LIRC_CAN_REC_MODE2;
if (dev->tx_ir) {
features |= LIRC_CAN_SEND_PULSE;
if (dev->s_tx_mask)
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] [media] rc: remove excessive spaces from error message
2017-01-20 13:08 [PATCH 0/4] IR fixes for v4.11 Sean Young
2017-01-20 13:08 ` [PATCH 1/4] [media] lirc: fix transmit-only read features Sean Young
@ 2017-01-20 13:08 ` Sean Young
2017-01-20 13:08 ` [PATCH 3/4] [media] lirc: LIRC_GET_MIN_TIMEOUT should be in range Sean Young
2017-01-20 13:08 ` [PATCH 4/4] [media] lirc: fix null dereference for tx-only devices Sean Young
3 siblings, 0 replies; 7+ messages in thread
From: Sean Young @ 2017-01-20 13:08 UTC (permalink / raw)
To: linux-media
rc_core: Loaded IR protocol module ir-jvc-decoder, but protocol jvc still not available
Signed-off-by: Sean Young <sean@mess.org>
---
drivers/media/rc/rc-main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 075d7a9..2424946 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1084,8 +1084,7 @@ static void ir_raw_load_modules(u64 *protocols)
if (!(*protocols & proto_names[i].type & ~available))
continue;
- pr_err("Loaded IR protocol module %s, \
- but protocol %s still not available\n",
+ pr_err("Loaded IR protocol module %s, but protocol %s still not available\n",
proto_names[i].module_name,
proto_names[i].name);
*protocols &= ~proto_names[i].type;
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] [media] lirc: LIRC_GET_MIN_TIMEOUT should be in range
2017-01-20 13:08 [PATCH 0/4] IR fixes for v4.11 Sean Young
2017-01-20 13:08 ` [PATCH 1/4] [media] lirc: fix transmit-only read features Sean Young
2017-01-20 13:08 ` [PATCH 2/4] [media] rc: remove excessive spaces from error message Sean Young
@ 2017-01-20 13:08 ` Sean Young
2017-01-20 13:08 ` [PATCH 4/4] [media] lirc: fix null dereference for tx-only devices Sean Young
3 siblings, 0 replies; 7+ messages in thread
From: Sean Young @ 2017-01-20 13:08 UTC (permalink / raw)
To: linux-media
LIRC_SET_REC_TIMEOUT can fail if the value returned by
LIRC_GET_MIN_TIMEOUT is set due to rounding errors.
Signed-off-by: Sean Young <sean@mess.org>
---
drivers/media/rc/ir-lirc-codec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index e944507..8517d51 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -279,7 +279,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
case LIRC_GET_MIN_TIMEOUT:
if (!dev->max_timeout)
return -ENOSYS;
- val = dev->min_timeout / 1000;
+ val = DIV_ROUND_UP(dev->min_timeout, 1000);
break;
case LIRC_GET_MAX_TIMEOUT:
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] [media] lirc: fix null dereference for tx-only devices
2017-01-20 13:08 [PATCH 0/4] IR fixes for v4.11 Sean Young
` (2 preceding siblings ...)
2017-01-20 13:08 ` [PATCH 3/4] [media] lirc: LIRC_GET_MIN_TIMEOUT should be in range Sean Young
@ 2017-01-20 13:08 ` Sean Young
3 siblings, 0 replies; 7+ messages in thread
From: Sean Young @ 2017-01-20 13:08 UTC (permalink / raw)
To: linux-media
tx-only RC devices do not have a receive buffer.
Signed-off-by: Sean Young <sean@mess.org>
---
drivers/media/rc/lirc_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 7f5d109..18b4dae 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -472,7 +472,7 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
if (retval) {
module_put(cdev->owner);
ir->open--;
- } else {
+ } else if (ir->buf) {
lirc_buffer_clear(ir->buf);
}
if (ir->task)
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] [media] lirc: fix transmit-only read features
2017-01-20 13:08 ` [PATCH 1/4] [media] lirc: fix transmit-only read features Sean Young
@ 2017-01-20 23:06 ` kbuild test robot
2017-01-20 23:29 ` kbuild test robot
1 sibling, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2017-01-20 23:06 UTC (permalink / raw)
To: Sean Young; +Cc: kbuild-all, linux-media
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
Hi Sean,
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.10-rc4 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sean-Young/IR-fixes-for-v4-11/20170121-051556
base: git://linuxtv.org/media_tree.git master
config: x86_64-rhel-7.2 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/media/rc/ir-lirc-codec.c: In function 'ir_lirc_register':
>> drivers/media/rc/ir-lirc-codec.c:358:26: error: 'RC_DRIVER_IR_RAW_TX' undeclared (first use in this function)
if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
^~~~~~~~~~~~~~~~~~~
drivers/media/rc/ir-lirc-codec.c:358:26: note: each undeclared identifier is reported only once for each function it appears in
vim +/RC_DRIVER_IR_RAW_TX +358 drivers/media/rc/ir-lirc-codec.c
352 goto rbuf_alloc_failed;
353
354 rc = lirc_buffer_init(rbuf, sizeof(int), LIRCBUF_SIZE);
355 if (rc)
356 goto rbuf_init_failed;
357
> 358 if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
359 features |= LIRC_CAN_REC_MODE2;
360 if (dev->tx_ir) {
361 features |= LIRC_CAN_SEND_PULSE;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38277 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] [media] lirc: fix transmit-only read features
2017-01-20 13:08 ` [PATCH 1/4] [media] lirc: fix transmit-only read features Sean Young
2017-01-20 23:06 ` kbuild test robot
@ 2017-01-20 23:29 ` kbuild test robot
1 sibling, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2017-01-20 23:29 UTC (permalink / raw)
To: Sean Young; +Cc: kbuild-all, linux-media
[-- Attachment #1: Type: text/plain, Size: 3221 bytes --]
Hi Sean,
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.10-rc4 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sean-Young/IR-fixes-for-v4-11/20170121-051556
base: git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-x016-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/uapi/linux/capability.h:16,
from include/linux/capability.h:15,
from include/linux/sched.h:15,
from drivers/media/rc/ir-lirc-codec.c:15:
drivers/media/rc/ir-lirc-codec.c: In function 'ir_lirc_register':
drivers/media/rc/ir-lirc-codec.c:358:26: error: 'RC_DRIVER_IR_RAW_TX' undeclared (first use in this function)
if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/media/rc/ir-lirc-codec.c:358:2: note: in expansion of macro 'if'
if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
^~
drivers/media/rc/ir-lirc-codec.c:358:26: note: each undeclared identifier is reported only once for each function it appears in
if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/media/rc/ir-lirc-codec.c:358:2: note: in expansion of macro 'if'
if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
^~
vim +/if +358 drivers/media/rc/ir-lirc-codec.c
342 struct lirc_buffer *rbuf;
343 int rc = -ENOMEM;
344 unsigned long features = 0;
345
346 drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
347 if (!drv)
348 return rc;
349
350 rbuf = kzalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
351 if (!rbuf)
352 goto rbuf_alloc_failed;
353
354 rc = lirc_buffer_init(rbuf, sizeof(int), LIRCBUF_SIZE);
355 if (rc)
356 goto rbuf_init_failed;
357
> 358 if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
359 features |= LIRC_CAN_REC_MODE2;
360 if (dev->tx_ir) {
361 features |= LIRC_CAN_SEND_PULSE;
362 if (dev->s_tx_mask)
363 features |= LIRC_CAN_SET_TRANSMITTER_MASK;
364 if (dev->s_tx_carrier)
365 features |= LIRC_CAN_SET_SEND_CARRIER;
366 if (dev->s_tx_duty_cycle)
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23232 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-01-20 23:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-20 13:08 [PATCH 0/4] IR fixes for v4.11 Sean Young
2017-01-20 13:08 ` [PATCH 1/4] [media] lirc: fix transmit-only read features Sean Young
2017-01-20 23:06 ` kbuild test robot
2017-01-20 23:29 ` kbuild test robot
2017-01-20 13:08 ` [PATCH 2/4] [media] rc: remove excessive spaces from error message Sean Young
2017-01-20 13:08 ` [PATCH 3/4] [media] lirc: LIRC_GET_MIN_TIMEOUT should be in range Sean Young
2017-01-20 13:08 ` [PATCH 4/4] [media] lirc: fix null dereference for tx-only devices Sean Young
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).