From 09640e6365c679b5642b1c41b6d7078f51689ddf Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 1 Feb 2009 00:45:17 -0800 Subject: net: replace uses of __constant_{endian} Base versions handle constant folding now. Signed-off-by: Harvey Harrison Signed-off-by: David S. Miller --- net/appletalk/ddp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/appletalk/ddp.c') diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 5abce07fb50..510a6782da8 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -1861,12 +1861,12 @@ static struct notifier_block ddp_notifier = { }; static struct packet_type ltalk_packet_type = { - .type = __constant_htons(ETH_P_LOCALTALK), + .type = cpu_to_be16(ETH_P_LOCALTALK), .func = ltalk_rcv, }; static struct packet_type ppptalk_packet_type = { - .type = __constant_htons(ETH_P_PPPTALK), + .type = cpu_to_be16(ETH_P_PPPTALK), .func = atalk_rcv, }; -- cgit v1.2.3-70-g09d2 From 2db096086e8ff6c2a42881966e441157c686603b Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Wed, 25 Feb 2009 10:31:59 +0000 Subject: appletalk: fix warning: format not a string literal and no ... Impact: Use 'static const char[]' instead of 'static char[]', and since the data is const now it can be placed in __initconst. Fix this warning: net/appletalk/ddp.c: In function 'atalk_init': net/appletalk/ddp.c:1894: warning: format not a string literal and no format arguments Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- net/appletalk/ddp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/appletalk/ddp.c') diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 510a6782da8..cf05c43cba5 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -1877,7 +1877,7 @@ EXPORT_SYMBOL(aarp_send_ddp); EXPORT_SYMBOL(atrtr_get_dev); EXPORT_SYMBOL(atalk_find_dev_addr); -static char atalk_err_snap[] __initdata = +static const char atalk_err_snap[] __initconst = KERN_CRIT "Unable to register DDP with SNAP.\n"; /* Called by proto.c on kernel start up */ -- cgit v1.2.3-70-g09d2 From 7546dd97d27306d939c13e03318aae695badaa88 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 9 Mar 2009 08:18:29 +0000 Subject: net: convert usage of packet_type to read_mostly Protocols that use packet_type can be __read_mostly section for better locality. Elminate any unnecessary initializations of NULL. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- drivers/block/aoe/aoenet.c | 2 +- drivers/net/hamradio/bpqether.c | 2 +- drivers/net/pppoe.c | 6 +++--- drivers/net/wan/hdlc.c | 2 +- drivers/net/wan/lapbether.c | 2 +- net/8021q/vlan.c | 2 +- net/appletalk/ddp.c | 4 ++-- net/ax25/af_ax25.c | 3 +-- net/decnet/af_decnet.c | 3 +-- net/dsa/tag_dsa.c | 2 +- net/dsa/tag_edsa.c | 2 +- net/dsa/tag_trailer.c | 2 +- net/econet/af_econet.c | 2 +- net/ipv4/af_inet.c | 2 +- net/ipv4/arp.c | 2 +- net/ipv6/af_inet6.c | 2 +- net/ipx/af_ipx.c | 4 ++-- net/irda/irmod.c | 2 +- net/llc/llc_core.c | 4 ++-- net/phonet/af_phonet.c | 3 +-- net/x25/af_x25.c | 2 +- 21 files changed, 26 insertions(+), 29 deletions(-) (limited to 'net/appletalk/ddp.c') diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index c6099ba9a4b..ce0d62cd71b 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c @@ -151,7 +151,7 @@ exit: return 0; } -static struct packet_type aoe_pt = { +static struct packet_type aoe_pt __read_mostly = { .type = __constant_htons(ETH_P_AOE), .func = aoenet_rcv, }; diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 44b183b58f5..d509b371a56 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c @@ -97,7 +97,7 @@ static char bpq_eth_addr[6]; static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); static int bpq_device_event(struct notifier_block *, unsigned long, void *); -static struct packet_type bpq_packet_type = { +static struct packet_type bpq_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_BPQ), .func = bpq_rcv, }; diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index e2968f08443..f0031f1f97e 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c @@ -513,17 +513,17 @@ out: return NET_RX_SUCCESS; /* Lies... :-) */ } -static struct packet_type pppoes_ptype = { +static struct packet_type pppoes_ptype __read_mostly = { .type = cpu_to_be16(ETH_P_PPP_SES), .func = pppoe_rcv, }; -static struct packet_type pppoed_ptype = { +static struct packet_type pppoed_ptype __read_mostly = { .type = cpu_to_be16(ETH_P_PPP_DISC), .func = pppoe_disc_rcv, }; -static struct proto pppoe_sk_proto = { +static struct proto pppoe_sk_proto __read_mostly = { .name = "PPPOE", .owner = THIS_MODULE, .obj_size = sizeof(struct pppox_sock), diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 5ce43720555..7596eae1b35 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c @@ -348,7 +348,7 @@ EXPORT_SYMBOL(unregister_hdlc_protocol); EXPORT_SYMBOL(attach_hdlc_protocol); EXPORT_SYMBOL(detach_hdlc_protocol); -static struct packet_type hdlc_packet_type = { +static struct packet_type hdlc_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_HDLC), .func = hdlc_rcv, }; diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 96d9eda4089..f85ca1b27f9 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -421,7 +421,7 @@ static int lapbeth_device_event(struct notifier_block *this, /* ------------------------------------------------------------------------ */ -static struct packet_type lapbeth_packet_type = { +static struct packet_type lapbeth_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_DEC), .func = lapbeth_rcv, }; diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 4163ea65bf4..2b7390e377b 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -51,7 +51,7 @@ const char vlan_version[] = DRV_VERSION; static const char vlan_copyright[] = "Ben Greear "; static const char vlan_buggyright[] = "David S. Miller "; -static struct packet_type vlan_packet_type = { +static struct packet_type vlan_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_8021Q), .func = vlan_skb_recv, /* VLAN receive method */ }; diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index cf05c43cba5..3e0671df3a3 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -1860,12 +1860,12 @@ static struct notifier_block ddp_notifier = { .notifier_call = ddp_device_event, }; -static struct packet_type ltalk_packet_type = { +static struct packet_type ltalk_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_LOCALTALK), .func = ltalk_rcv, }; -static struct packet_type ppptalk_packet_type = { +static struct packet_type ppptalk_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_PPPTALK), .func = atalk_rcv, }; diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index d127fd3ba5c..8f8f63ff656 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1985,9 +1985,8 @@ static const struct proto_ops ax25_proto_ops = { /* * Called by socket.c on kernel start up */ -static struct packet_type ax25_packet_type = { +static struct packet_type ax25_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_AX25), - .dev = NULL, /* All devices */ .func = ax25_kiss_rcv, }; diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index ec233b64f85..9647d911f91 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c @@ -2112,9 +2112,8 @@ static struct notifier_block dn_dev_notifier = { extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); -static struct packet_type dn_dix_packet_type = { +static struct packet_type dn_dix_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_DNA_RT), - .dev = NULL, /* All devices */ .func = dn_route_rcv, }; diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index 63e532a69fd..0b8a91ddff4 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c @@ -175,7 +175,7 @@ out: return 0; } -static struct packet_type dsa_packet_type = { +static struct packet_type dsa_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_DSA), .func = dsa_rcv, }; diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c index 6197f9a7ef4..16fcb6d196d 100644 --- a/net/dsa/tag_edsa.c +++ b/net/dsa/tag_edsa.c @@ -194,7 +194,7 @@ out: return 0; } -static struct packet_type edsa_packet_type = { +static struct packet_type edsa_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_EDSA), .func = edsa_rcv, }; diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index d7e7f424ff0..a6d959da678 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c @@ -111,7 +111,7 @@ out: return 0; } -static struct packet_type trailer_packet_type = { +static struct packet_type trailer_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_TRAILER), .func = trailer_rcv, }; diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 7bf35582f65..6f479fa522c 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c @@ -1102,7 +1102,7 @@ drop: return NET_RX_DROP; } -static struct packet_type econet_packet_type = { +static struct packet_type econet_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_ECONET), .func = econet_rcv, }; diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 627be4dc7fb..d5aaabbb7cb 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1500,7 +1500,7 @@ static int ipv4_proc_init(void); * IP protocol layer initialiser */ -static struct packet_type ip_packet_type = { +static struct packet_type ip_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_IP), .func = ip_rcv, .gso_send_check = inet_gso_send_check, diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 3f6b7354699..3d67d1ffed7 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -1225,7 +1225,7 @@ void arp_ifdown(struct net_device *dev) * Called once on startup. */ -static struct packet_type arp_packet_type = { +static struct packet_type arp_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_ARP), .func = arp_rcv, }; diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 57b07da1212..3e2ddfaee81 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -893,7 +893,7 @@ out_unlock: return err; } -static struct packet_type ipv6_packet_type = { +static struct packet_type ipv6_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_IPV6), .func = ipv6_rcv, .gso_send_check = ipv6_gso_send_check, diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 43d0ffc6d56..30bd322b798 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -1958,12 +1958,12 @@ static const struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = { SOCKOPS_WRAP(ipx_dgram, PF_IPX); -static struct packet_type ipx_8023_packet_type = { +static struct packet_type ipx_8023_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_802_3), .func = ipx_rcv, }; -static struct packet_type ipx_dix_packet_type = { +static struct packet_type ipx_dix_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_IPX), .func = ipx_rcv, }; diff --git a/net/irda/irmod.c b/net/irda/irmod.c index 1bb607f2f5c..303a68d9273 100644 --- a/net/irda/irmod.c +++ b/net/irda/irmod.c @@ -55,7 +55,7 @@ EXPORT_SYMBOL(irda_debug); /* Packet type handler. * Tell the kernel how IrDA packets should be handled. */ -static struct packet_type irda_packet_type = { +static struct packet_type irda_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_IRDA), .func = irlap_driver_rcv, /* Packet type handler irlap_frame.c */ }; diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c index a7fe1adc378..ff4c0ab96a6 100644 --- a/net/llc/llc_core.c +++ b/net/llc/llc_core.c @@ -147,12 +147,12 @@ void llc_sap_close(struct llc_sap *sap) kfree(sap); } -static struct packet_type llc_packet_type = { +static struct packet_type llc_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_802_2), .func = llc_rcv, }; -static struct packet_type llc_tr_packet_type = { +static struct packet_type llc_tr_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_TR_802_2), .func = llc_rcv, }; diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index 81795ea8779..a662e62a99c 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c @@ -382,9 +382,8 @@ out: return NET_RX_DROP; } -static struct packet_type phonet_packet_type = { +static struct packet_type phonet_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_PHONET), - .dev = NULL, .func = phonet_rcv, }; diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 8f76f4009c2..1000e9a26fd 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -1608,7 +1608,7 @@ static const struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = { SOCKOPS_WRAP(x25_proto, AF_X25); -static struct packet_type x25_packet_type = { +static struct packet_type x25_packet_type __read_mostly = { .type = cpu_to_be16(ETH_P_X25), .func = x25_lapb_receive_frame, }; -- cgit v1.2.3-70-g09d2 From 03ba999117eb8688252f9068356b6e028c2c3a56 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 27 Mar 2009 00:27:18 -0700 Subject: appletalk: this warning can go I think Its past 2.2 ... Signed-off-by: Alan Cox Signed-off-by: David S. Miller --- net/appletalk/ddp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'net/appletalk/ddp.c') diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 3e0671df3a3..d6a9243641a 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -1571,14 +1571,10 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr usat->sat_family != AF_APPLETALK) return -EINVAL; - /* netatalk doesn't implement this check */ + /* netatalk didn't implement this check */ if (usat->sat_addr.s_node == ATADDR_BCAST && !sock_flag(sk, SOCK_BROADCAST)) { - printk(KERN_INFO "SO_BROADCAST: Fix your netatalk as " - "it will break before 2.2\n"); -#if 0 return -EPERM; -#endif } } else { if (sk->sk_state != TCP_ESTABLISHED) -- cgit v1.2.3-70-g09d2