History

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.

Manivannan Sadhasivam committed 6 years ago

Commit 115f3251 parent d76bc821 file · +3 −3Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/mhi.h+3−3
@@ -53,9 +53,9 @@ enum mhi_callback { · 52 unmodified lines
53 * @MHI_CHAIN: Linked transfer53 * @MHI_CHAIN: Linked transfer
54 */54 */
55enum mhi_flags {55enum mhi_flags {
56 MHI_EOB,56 MHI_EOB = BIT(0),
57 MHI_EOT,57 MHI_EOT = BIT(1),
58 MHI_CHAIN,58 MHI_CHAIN = BIT(2),
59};59};
60 60
61/**61/**