Skip to content

Commit 5df09c1

Browse files
tititiou36Peter Chen
authored andcommitted
usb: cdnsp: Fix the IMAN_IE_SET and IMAN_IE_CLEAR macro
IMAN_IE is BIT(1), so these macro are respectively equivalent to BIT(1) and 0, whatever the value of 'p'. The purpose was to set and reset a single bit in 'p'. Fix these macros to do that correctly. Acked-by: Pawel Laszczak <[email protected]> Fixes: e93e58d ("usb: cdnsp: Device side header file for CDNSP driver") Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/d12bfcc9cbffb89e27b120668821b3c4f09b6755.1624390584.git.christophe.jaillet@wanadoo.fr Signed-off-by: Peter Chen <[email protected]>
1 parent e913aad commit 5df09c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/cdns3/cdnsp-gadget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ struct cdnsp_intr_reg {
383383
#define IMAN_IE BIT(1)
384384
#define IMAN_IP BIT(0)
385385
/* bits 2:31 need to be preserved */
386-
#define IMAN_IE_SET(p) (((p) & IMAN_IE) | 0x2)
387-
#define IMAN_IE_CLEAR(p) (((p) & IMAN_IE) & ~(0x2))
386+
#define IMAN_IE_SET(p) ((p) | IMAN_IE)
387+
#define IMAN_IE_CLEAR(p) ((p) & ~IMAN_IE)
388388

389389
/* IMOD - Interrupter Moderation Register - irq_control bitmasks. */
390390
/*

0 commit comments

Comments
 (0)