Skip to content

Commit

Permalink
eth: mucse: rnpgbevf: initialize the variable 'advertising'
Browse files Browse the repository at this point in the history
Fix follow error with clang-19:

drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_ethtool.c:143:3: error: variable 'advertising' is uninitialized when used here [-Werror,-Wuninitialized]
  143 |                 advertising |= ADVERTISED_FIBRE | ADVERTISED_1000baseKX_Full;
      |                 ^~~~~~~~~~~
drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_ethtool.c:131:28: note: initialize the variable 'advertising' to silence this warning
  131 |         u32 supported, advertising;
      |                                   ^
      |                                    = 0
1 error generated.

Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 25, 2024
1 parent 461ad60 commit a75c93b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ static int rnpgbevf_get_link_ksettings(struct net_device *netdev,
struct rnpgbevf_hw *hw = &adapter->hw;
bool autoneg = false;
bool link_up;
u32 supported, advertising;
u32 supported;
u32 advertising = 0;
u32 link_speed = 0;

ethtool_convert_link_mode_to_legacy_u32(&supported,
Expand Down

0 comments on commit a75c93b

Please sign in to comment.