]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: cdev: refactor gpiohandle_flags_to_desc_flags
authorKent Gibson <warthog618@gmail.com>
Wed, 8 Jul 2020 04:15:47 +0000 (12:15 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Sun, 12 Jul 2020 08:22:00 +0000 (10:22 +0200)
commitf654e5eb3d1dd256549c28af99134d2e0ebe83bd
tree8b6cd41e88f3f4cbb2bb43dc0dedc794f398ebc9
parent541501f5ce7d5c7dcd61fca36118aea55572c096
gpiolib: cdev: refactor gpiohandle_flags_to_desc_flags

Refactor the mapping from handle flags to desc flags into a helper
function.

The assign_bit is overkill where it is replacing the set_bit cases, as is
rechecking bits known to be clear in some circumstances, but the DRY
simplification more than makes up for any performance degradation,
especially as this is not a hot path.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib-cdev.c