]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rts5208: Simplify boolean expression to improve code style
authorTobias Nießen <tobias.niessen@stud.uni-hannover.de>
Wed, 26 Jun 2019 14:28:57 +0000 (16:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jul 2019 07:05:21 +0000 (09:05 +0200)
commit85a0c112576fff059c4f6a0c3d0aca8b1077e9b2
tree72304c91a427aa5a1a24767fad1f894fc9bdc952
parent55e37e59743c5d5ce864023b5ef5678606912aa8
staging: rts5208: Simplify boolean expression to improve code style

This bitwisen / boolean expression can be made more readable while
reducing the line lengths at the same time. This commit uses the
fact that

    a & (b | c) == (b | c)

evaluates to true if and only if

    (a & b) && (a & c)

is true. Since b and c are constants with relatively long names,
using the second form makes the code much more readable and shorter.

Signed-off-by: Tobias Nießen <tobias.niessen@stud.uni-hannover.de>
Signed-off-by: Sabrina Gaube <sabrina-gaube@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/xd.c