Skip to content

Commit 115f325

Browse files
Mani-Sadhasivamgregkh
authored andcommitted
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: 189ff97 ("bus: mhi: core: Add support for data transfer") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d76bc82 commit 115f325

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/mhi.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ enum mhi_callback {
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
/**

0 commit comments

Comments
 (0)