Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bnxt_en: Fix compile warnings when CONFIG_INET is not set.

bnxt_gro_skb() has unused variables when CONFIG_INET is not set. We
really cannot support hardware GRO if CONFIG_INET is not set, so
compile out bnxt_gro_skb() completely and define BNXT_FLAG_GRO to be 0
if CONFIG_INET is not set. This will effectively always disable
hardware GRO if CONFIG_INET is not set.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Michael Chan and committed by
David S. Miller
d1611c3a 3ed770f6

+6 -1
+1 -1
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 852 852 struct rx_tpa_end_cmp_ext *tpa_end1, 853 853 struct sk_buff *skb) 854 854 { 855 + #ifdef CONFIG_INET 855 856 struct tcphdr *th; 856 857 int payload_off, tcp_opt_len = 0; 857 858 int len, nw_off; ··· 867 866 if (TPA_END_GRO_TS(tpa_end)) 868 867 tcp_opt_len = 12; 869 868 870 - #ifdef CONFIG_INET 871 869 if (tpa_info->gso_type == SKB_GSO_TCPV4) { 872 870 struct iphdr *iph; 873 871
+5
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 855 855 #define BNXT_FLAG_DCB_ENABLED 0x1 856 856 #define BNXT_FLAG_VF 0x2 857 857 #define BNXT_FLAG_LRO 0x4 858 + #ifdef CONFIG_INET 858 859 #define BNXT_FLAG_GRO 0x8 860 + #else 861 + /* Cannot support hardware GRO if CONFIG_INET is not set */ 862 + #define BNXT_FLAG_GRO 0x0 863 + #endif 859 864 #define BNXT_FLAG_TPA (BNXT_FLAG_LRO | BNXT_FLAG_GRO) 860 865 #define BNXT_FLAG_JUMBO 0x10 861 866 #define BNXT_FLAG_STRIP_VLAN 0x20