Skip to content

Commit 58cdfe6

Browse files
Tom Rixwesteri
authored andcommitted
thunderbolt: Rename shadowed variables bit to interrupt_bit and auto_clear_bit
cppcheck reports drivers/thunderbolt/nhi.c:74:7: style: Local variable 'bit' shadows outer variable [shadowVariable] int bit; ^ drivers/thunderbolt/nhi.c:66:6: note: Shadowed declaration int bit = ring_interrupt_index(ring) & 31; ^ drivers/thunderbolt/nhi.c:74:7: note: Shadow variable int bit; ^ For readablity rename the outer to interrupt_bit and the innner to auto_clear_bit. Fixes: 468c49f ("thunderbolt: Disable interrupt auto clear for ring") Cc: [email protected] Signed-off-by: Tom Rix <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent 468c49f commit 58cdfe6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/thunderbolt/nhi.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ static void ring_interrupt_active(struct tb_ring *ring, bool active)
6363
{
6464
int reg = REG_RING_INTERRUPT_BASE +
6565
ring_interrupt_index(ring) / 32 * 4;
66-
int bit = ring_interrupt_index(ring) & 31;
67-
int mask = 1 << bit;
66+
int interrupt_bit = ring_interrupt_index(ring) & 31;
67+
int mask = 1 << interrupt_bit;
6868
u32 old, new;
6969

7070
if (ring->irq > 0) {
7171
u32 step, shift, ivr, misc;
7272
void __iomem *ivr_base;
73+
int auto_clear_bit;
7374
int index;
74-
int bit;
7575

7676
if (ring->is_tx)
7777
index = ring->hop;
@@ -91,11 +91,12 @@ static void ring_interrupt_active(struct tb_ring *ring, bool active)
9191
*/
9292
misc = ioread32(ring->nhi->iobase + REG_DMA_MISC);
9393
if (ring->nhi->quirks & QUIRK_AUTO_CLEAR_INT)
94-
bit = REG_DMA_MISC_INT_AUTO_CLEAR;
94+
auto_clear_bit = REG_DMA_MISC_INT_AUTO_CLEAR;
9595
else
96-
bit = REG_DMA_MISC_DISABLE_AUTO_CLEAR;
97-
if (!(misc & bit))
98-
iowrite32(misc | bit, ring->nhi->iobase + REG_DMA_MISC);
96+
auto_clear_bit = REG_DMA_MISC_DISABLE_AUTO_CLEAR;
97+
if (!(misc & auto_clear_bit))
98+
iowrite32(misc | auto_clear_bit,
99+
ring->nhi->iobase + REG_DMA_MISC);
99100

100101
ivr_base = ring->nhi->iobase + REG_INT_VEC_ALLOC_BASE;
101102
step = index / REG_INT_VEC_ALLOC_REGS * REG_INT_VEC_ALLOC_BITS;
@@ -115,7 +116,7 @@ static void ring_interrupt_active(struct tb_ring *ring, bool active)
115116

116117
dev_dbg(&ring->nhi->pdev->dev,
117118
"%s interrupt at register %#x bit %d (%#x -> %#x)\n",
118-
active ? "enabling" : "disabling", reg, bit, old, new);
119+
active ? "enabling" : "disabling", reg, interrupt_bit, old, new);
119120

120121
if (new == old)
121122
dev_WARN(&ring->nhi->pdev->dev,

0 commit comments

Comments
 (0)