Skip to content

Commit

Permalink
usb: phytium: Fix wrong assign logic in hostErrorIrq
Browse files Browse the repository at this point in the history
We'll apply a bitwise AND to the controller's rxerrirq and rxerrien
to isolate interrupts that are both triggered and enabled.
This filtering ensures that we only process relevant interrupts.

Self bitwise AND operations are meaningless.

Fix follow error with clang-19:

drivers/usb/phytium/host.c:451:11: error: explicitly assigning value of variable of type 'uint16_t' (aka 'unsigned short') to itself [-Werror,-Wself-assign]
  451 |         rxerrirq &= rxerrirq;
      |         ~~~~~~~~ ^  ~~~~~~~~
1 error generated.

Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 28, 2024
1 parent 0983932 commit d2a2df7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/phytium/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static void hostErrorIrq(struct HOST_CTRL *priv)

rxerrirq = phytium_read16(&priv->regs->rxerrirq);
rxerrien = phytium_read16(&priv->regs->rxerrien);
rxerrirq &= rxerrirq;
rxerrirq &= rxerrien;
if (!txerrirq && !rxerrirq)
return;

Expand Down

0 comments on commit d2a2df7

Please sign in to comment.