<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/media/rc/lirc_dev.c, branch v4.9.120</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>lirc: fix dead lock between open and wakeup_filter</title>
<updated>2017-12-14T08:28:17+00:00</updated>
<author>
<name>Sean Young</name>
<email>sean@mess.org</email>
</author>
<published>2017-02-13T12:35:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f348a1030eb6d1d1f569a316667719c2280f14e4'/>
<id>f348a1030eb6d1d1f569a316667719c2280f14e4</id>
<content type='text'>
[ Upstream commit db5b15b74ed9a5c04bb808d18ffa2c773f5c18c0 ]

The locking in lirc needs improvement, but for now just fix this potential
deadlock.

======================================================
[ INFO: possible circular locking dependency detected ]
4.10.0-rc1+ #1 Not tainted
-------------------------------------------------------
bash/2502 is trying to acquire lock:
 (ir_raw_handler_lock){+.+.+.}, at: [&lt;ffffffffc06f6a5e&gt;] ir_raw_encode_scancode+0x3e/0xb0 [rc_core]

               but task is already holding lock:
 (&amp;dev-&gt;lock){+.+.+.}, at: [&lt;ffffffffc06f511f&gt;] store_filter+0x9f/0x240 [rc_core]

               which lock already depends on the new lock.

               the existing dependency chain (in reverse order) is:

               -&gt; #2 (&amp;dev-&gt;lock){+.+.+.}:

[&lt;ffffffffa110adad&gt;] lock_acquire+0xfd/0x200
[&lt;ffffffffa1921327&gt;] mutex_lock_nested+0x77/0x6d0
[&lt;ffffffffc06f436a&gt;] rc_open+0x2a/0x80 [rc_core]
[&lt;ffffffffc07114ca&gt;] lirc_dev_fop_open+0xda/0x1e0 [lirc_dev]
[&lt;ffffffffa12975e0&gt;] chrdev_open+0xb0/0x210
[&lt;ffffffffa128eb5a&gt;] do_dentry_open+0x20a/0x2f0
[&lt;ffffffffa128ffcc&gt;] vfs_open+0x4c/0x80
[&lt;ffffffffa12a35ec&gt;] path_openat+0x5bc/0xc00
[&lt;ffffffffa12a5271&gt;] do_filp_open+0x91/0x100
[&lt;ffffffffa12903f0&gt;] do_sys_open+0x130/0x220
[&lt;ffffffffa12904fe&gt;] SyS_open+0x1e/0x20
[&lt;ffffffffa19278c1&gt;] entry_SYSCALL_64_fastpath+0x1f/0xc2
               -&gt; #1 (lirc_dev_lock){+.+.+.}:
[&lt;ffffffffa110adad&gt;] lock_acquire+0xfd/0x200
[&lt;ffffffffa1921327&gt;] mutex_lock_nested+0x77/0x6d0
[&lt;ffffffffc0711f47&gt;] lirc_register_driver+0x67/0x59b [lirc_dev]
[&lt;ffffffffc06db7f4&gt;] ir_lirc_register+0x1f4/0x260 [ir_lirc_codec]
[&lt;ffffffffc06f6cac&gt;] ir_raw_handler_register+0x7c/0xb0 [rc_core]
[&lt;ffffffffc0398010&gt;] 0xffffffffc0398010
[&lt;ffffffffa1002192&gt;] do_one_initcall+0x52/0x1b0
[&lt;ffffffffa11ef5c8&gt;] do_init_module+0x5f/0x1fa
[&lt;ffffffffa11566b5&gt;] load_module+0x2675/0x2b00
[&lt;ffffffffa1156dcf&gt;] SYSC_finit_module+0xdf/0x110
[&lt;ffffffffa1156e1e&gt;] SyS_finit_module+0xe/0x10
[&lt;ffffffffa1003f5c&gt;] do_syscall_64+0x6c/0x1f0
[&lt;ffffffffa1927989&gt;] return_from_SYSCALL_64+0x0/0x7a
               -&gt; #0 (ir_raw_handler_lock){+.+.+.}:
[&lt;ffffffffa110a7b7&gt;] __lock_acquire+0x10f7/0x1290
[&lt;ffffffffa110adad&gt;] lock_acquire+0xfd/0x200
[&lt;ffffffffa1921327&gt;] mutex_lock_nested+0x77/0x6d0
[&lt;ffffffffc06f6a5e&gt;] ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
[&lt;ffffffffc0b0f492&gt;] loop_set_wakeup_filter+0x62/0xbd [rc_loopback]
[&lt;ffffffffc06f522a&gt;] store_filter+0x1aa/0x240 [rc_core]
[&lt;ffffffffa15e46f8&gt;] dev_attr_store+0x18/0x30
[&lt;ffffffffa13318e5&gt;] sysfs_kf_write+0x45/0x60
[&lt;ffffffffa1330b55&gt;] kernfs_fop_write+0x155/0x1e0
[&lt;ffffffffa1290797&gt;] __vfs_write+0x37/0x160
[&lt;ffffffffa12921f8&gt;] vfs_write+0xc8/0x1e0
[&lt;ffffffffa12936e8&gt;] SyS_write+0x58/0xc0
[&lt;ffffffffa19278c1&gt;] entry_SYSCALL_64_fastpath+0x1f/0xc2

               other info that might help us debug this:

Chain exists of:
                 ir_raw_handler_lock --&gt; lirc_dev_lock --&gt; &amp;dev-&gt;lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;dev-&gt;lock);
                               lock(lirc_dev_lock);
                               lock(&amp;dev-&gt;lock);
  lock(ir_raw_handler_lock);

                *** DEADLOCK ***

4 locks held by bash/2502:
 #0:  (sb_writers#4){.+.+.+}, at: [&lt;ffffffffa12922c5&gt;] vfs_write+0x195/0x1e0
 #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;ffffffffa1330b1f&gt;] kernfs_fop_write+0x11f/0x1e0
 #2:  (s_active#215){.+.+.+}, at: [&lt;ffffffffa1330b28&gt;] kernfs_fop_write+0x128/0x1e0
 #3:  (&amp;dev-&gt;lock){+.+.+.}, at: [&lt;ffffffffc06f511f&gt;] store_filter+0x9f/0x240 [rc_core]

               stack backtrace:
CPU: 3 PID: 2502 Comm: bash Not tainted 4.10.0-rc1+ #1
Hardware name:                  /DG45ID, BIOS IDG4510H.86A.0135.2011.0225.1100 02/25/2011
Call Trace:
 dump_stack+0x86/0xc3
 print_circular_bug+0x1be/0x210
 __lock_acquire+0x10f7/0x1290
 lock_acquire+0xfd/0x200
 ? ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 ? ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 mutex_lock_nested+0x77/0x6d0
 ? ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 ? loop_set_wakeup_filter+0x44/0xbd [rc_loopback]
 ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 loop_set_wakeup_filter+0x62/0xbd [rc_loopback]
 ? loop_set_tx_duty_cycle+0x70/0x70 [rc_loopback]
 store_filter+0x1aa/0x240 [rc_core]
 dev_attr_store+0x18/0x30
 sysfs_kf_write+0x45/0x60
 kernfs_fop_write+0x155/0x1e0
 __vfs_write+0x37/0x160
 ? rcu_read_lock_sched_held+0x4a/0x80
 ? rcu_sync_lockdep_assert+0x2f/0x60
 ? __sb_start_write+0x10c/0x220
 ? vfs_write+0x195/0x1e0
 ? security_file_permission+0x3b/0xc0
 vfs_write+0xc8/0x1e0
 SyS_write+0x58/0xc0
 entry_SYSCALL_64_fastpath+0x1f/0xc2

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit db5b15b74ed9a5c04bb808d18ffa2c773f5c18c0 ]

The locking in lirc needs improvement, but for now just fix this potential
deadlock.

======================================================
[ INFO: possible circular locking dependency detected ]
4.10.0-rc1+ #1 Not tainted
-------------------------------------------------------
bash/2502 is trying to acquire lock:
 (ir_raw_handler_lock){+.+.+.}, at: [&lt;ffffffffc06f6a5e&gt;] ir_raw_encode_scancode+0x3e/0xb0 [rc_core]

               but task is already holding lock:
 (&amp;dev-&gt;lock){+.+.+.}, at: [&lt;ffffffffc06f511f&gt;] store_filter+0x9f/0x240 [rc_core]

               which lock already depends on the new lock.

               the existing dependency chain (in reverse order) is:

               -&gt; #2 (&amp;dev-&gt;lock){+.+.+.}:

[&lt;ffffffffa110adad&gt;] lock_acquire+0xfd/0x200
[&lt;ffffffffa1921327&gt;] mutex_lock_nested+0x77/0x6d0
[&lt;ffffffffc06f436a&gt;] rc_open+0x2a/0x80 [rc_core]
[&lt;ffffffffc07114ca&gt;] lirc_dev_fop_open+0xda/0x1e0 [lirc_dev]
[&lt;ffffffffa12975e0&gt;] chrdev_open+0xb0/0x210
[&lt;ffffffffa128eb5a&gt;] do_dentry_open+0x20a/0x2f0
[&lt;ffffffffa128ffcc&gt;] vfs_open+0x4c/0x80
[&lt;ffffffffa12a35ec&gt;] path_openat+0x5bc/0xc00
[&lt;ffffffffa12a5271&gt;] do_filp_open+0x91/0x100
[&lt;ffffffffa12903f0&gt;] do_sys_open+0x130/0x220
[&lt;ffffffffa12904fe&gt;] SyS_open+0x1e/0x20
[&lt;ffffffffa19278c1&gt;] entry_SYSCALL_64_fastpath+0x1f/0xc2
               -&gt; #1 (lirc_dev_lock){+.+.+.}:
[&lt;ffffffffa110adad&gt;] lock_acquire+0xfd/0x200
[&lt;ffffffffa1921327&gt;] mutex_lock_nested+0x77/0x6d0
[&lt;ffffffffc0711f47&gt;] lirc_register_driver+0x67/0x59b [lirc_dev]
[&lt;ffffffffc06db7f4&gt;] ir_lirc_register+0x1f4/0x260 [ir_lirc_codec]
[&lt;ffffffffc06f6cac&gt;] ir_raw_handler_register+0x7c/0xb0 [rc_core]
[&lt;ffffffffc0398010&gt;] 0xffffffffc0398010
[&lt;ffffffffa1002192&gt;] do_one_initcall+0x52/0x1b0
[&lt;ffffffffa11ef5c8&gt;] do_init_module+0x5f/0x1fa
[&lt;ffffffffa11566b5&gt;] load_module+0x2675/0x2b00
[&lt;ffffffffa1156dcf&gt;] SYSC_finit_module+0xdf/0x110
[&lt;ffffffffa1156e1e&gt;] SyS_finit_module+0xe/0x10
[&lt;ffffffffa1003f5c&gt;] do_syscall_64+0x6c/0x1f0
[&lt;ffffffffa1927989&gt;] return_from_SYSCALL_64+0x0/0x7a
               -&gt; #0 (ir_raw_handler_lock){+.+.+.}:
[&lt;ffffffffa110a7b7&gt;] __lock_acquire+0x10f7/0x1290
[&lt;ffffffffa110adad&gt;] lock_acquire+0xfd/0x200
[&lt;ffffffffa1921327&gt;] mutex_lock_nested+0x77/0x6d0
[&lt;ffffffffc06f6a5e&gt;] ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
[&lt;ffffffffc0b0f492&gt;] loop_set_wakeup_filter+0x62/0xbd [rc_loopback]
[&lt;ffffffffc06f522a&gt;] store_filter+0x1aa/0x240 [rc_core]
[&lt;ffffffffa15e46f8&gt;] dev_attr_store+0x18/0x30
[&lt;ffffffffa13318e5&gt;] sysfs_kf_write+0x45/0x60
[&lt;ffffffffa1330b55&gt;] kernfs_fop_write+0x155/0x1e0
[&lt;ffffffffa1290797&gt;] __vfs_write+0x37/0x160
[&lt;ffffffffa12921f8&gt;] vfs_write+0xc8/0x1e0
[&lt;ffffffffa12936e8&gt;] SyS_write+0x58/0xc0
[&lt;ffffffffa19278c1&gt;] entry_SYSCALL_64_fastpath+0x1f/0xc2

               other info that might help us debug this:

Chain exists of:
                 ir_raw_handler_lock --&gt; lirc_dev_lock --&gt; &amp;dev-&gt;lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;dev-&gt;lock);
                               lock(lirc_dev_lock);
                               lock(&amp;dev-&gt;lock);
  lock(ir_raw_handler_lock);

                *** DEADLOCK ***

4 locks held by bash/2502:
 #0:  (sb_writers#4){.+.+.+}, at: [&lt;ffffffffa12922c5&gt;] vfs_write+0x195/0x1e0
 #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;ffffffffa1330b1f&gt;] kernfs_fop_write+0x11f/0x1e0
 #2:  (s_active#215){.+.+.+}, at: [&lt;ffffffffa1330b28&gt;] kernfs_fop_write+0x128/0x1e0
 #3:  (&amp;dev-&gt;lock){+.+.+.}, at: [&lt;ffffffffc06f511f&gt;] store_filter+0x9f/0x240 [rc_core]

               stack backtrace:
CPU: 3 PID: 2502 Comm: bash Not tainted 4.10.0-rc1+ #1
Hardware name:                  /DG45ID, BIOS IDG4510H.86A.0135.2011.0225.1100 02/25/2011
Call Trace:
 dump_stack+0x86/0xc3
 print_circular_bug+0x1be/0x210
 __lock_acquire+0x10f7/0x1290
 lock_acquire+0xfd/0x200
 ? ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 ? ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 mutex_lock_nested+0x77/0x6d0
 ? ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 ? loop_set_wakeup_filter+0x44/0xbd [rc_loopback]
 ir_raw_encode_scancode+0x3e/0xb0 [rc_core]
 loop_set_wakeup_filter+0x62/0xbd [rc_loopback]
 ? loop_set_tx_duty_cycle+0x70/0x70 [rc_loopback]
 store_filter+0x1aa/0x240 [rc_core]
 dev_attr_store+0x18/0x30
 sysfs_kf_write+0x45/0x60
 kernfs_fop_write+0x155/0x1e0
 __vfs_write+0x37/0x160
 ? rcu_read_lock_sched_held+0x4a/0x80
 ? rcu_sync_lockdep_assert+0x2f/0x60
 ? __sb_start_write+0x10c/0x220
 ? vfs_write+0x195/0x1e0
 ? security_file_permission+0x3b/0xc0
 vfs_write+0xc8/0x1e0
 SyS_write+0x58/0xc0
 entry_SYSCALL_64_fastpath+0x1f/0xc2

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lirc_dev: LIRC_{G,S}ET_REC_MODE do not work</title>
<updated>2017-03-12T05:41:41+00:00</updated>
<author>
<name>Sean Young</name>
<email>sean@mess.org</email>
</author>
<published>2016-12-02T17:16:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ce1e60b492144b1d5ae0f67b781459325de0e884'/>
<id>ce1e60b492144b1d5ae0f67b781459325de0e884</id>
<content type='text'>
commit bd291208d7f5d6b2d6a033fee449a429230b06df upstream.

Since "273b902 [media] lirc_dev: use LIRC_CAN_REC() define" these
ioctls no longer work.

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Reviewed-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bd291208d7f5d6b2d6a033fee449a429230b06df upstream.

Since "273b902 [media] lirc_dev: use LIRC_CAN_REC() define" these
ioctls no longer work.

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Reviewed-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: use LIRC_CAN_REC() define to check if the device can receive</title>
<updated>2016-07-13T18:29:03+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=273b902a5b1bfd6977a73c4de3eb96db3cb103cb'/>
<id>273b902a5b1bfd6977a73c4de3eb96db3cb103cb</id>
<content type='text'>
The LIRC_CAN_REC() returns a boolean "flag &amp; LIRC_CAN_REC_MASK"
to check whether the device can receive data.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The LIRC_CAN_REC() returns a boolean "flag &amp; LIRC_CAN_REC_MASK"
to check whether the device can receive data.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: fix potential segfault</title>
<updated>2016-07-13T18:28:25+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8e5fa4c67d6387d40e2ae350e96fca939ba5e681'/>
<id>8e5fa4c67d6387d40e2ae350e96fca939ba5e681</id>
<content type='text'>
When opening or closing a lirc character device, the framework
provides to the user the possibility to keep track of opening or
closing of the device by calling two functions:

 - set_use_inc() when opening the device
 - set_use_dec() when closing the device

if those are not set by the lirc user, the system segfaults.
Check the pointer value before calling the above functions.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When opening or closing a lirc character device, the framework
provides to the user the possibility to keep track of opening or
closing of the device by calling two functions:

 - set_use_inc() when opening the device
 - set_use_dec() when closing the device

if those are not set by the lirc user, the system segfaults.
Check the pointer value before calling the above functions.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: extremely trivial comment style fix</title>
<updated>2016-07-13T18:27:16+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=62e92682c08885e91113ba742573e736c85db0e4'/>
<id>62e92682c08885e91113ba742573e736c85db0e4</id>
<content type='text'>
Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: fix error return value</title>
<updated>2016-07-13T18:26:52+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b408809487e0b80fdd7869f92b5ca3be55923e9d'/>
<id>b408809487e0b80fdd7869f92b5ca3be55923e9d</id>
<content type='text'>
If ioctl is called, it cannot be a case of invalid system call
number (ENOSYS), that is a ENOTTY case which means that the
device doesn't support that specific ioctl command.

So, replace ENOSYS with ENOTTY.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If ioctl is called, it cannot be a case of invalid system call
number (ENOSYS), that is a ENOTTY case which means that the
device doesn't support that specific ioctl command.

So, replace ENOSYS with ENOTTY.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: fix variable constant comparisons</title>
<updated>2016-07-13T18:25:41+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9675ee5a8e42807ebd33bf4934f235911b5647b0'/>
<id>9675ee5a8e42807ebd33bf4934f235911b5647b0</id>
<content type='text'>
When comparing a variable with a constant, the comparison should
start from the variable and not from the constant. It's also
written in the human DNA.

Swap the terms of comparisons whenever the constant comes first
and fix the following checkpatch warning:

  WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When comparing a variable with a constant, the comparison should
start from the variable and not from the constant. It's also
written in the human DNA.

Swap the terms of comparisons whenever the constant comes first
and fix the following checkpatch warning:

  WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: merge three if statements in only one</title>
<updated>2016-07-13T18:24:28+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=14db9fc2d4e50d95d7586bc6c54029afbcbdf4a1'/>
<id>14db9fc2d4e50d95d7586bc6c54029afbcbdf4a1</id>
<content type='text'>
The three if statements check the same thing, merge them in only
one statement.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The three if statements check the same thing, merge them in only
one statement.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: remove double if ... else statement</title>
<updated>2016-07-13T18:09:05+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ab86d2aa04375167c0e168eecb672acaf3d991a'/>
<id>6ab86d2aa04375167c0e168eecb672acaf3d991a</id>
<content type='text'>
There are two if ... else which check the same thing in different
part of the code, they can be merged in a single check.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two if ... else which check the same thing in different
part of the code, they can be merged in a single check.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] lirc_dev: simplify if statement in lirc_add_to_buf</title>
<updated>2016-07-13T18:06:29+00:00</updated>
<author>
<name>Andi Shyti</name>
<email>andi.shyti@samsung.com</email>
</author>
<published>2016-07-06T09:01:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=19e565397cb92b0484c46c48498e0fe2d2491efa'/>
<id>19e565397cb92b0484c46c48498e0fe2d2491efa</id>
<content type='text'>
The whole function is inside an 'if' statement
("if (ir-&gt;d.add_to_buf)").

Check the opposite of that statement at the beginning and exit,
this way we can have one level less of indentation.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The whole function is inside an 'if' statement
("if (ir-&gt;d.add_to_buf)").

Check the opposite of that statement at the beginning and exit,
this way we can have one level less of indentation.

Signed-off-by: Andi Shyti &lt;andi.shyti@samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
