Skip to content

Commit

Permalink
usb: cdnsp: Fix the IMAN_IE_SET and IMAN_IE_CLEAR macro
Browse files Browse the repository at this point in the history
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 <pawell@cadence.com>
Fixes: e93e58d ("usb: cdnsp: Device side header file for CDNSP driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/d12bfcc9cbffb89e27b120668821b3c4f09b6755.1624390584.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Peter Chen <peter.chen@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Peter Chen committed Jul 29, 2021
1 parent e913aad commit 5df09c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/cdns3/cdnsp-gadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ struct cdnsp_intr_reg {
#define IMAN_IE BIT(1)
#define IMAN_IP BIT(0)
/* bits 2:31 need to be preserved */
#define IMAN_IE_SET(p) (((p) & IMAN_IE) | 0x2)
#define IMAN_IE_CLEAR(p) (((p) & IMAN_IE) & ~(0x2))
#define IMAN_IE_SET(p) ((p) | IMAN_IE)
#define IMAN_IE_CLEAR(p) ((p) & ~IMAN_IE)

/* IMOD - Interrupter Moderation Register - irq_control bitmasks. */
/*
Expand Down

0 comments on commit 5df09c1

Please sign in to comment.