* [PATCH -next] media: rc: Fix a typo in lirc_ioctl
@ 2021-06-01 10:02 Tong Tiangen
2021-06-01 10:25 ` Sean Young
0 siblings, 1 reply; 3+ messages in thread
From: Tong Tiangen @ 2021-06-01 10:02 UTC (permalink / raw)
To: Sean Young, Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel, Tong Tiangen
Fix a typo in lirc_ioctl, apparently min_timeout should be used
in this case.
Fixes: e589333f346b ("V4L/DVB: IR: extend interfaces to support more device settings")
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
---
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 116daf90c858..abbeae2ccd4a 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -534,7 +534,7 @@ static long lirc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* Generic timeout support */
case LIRC_GET_MIN_TIMEOUT:
- if (!dev->max_timeout)
+ if (!dev->min_timeout)
ret = -ENOTTY;
else
val = dev->min_timeout;
--
2.18.0.huawei.25
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] media: rc: Fix a typo in lirc_ioctl
2021-06-01 10:02 [PATCH -next] media: rc: Fix a typo in lirc_ioctl Tong Tiangen
@ 2021-06-01 10:25 ` Sean Young
2021-06-02 1:39 ` tongtiangen
0 siblings, 1 reply; 3+ messages in thread
From: Sean Young @ 2021-06-01 10:25 UTC (permalink / raw)
To: Tong Tiangen; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel
On Tue, Jun 01, 2021 at 06:02:35PM +0800, Tong Tiangen wrote:
> Fix a typo in lirc_ioctl, apparently min_timeout should be used
> in this case.
>
> Fixes: e589333f346b ("V4L/DVB: IR: extend interfaces to support more device settings")
> Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
> ---
> 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 116daf90c858..abbeae2ccd4a 100644
> --- a/drivers/media/rc/lirc_dev.c
> +++ b/drivers/media/rc/lirc_dev.c
> @@ -534,7 +534,7 @@ static long lirc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>
> /* Generic timeout support */
> case LIRC_GET_MIN_TIMEOUT:
> - if (!dev->max_timeout)
> + if (!dev->min_timeout)
So maybe this isn't the clearest piece of code, but all rc drivers set
either both of min_timeout & max_timeout, or neither. Having a max_timeout
without a min_timeout does not make any sense.
Changing this to min_timeout gives the impression min_timeout can be set
without max_timeout, which is not the case. This should at least commented.
Thanks
Sean
> ret = -ENOTTY;
> else
> val = dev->min_timeout;
> --
> 2.18.0.huawei.25
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] media: rc: Fix a typo in lirc_ioctl
2021-06-01 10:25 ` Sean Young
@ 2021-06-02 1:39 ` tongtiangen
0 siblings, 0 replies; 3+ messages in thread
From: tongtiangen @ 2021-06-02 1:39 UTC (permalink / raw)
To: Sean Young; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel
On 2021/6/1 18:25, Sean Young wrote:
> On Tue, Jun 01, 2021 at 06:02:35PM +0800, Tong Tiangen wrote:
>> Fix a typo in lirc_ioctl, apparently min_timeout should be used
>> in this case.
>>
>> Fixes: e589333f346b ("V4L/DVB: IR: extend interfaces to support more device settings")
>> Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
>> ---
>> 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 116daf90c858..abbeae2ccd4a 100644
>> --- a/drivers/media/rc/lirc_dev.c
>> +++ b/drivers/media/rc/lirc_dev.c
>> @@ -534,7 +534,7 @@ static long lirc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>>
>> /* Generic timeout support */
>> case LIRC_GET_MIN_TIMEOUT:
>> - if (!dev->max_timeout)
>> + if (!dev->min_timeout)
> So maybe this isn't the clearest piece of code, but all rc drivers set
> either both of min_timeout & max_timeout, or neither. Having a max_timeout
> without a min_timeout does not make any sense.
>
> Changing this to min_timeout gives the impression min_timeout can be set
> without max_timeout, which is not the case. This should at least commented.
>
> Thanks
>
> Sean
I agree, the necessary comments should be added here.
Thanks
>
>> ret = -ENOTTY;
>> else
>> val = dev->min_timeout;
>> --
>> 2.18.0.huawei.25
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-02 1:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 10:02 [PATCH -next] media: rc: Fix a typo in lirc_ioctl Tong Tiangen
2021-06-01 10:25 ` Sean Young
2021-06-02 1:39 ` tongtiangen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.