Skip to content

Commit

Permalink
fast-classifier.c: eliminate compile warnings (may be a potential bug)
Browse files Browse the repository at this point in the history
The relevant warning messages are as follows:
  CC [M]  drivers/net/ethernet/qualcomm/sfe/shortcut-fe/sfe_cm.o
  CC [M]  drivers/net/ethernet/qualcomm/sfe/fast-classifier/fast-classifier.o
  AR [M]  drivers/net/ethernet/qualcomm/sfe/shortcut-fe/shortcut-fe-cm.o
  LTO [M] drivers/net/ethernet/qualcomm/sfe/shortcut-fe/shortcut-fe-cm.lto.o
drivers/net/ethernet/qualcomm/sfe/fast-classifier/fast-classifier.c:1486:20: warning: converting the enum constant to a boolean [-Wint-in-bool
-context]
                if (sis->src_dev && IFF_EBRIDGE &&
                                 ^
drivers/net/ethernet/qualcomm/sfe/fast-classifier/fast-classifier.c:1494:21: warning: converting the enum constant to a boolean [-Wint-in-bool
-context]
                if (sis->dest_dev && IFF_EBRIDGE &&
                                  ^
2 warnings generated.
  LTO [M] drivers/net/ethernet/qualcomm/sfe/fast-classifier/fast-classifier.lto.o
  • Loading branch information
unifreq committed Feb 28, 2022
1 parent f9f63f2 commit 6b543cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/qualcomm/sfe/fast-classifier/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ ifeq ($(CONFIG_SFE_SUPPORT_IPV6),y)
endif

ccflags-y += -I$(obj)/../shortcut-fe
ccflags-y += -Werror -Wall
Original file line number Diff line number Diff line change
Expand Up @@ -1483,15 +1483,15 @@ static void fast_classifier_sync_rule(struct sfe_connection_sync *sis)
nlstats.tx_packets = 0;
nlstats.tx_bytes = 0;

if (sis->src_dev && IFF_EBRIDGE &&
if ((sis->src_dev->priv_flags & IFF_EBRIDGE) &&
(sis->src_new_packet_count || sis->src_new_byte_count)) {
nlstats.rx_packets = sis->src_new_packet_count;
nlstats.rx_bytes = sis->src_new_byte_count;
spin_lock_bh(&sfe_connections_lock);
br_dev_update_stats(sis->src_dev, &nlstats);
spin_unlock_bh(&sfe_connections_lock);
}
if (sis->dest_dev && IFF_EBRIDGE &&
if ((sis->dest_dev->priv_flags & IFF_EBRIDGE) &&
(sis->dest_new_packet_count || sis->dest_new_byte_count)) {
nlstats.rx_packets = sis->dest_new_packet_count;
nlstats.rx_bytes = sis->dest_new_byte_count;
Expand Down

0 comments on commit 6b543cd

Please sign in to comment.