]> git.baikalelectronics.ru Git - kernel.git/commit
bus: mhi: Fix parsing of mhi_flags
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 30 Apr 2020 19:05:50 +0000 (00:35 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 May 2020 14:56:41 +0000 (16:56 +0200)
commita75906c39d1f09cf2ccbdfbaa7adcb716ed70fdc
treefbb7749662968c261a6cd939e2a3fac81e23d9b9
parent63ee38fd32561432e313e1b035c772c8626edd3f
bus: mhi: Fix parsing of mhi_flags

With the current parsing of mhi_flags, the following statement always
return false:

eob = !!(flags & MHI_EOB);

This is due to the fact that 'enum mhi_flags' starts with index 0 and we
are using direct AND operation to extract each bit. Fix this by using
BIT() macros for defining the flags so that the reset of the code need not
be touched.

Fixes: cbc78df5ae5c ("bus: mhi: core: Add support for data transfer")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20200430190555.32741-2-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/mhi.h