Skip to content

Commit

Permalink
net: macb: phytium-gem: donot convert the enum constant to a boolean
Browse files Browse the repository at this point in the history
Fix follow error with clang-19:

drivers/net/ethernet/cadence/macb_main.c:724:71: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
  724 |         if (macb_is_gem(bp) && (state->interface == PHY_INTERFACE_MODE_SGMII ||
      |                                                                              ^
1 error generated.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
  • Loading branch information
Avenger-285714 committed Dec 11, 2024
1 parent 1606347 commit 3c262ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
* Must be written after PCSSEL is set in NCFGR,
* otherwise writes will not take effect.
*/
if (macb_is_gem(bp) && state->interface == PHY_INTERFACE_MODE_SGMII) {
if (macb_is_gem(bp) && (state->interface == PHY_INTERFACE_MODE_SGMII ||
state->interface == PHY_INTERFACE_MODE_2500BASEX)) {
u32 pcsctrl, old_pcsctrl;

old_pcsctrl = gem_readl(bp, PCSCNTRL);
Expand Down

0 comments on commit 3c262ed

Please sign in to comment.