Skip to content

Commit

Permalink
eth: mucse: rnp: remove extraneous parentheses around the comparison
Browse files Browse the repository at this point in the history
Fix follow errors with clang-19:

drivers/net/ethernet/mucse/rnp/rnp_main.c:6165:24: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
 6165 |                 } else if ((protocol == htons(ETH_P_8021Q))) {
      |                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_main.c:6165:24: note: remove extraneous parentheses around the comparison to silence this warning
 6165 |                 } else if ((protocol == htons(ETH_P_8021Q))) {
      |                            ~         ^                    ~
drivers/net/ethernet/mucse/rnp/rnp_main.c:6165:24: note: use '=' to turn this equality comparison into an assignment
 6165 |                 } else if ((protocol == htons(ETH_P_8021Q))) {
      |                                      ^~
      |                                      =
1 error generated.

drivers/net/ethernet/mucse/rnp/rnp_n10.c:3329:30: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
 3329 |                         if ((hw->force_speed_stat ==
      |                              ~~~~~~~~~~~~~~~~~~~~~^~
 3330 |                              FORCE_SPEED_STAT_DISABLED)) {
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_n10.c:3329:30: note: remove extraneous parentheses around the comparison to silence this warning
 3329 |                         if ((hw->force_speed_stat ==
      |                             ~                     ^
 3330 |                              FORCE_SPEED_STAT_DISABLED)) {
      |                                                       ~
drivers/net/ethernet/mucse/rnp/rnp_n10.c:3329:30: note: use '=' to turn this equality comparison into an assignment
 3329 |                         if ((hw->force_speed_stat ==
      |                                                   ^~
      |                                                   =
1 error generated.

Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 22, 2024
1 parent 185c834 commit f715458
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mucse/rnp/rnp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6162,7 +6162,7 @@ netdev_tx_t rnp_xmit_frame_ring(struct sk_buff *skb,
* protocol and store the tag
*/
/* veb only use ctags */
} else if ((protocol == htons(ETH_P_8021Q))) {
} else if (protocol == htons(ETH_P_8021Q)) {
struct vlan_hdr *vhdr, _vhdr;

vhdr = skb_header_pointer(skb, ETH_HLEN, sizeof(_vhdr),
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mucse/rnp/rnp_n10.c
Original file line number Diff line number Diff line change
Expand Up @@ -3326,8 +3326,8 @@ static int rnp10_set_link_ksettings(struct net_device *netdev,
if (advertising_link_speed) {
hw->phy.autoneg_advertised = advertising_link_speed;
} else {
if ((hw->force_speed_stat ==
FORCE_SPEED_STAT_DISABLED)) {
if (hw->force_speed_stat ==
FORCE_SPEED_STAT_DISABLED) {
netdev_info(netdev,
"advertising_link_speed is 0\n");
err = -EINVAL;
Expand Down

0 comments on commit f715458

Please sign in to comment.