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
5353 * @MHI_CHAIN: Linked transfer
5454 */
5555 enum mhi_flags {
56− MHI_EOB,
57− MHI_EOT,
58− MHI_CHAIN,
56+ MHI_EOB = BIT(0),
57+ MHI_EOT = BIT(1),
58+ MHI_CHAIN = BIT(2),
5959 };
6060
6161 /**