fix network compile warnings
Subsystems (8)
PATCH 1/1 fix network compile warnings
One unused variable warning, and other is failure to check result.
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -1
@@ -854,8 +854,8 @@ struct ipoib_neigh *ipoib_neigh_alloc(stvoid ipoib_neigh_free (struct net_device *dev,struct ipoib_neigh *neigh) { -struct ipoib_dev_priv *priv =netdev_priv (dev);struct sk_buff *skb; + *to_ipoib_neigh (neigh->neighbour) =NULL ;while ((skb =__skb_dequeue (&neigh->queue))) { ++dev->stats.tx_dropped;
drivers/net/cxgb3/cxgb3_main.c +2 -1
@@ -933,7 +933,8 @@ static int offload_open(struct net_devicinit_smt (adapter);/* Never mind if the next step fails */ -sysfs_create_group (&tdev->lldev->dev.kobj, &offload_attr_group); +if (sysfs_create_group (&tdev->lldev->dev.kobj, &offload_attr_group)) +dev_dbg (&tdev->lldev->dev,"sysfs offload attribute create failed\n" );/* Call back all registered clients */ cxgb3_add_clients (tdev);
PATCH 1/1 net: sparse warning fixes
Fix a bunch of sparse warnings. Mostly about 0 used as NULL pointer, and shadowed variable declarations.
The two noteable changes are:
* hash size should have been unsigned
* cls_u32 had a case where error code wasn't been propogated properly, so it could return 0 but still have an error.
--- include/net/inet_hashtables.h | 2 +- include/net/sock.h | 22 +++++++++++----------- net/appletalk/aarp.c | 2 -- net/atm/signaling.c | 2 +- net/core/dev.c | 4 ++-- net/core/pktgen.c | 32 +++++++++++++++----------------- net/core/scm.c | 9 ++++++--- net/ipv4/igmp.c | 5 ++--- net/ipv4/inet_lro.c | 2 +- net/ipv4/ip_sockglue.c | 6 +++--- net/ipv4/proc.c | 2 +- net/ipv4/route.c | 4 ++-- net/ipv4/tcp_input.c | 2 +- net/ipv6/anycast.c | 2 +- net/ipv6/ipv6_sockglue.c | 2 +- net/ipv6/mcast.c | 4 ++-- net/ipv6/ndisc.c | 2 +- net/sched/cls_u32.c | 4 ++-- net/socket.c | 2 +- 19 files changed, 54 insertions(+), 56 deletions(-)
Some of the warnings:net/socket.c:1856:32: warning: cast adds address space to expression (<asn:1>) net/socket.c:1932:11: warning: cast adds address space to expression (<asn:1>) net/socket.c:2273:47: warning: incorrect type in argument 4 (different address spaces)net/socket.c:2273:47: expected char [noderef] <asn:1>*optvalnet/socket.c:2273:47: got char *optvalnet/socket.c:2273:55: warning: incorrect type in argument 5 (different address spaces)net/socket.c:2273:55: expected int [noderef] <asn:1>*optlennet/socket.c:2273:55: got int *optlennet/socket.c:2275:53: warning: incorrect type in argument 4 (different address spaces)net/socket.c:2275:53: expected char [noderef] <asn:1>*optvalnet/socket.c:2275:53: got char *optvalnet/socket.c:2276:10: warning: incorrect type in argument 5 (different address spaces)net/socket.c:2276:10: expected int [noderef] <asn:1>*optlennet/socket.c:2276:10: got int *optlennet/socket.c:2289:47: warning: incorrect type in argument 4 (different address spaces)net/socket.c:2289:47: expected char [noderef] <asn:1>*optvalnet/socket.c:2289:47: got char *optvalnet/socket.c:2291:53: warning: incorrect type in argument 4 (different address spaces)net/socket.c:2291:53: expected char [noderef] <asn:1>*optvalnet/socket.c:2291:53: got char *optvalnet/appletalk/aarp.c:825:23: warning: symbol 'a' shadows an earlier one net/appletalk/aarp.c:715:20: originally declared hereinclude/linux/mm.h:587:9: warning: potentially expensive pointer subtraction net/atm/signaling.c:233:19: warning: symbol 'vcc' shadows an earlier one net/atm/signaling.c:216:39: originally declared herenet/atm/mpc.c:101:20: warning: symbol 'mpcs' was not declared. Should it be static? net/core/sock.c:1349:7: warning: symbol 'rc' shadows an earlier onenet/core/sock.c:1344:6: originally declared herenet/core/sock.c:819:61: warning: incorrect type in argument 3 (different signedness)net/core/sock.c:819:61: expected int *sockaddr_lennet/core/sock.c:819:61: got unsigned int *<noident>net/core/iovec.c:45:31: warning: incorrect type in argument 1 (different address spaces)net/core/iovec.c:45:31: expected void [noderef] <asn:1>*uaddrnet/core/iovec.c:45:31: got void *msg_namenet/core/iovec.c:56:27: warning: incorrect type in argument 2 (different address spaces)net/core/iovec.c:56:27: expected void const [noderef] <asn:1>*fromnet/core/iovec.c:56:27: got struct iovec *msg_iovnet/core/scm.c:170:31: warning: cast adds address space to expression (<asn:1>) net/core/scm.c:193:19: warning: cast removes address space of expression net/core/scm.c:193:19: warning: incorrect type in argument 1 (different address spaces)net/core/scm.c:193:19: expected void [noderef] <asn:1>*tonet/core/scm.c:193:19: got void *<noident>net/core/scm.c:205:31: warning: cast adds address space to expression (<asn:1>) net/core/scm.c:225:33: warning: cast removes address space of expression net/core/scm.c:225:20: warning: cast adds address space to expression (<asn:1>) net/core/dev.c:813:7: warning: incorrect type in argument 1 (different signedness)net/core/dev.c:813:7: expected unsigned long const *addrnet/core/dev.c:813:7: got long *[assigned] inusenet/core/dev.c:1878:29: warning: symbol 'br_fdb_get_hook' was not declared. Should it be static? net/core/dev.c:1880:6: warning: symbol 'br_fdb_put_hook' was not declared. Should it be static? net/core/rtnetlink.c:1073:27: error: bad constant expressionnet/core/net-sysfs.c:452:6: warning: symbol 'netdev_unregister_kobject' was not declared. Should it be static? net/core/net-sysfs.c:461:5: warning: symbol 'netdev_register_kobject' was not declared. Should it be static? net/core/net-sysfs.c:487:5: warning: symbol 'netdev_kobject_init' was not declared. Should it be static? net/core/pktgen.c:1566:15: warning: symbol 'offset' shadows an earlier one net/core/pktgen.c:908:18: originally declared herenet/core/pktgen.c:2749:9: warning: symbol 'tmp' shadows an earlier one net/core/pktgen.c:2733:9: originally declared herenet/core/pktgen.c:2782:9: warning: symbol 'tmp' shadows an earlier one net/core/pktgen.c:2733:9: originally declared herenet/core/pktgen.c:953:17: error: bad constant expressionnet/ipv4/route.c:596:16: warning: Using plain integer as NULL pointer net/ipv4/route.c:2980:7: warning: incorrect type in argument 6 (different signedness)net/ipv4/route.c:2980:7: expected unsigned int *_hash_shiftnet/ipv4/route.c:2980:7: got int static [toplevel] *<noident>net/ipv4/ip_sockglue.c:662:14: warning: Using plain integer as NULL pointer net/ipv4/ip_sockglue.c:819:14: warning: Using plain integer as NULL pointer net/ipv4/ip_sockglue.c:839:14: warning: Using plain integer as NULL pointer net/ipv4/ip_sockglue.c:1121:19: warning: incorrect type in assignment (different address spaces)net/ipv4/ip_sockglue.c:1121:19: expected void *msg_controlnet/ipv4/ip_sockglue.c:1121:19: got char [noderef] <asn:1>*optvalnet/ipv4/tcp.c:2471:7: warning: incorrect type in argument 6 (different signedness)net/ipv4/tcp.c:2471:7: expected unsigned int *_hash_shiftnet/ipv4/tcp.c:2471:7: got int extern [toplevel] *<noident>net/ipv4/tcp_input.c:2703:37: warning: symbol 'icsk' shadows an earlier one net/ipv4/tcp_input.c:2578:36: originally declared herenet/ipv4/igmp.c:1698:20: warning: symbol 'in_dev' shadows an earlier one net/ipv4/igmp.c:1656:43: originally declared herenet/ipv4/igmp.c:2170:22: warning: symbol 'psin' shadows an earlier one net/ipv4/igmp.c:2135:21: originally declared herenet/ipv4/igmp.c:1802:21: warning: Using plain integer as NULL pointer net/ipv4/fib_semantics.c:1071:4: warning: symbol 'nh' shadows an earlier one net/ipv4/fib_semantics.c:1060:17: originally declared herenet/ipv4/fib_semantics.c:1136:3: warning: symbol 'nh' shadows an earlier one net/ipv4/fib_semantics.c:1115:16: originally declared herenet/ipv4/proc.c:147:4: warning: Using plain integer as NULL pointernet/ipv4/ipmr.c:957:10: warning: symbol 'ret' shadows an earlier onenet/ipv4/ipmr.c:872:6: originally declared herenet/ipv4/ipmr.c:144:26: warning: incorrect type in assignment (different address spaces)net/ipv4/ipmr.c:144:26: expected void [noderef] <asn:1>*ifru_datanet/ipv4/ipmr.c:144:26: got void *<noident>net/ipv4/tcp_htcp.c:185:11: warning: symbol '_x' shadows an earlier one net/ipv4/tcp_htcp.c:185:11: originally declared herenet/ipv4/esp4.c:174:10: error: bad constant expressionnet/ipv4/ipcomp.c:53:63: warning: incorrect type in argument 5 (different signedness)net/ipv4/ipcomp.c:53:63: expected unsigned int *dlennet/ipv4/ipcomp.c:53:63: got int *<noident>net/ipv4/ipcomp.c:108:61: warning: incorrect type in argument 5 (different signedness)net/ipv4/ipcomp.c:108:61: expected unsigned int *dlennet/ipv4/ipcomp.c:108:61: got int *<noident>net/ipv4/inet_lro.c:485:10: warning: Using plain integer as NULL pointer net/ipv4/tcp_yeah.c:224:15: warning: symbol '_x' shadows an earlier one net/ipv4/tcp_yeah.c:224:15: originally declared herenet/ipv4/tcp_yeah.c:224:15: warning: symbol '_x' shadows an earlier one net/ipv4/tcp_yeah.c:224:15: originally declared herenet/ipv4/tcp_yeah.c:224:15: warning: symbol '_y' shadows an earlier one net/ipv4/tcp_yeah.c:224:15: originally declared herenet/ipv6/anycast.c:417:17: warning: Using plain integer as NULL pointer net/ipv6/addrconf.c:1891:29: warning: cast adds address space to expression (<asn:1>) net/ipv6/ipv6_sockglue.c:666:14: warning: Using plain integer as NULL pointer net/ipv6/ipv6_sockglue.c:875:19: warning: incorrect type in assignment (different address spaces)net/ipv6/ipv6_sockglue.c:875:19: expected void *msg_controlnet/ipv6/ipv6_sockglue.c:875:19: got char [noderef] <asn:1>*optvalnet/ipv6/ndisc.c:259:53: warning: Using plain integer as NULL pointer net/ipv6/udplite.c:43:14: warning: symbol 'udplitev6_prot' was not declared. Should it be static? net/ipv6/udplite.c:77:13: warning: symbol 'udplitev6_init' was not declared. Should it be static? net/ipv6/mcast.c:2074:20: warning: symbol 'idev' shadows an earlier one net/ipv6/mcast.c:2034:44: originally declared herenet/ipv6/mcast.c:1410:13: warning: Using plain integer as NULL pointer net/ipv6/mcast.c:2147:21: warning: Using plain integer as NULL pointer net/ipv6/esp6.c:168:10: error: bad constant expressionnet/ipv6/ipcomp6.c:94:59: warning: incorrect type in argument 5 (different signedness)net/ipv6/ipcomp6.c:94:59: expected unsigned int *dlennet/ipv6/ipcomp6.c:94:59: got int *<noident>net/ipv6/ipcomp6.c:150:57: warning: incorrect type in argument 5 (different signedness)net/ipv6/ipcomp6.c:150:57: expected unsigned int *dlennet/ipv6/ipcomp6.c:150:57: got int *<noident>net/ipx/af_ipx.c:1553:23: warning: symbol 'uaddr' shadows an earlier one net/ipx/af_ipx.c:1535:61: originally declared herenet/ipx/af_ipx.c:70:5: warning: symbol 'sysctl_ipx_pprop_broadcasting' was not declared. Should it be static? net/netlabel/netlabel_cipso_v4.c:668:21: warning: incorrect type in argument 1 (different signedness)net/netlabel/netlabel_cipso_v4.c:668:21: expected unsigned int [usertype] *skip_cntnet/netlabel/netlabel_cipso_v4.c:668:21: got int *<noident>net/sched/cls_u32.c:505:7: warning: symbol 'err' shadows an earlier one net/sched/cls_u32.c:468:6: originally declared herenet/sched/cls_u32.c:595:27: warning: Using plain integer as NULL pointer
include/net/inet_hashtables.h +1 -1
@@ -107,7 +107,7 @@ struct inet_hashinfo {*/ struct inet_bind_hashbucket *bhash; -int bhash_size; +unsigned int bhash_size;unsigned int ehash_size;/* All sockets in TCP_LISTEN state will be in here. This is the only
include/net/sock.h +11 -11
@@ -485,17 +485,17 @@ static inline void sk_add_backlog(struct skb->next =NULL ; } -#define sk_wait_event (__sk, __timeo, __condition) \ -({ int rc; \ - release_sock(__sk); \ - rc = __condition; \ - if (!rc) { \ - *(__timeo) = schedule_timeout(*(__timeo)); \ - } \ - lock_sock(__sk); \ - rc = __condition; \ - rc; \ -}) +#define sk_wait_event (__sk, __timeo, __condition) \ + ({ int __rc; \ + release_sock(__sk); \ + __rc = __condition; \ + if (!__rc) { \ + *(__timeo) = schedule_timeout(*(__timeo)); \ + } \ + lock_sock(__sk); \ + __rc = __condition; \ + __rc; \ + })extern int sk_stream_wait_connect (struct sock *sk,long *timeo_p);extern int sk_stream_wait_memory (struct sock *sk,long *timeo_p);
net/appletalk/aarp.c +0 -2
@@ -822,8 +822,6 @@ static int aarp_rcv(struct sk_buff *skb,* address. So as a precaution flush any * entries we have for this address. */ -struct aarp_entry *a; - a =__aarp_find_entry (resolved[sa.s_node % (AARP_HASH_SIZE -1 )], skb->dev, &sa);
net/atm/signaling.c +1 -1
@@ -230,7 +230,7 @@ static void sigd_close(struct atm_vcc *vstruct hlist_head *head = &vcc_hash[i];sk_for_each (s, node, head) { -struct atm_vcc *vcc =atm_sk (s); + vcc =atm_sk (s);purge_vcc (vcc); }
net/core/dev.c +2 -2
@@ -780,7 +780,7 @@ static int __dev_alloc_name(struct net *int i =0 ;const char *p;const int max_netdevices =8 *PAGE_SIZE ; -long *inuse; +unsigned long *inuse;struct net_device *d; p =strnchr (name,IFNAMSIZ -1 ,'%' );
@@ -794,7 +794,7 @@ static int __dev_alloc_name(struct net *return -EINVAL ;/* Use one page as a bit array of possible slots */ - inuse = (long *)get_zeroed_page (GFP_ATOMIC ); + inuse = (unsigned long *)get_zeroed_page (GFP_ATOMIC );if (!inuse)return -ENOMEM ;
net/core/pktgen.c +15 -17
@@ -6,7 +6,7 @@* * Alexey Kuznetsov <[email protected]> * Ben Greear <[email protected]> -* Jens Låås <[email protected]> +* Jens Låås <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
@@ -1563,15 +1563,17 @@ static ssize_t pktgen_if_write(struct fi }if (!strcmp (name,"mpls" )) { -unsigned n, offset; +unsigned n, cnt; + len =get_labels (&user_buffer[i], pkt_dev); -if (len <0 ) {return len; } +if (len <0 ) +return len; i += len; - offset =sprintf (pg_result,"OK: mpls=" ); + cnt =sprintf (pg_result,"OK: mpls=" );for (n =0 ; n < pkt_dev->nr_labels; n++) - offset +=sprintf (pg_result + offset, -"%08x%s" ,ntohl (pkt_dev->labels[n]), - n == pkt_dev->nr_labels-1 ?"" :"," ); + cnt +=sprintf (pg_result + cnt, +"%08x%s" ,ntohl (pkt_dev->labels[n]), + n == pkt_dev->nr_labels-1 ?"" :"," );if (pkt_dev->nr_labels && pkt_dev->vlan_id !=0xffff ) { pkt_dev->vlan_id =0xffff ;/* turn off VLAN/SVLAN */
@@ -2731,6 +2733,7 @@ static unsigned int scan_ip6(const charunsigned int prefixlen =0 ;unsigned int suffixlen =0 ;__be32 tmp; +char *pos;for (i =0 ; i <16 ; i++) ip[i] =0 ;
@@ -2745,12 +2748,9 @@ static unsigned int scan_ip6(const char } s++; } - { -char *tmp; - u =simple_strtoul (s, &tmp,16 ); - i = tmp - s; - } + u =simple_strtoul (s, &pos,16 ); + i = pos - s;if (!i)return 0 ;if (prefixlen ==12 && s[i] =='.' ) {
@@ -2778,11 +2778,9 @@ static unsigned int scan_ip6(const char len++; }else if (suffixlen !=0 )break ; - { -char *tmp; - u =simple_strtol (s, &tmp,16 ); - i = tmp - s; - } + + u =simple_strtol (s, &pos,16 ); + i = pos - s;if (!i) {if (*s) len--;
net/core/scm.c +6 -3
@@ -167,7 +167,8 @@ error:int put_cmsg (struct msghdr * msg,int level,int type,int len,void *data) { -struct cmsghdr __user *cm = (struct cmsghdr __user *)msg->msg_control; +struct cmsghdr __user *cm + = (__force struct cmsghdr __user *)msg->msg_control;struct cmsghdr cmhdr;int cmlen =CMSG_LEN (len);int err;
@@ -202,7 +203,8 @@ out:void scm_detach_fds (struct msghdr *msg,struct scm_cookie *scm) { -struct cmsghdr __user *cm = (struct cmsghdr __user *)msg->msg_control; +struct cmsghdr __user *cm + = (__force struct cmsghdr __user *)msg->msg_control;int fdmax =0 ;int fdnum = scm->fp->count;
@@ -222,7 +224,8 @@ void scm_detach_fds(struct msghdr *msg,if (fdnum < fdmax) fdmax = fdnum; -for (i=0 , cmfptr=(int __user *)CMSG_DATA (cm); i<fdmax; i++, cmfptr++) +for (i=0 , cmfptr=(__force int __user *)CMSG_DATA (cm); i<fdmax; + i++, cmfptr++) {int new_fd; err =security_file_receive (fp[i]);
net/ipv4/igmp.c +2 -3
@@ -1695,8 +1695,8 @@ static int ip_mc_add_src(struct in_devic (void )ip_mc_del1_src (pmc, sfmode, &psfsrc[i]); }else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE ] !=0 )) {#ifdef CONFIG_IP_MULTICAST -struct in_device *in_dev = pmc->interface;struct ip_sf_list *psf; + in_dev = pmc->interface;#endif /* filter mode change */
@@ -1799,7 +1799,7 @@ static int ip_mc_leave_src(struct sock * {int err; -if (iml->sflist ==0 ) { +if (iml->sflist ==NULL ) {/* any-source empty exclude case */ return ip_mc_del_src (in_dev, &iml->multi.imr_multiaddr.s_addr, iml->sfmode,0 ,NULL ,0 );
@@ -2167,7 +2167,6 @@ int ip_mc_gsfget(struct sock *sk, structreturn -EFAULT ; }for (i=0 ; i<copycount; i++) { -struct sockaddr_in *psin;struct sockaddr_storage ss; psin = (struct sockaddr_in *)&ss;
net/ipv4/inet_lro.c +1 -1
@@ -482,7 +482,7 @@ static struct sk_buff *__lro_proc_segmenlro_init_desc (lro_desc, skb, iph, tcph,0 ,NULL );LRO_INC_STATS (lro_mgr, aggregated); -return 0 ; +return NULL ; }if (lro_desc->tcp_next_seq !=ntohl (tcph->seq))
net/ipv4/ip_sockglue.c +3 -3
@@ -659,7 +659,7 @@ static int do_ip_setsockopt(struct sockbreak ; } msf =kmalloc (optlen,GFP_KERNEL ); -if (msf ==0 ) { +if (!msf) { err = -ENOBUFS ;break ; }
@@ -816,7 +816,7 @@ static int do_ip_setsockopt(struct sockbreak ; } gsf =kmalloc (optlen,GFP_KERNEL ); -if (gsf ==0 ) { +if (!gsf) { err = -ENOBUFS ;break ; }
@@ -836,7 +836,7 @@ static int do_ip_setsockopt(struct sock } msize =IP_MSFILTER_SIZE (gsf->gf_numsrc); msf =kmalloc (msize,GFP_KERNEL ); -if (msf ==0 ) { +if (!msf) { err = -ENOBUFS ; goto mc_msf_out; }
net/ipv4/proc.c +1 -1
@@ -144,7 +144,7 @@ static struct { { "TimestampReps", ICMP_TIMESTAMPREPLY }, { "AddrMasks", ICMP_ADDRESS }, { "AddrMaskReps", ICMP_ADDRESSREPLY }, - { 0, 0 } + { NULL, 0 } };
net/ipv4/route.c +2 -2
@@ -246,7 +246,7 @@ static spinlock_t *rt_hash_locks;static struct rt_hash_bucket *rt_hash_table;static unsigned rt_hash_mask; -static int rt_hash_log; +static unsigned int rt_hash_log;static unsigned int rt_hash_rnd; static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat);
@@ -593,7 +593,7 @@ static void rt_check_expire(struct work_ i = (i +1 ) & rt_hash_mask; rthp = &rt_hash_table[i].chain; -if (*rthp ==0 ) +if (*rthp ==NULL )continue ;spin_lock_bh (rt_hash_lock_addr (i));while ((rth = *rthp) !=NULL ) {
net/ipv4/tcp_input.c +1 -1
@@ -2700,7 +2700,7 @@ static int tcp_clean_rtx_queue(struct soBUG_TRAP ((int )tp->lost_out >=0 );BUG_TRAP ((int )tp->retrans_out >=0 );if (!tp->packets_out &&tcp_is_sack (tp)) { -const struct inet_connection_sock *icsk =inet_csk (sk); + icsk =inet_csk (sk);if (tp->lost_out) {printk (KERN_DEBUG "Leak l=%u %d\n" , tp->lost_out, icsk->icsk_ca_state);
net/ipv6/anycast.c +1 -1
@@ -414,7 +414,7 @@ static int ipv6_chk_acast_dev(struct netbreak ;read_unlock_bh (&idev->lock);in6_dev_put (idev); -return aca !=0 ; +return aca !=NULL ; }return 0 ; }
net/ipv6/ipv6_sockglue.c +1 -1
@@ -663,7 +663,7 @@ done:break ; } gsf =kmalloc (optlen,GFP_KERNEL ); -if (gsf ==0 ) { +if (!gsf) { retv = -ENOBUFS ;break ; }
net/ipv6/mcast.c +2 -2
@@ -1407,7 +1407,7 @@ static struct sk_buff *mld_newpack(struc/* we assume size > sizeof(ra) here */ skb =sock_alloc_send_skb (sk, size +LL_RESERVED_SPACE (dev),1 , &err); -if (skb ==0 ) +if (!skb)return NULL ;skb_reserve (skb,LL_RESERVED_SPACE (dev));
@@ -2144,7 +2144,7 @@ static int ip6_mc_leave_src(struct sock/* callers have the socket lock and a write lock on ipv6_sk_mc_lock, * so no other readers or writers of iml or its sflist */ -if (iml->sflist ==0 ) { +if (!iml->sflist) {/* any-source empty exclude case */ return ip6_mc_del_src (idev, &iml->addr, iml->sfmode,0 ,NULL ,0 ); }
net/ipv6/ndisc.c +1 -1
@@ -256,7 +256,7 @@ static struct ndisc_options *ndisc_parsebreak ;case ND_OPT_PREFIX_INFO : ndopts->nd_opts_pi_end = nd_opt; -if (ndopts->nd_opt_array[nd_opt->nd_opt_type] ==0 ) +if (!ndopts->nd_opt_array[nd_opt->nd_opt_type]) ndopts->nd_opt_array[nd_opt->nd_opt_type] = nd_opt;break ;#ifdef CONFIG_IPV6_ROUTE_INFO
net/sched/cls_u32.c +2 -2
@@ -502,7 +502,7 @@ static int u32_set_parms(struct tcf_prot#ifdef CONFIG_NET_CLS_IND if (tb[TCA_U32_INDEV -1 ]) { -int err =tcf_change_indev (tp, n->indev, tb[TCA_U32_INDEV -1 ]); + err =tcf_change_indev (tp, n->indev, tb[TCA_U32_INDEV -1 ]);if (err <0 ) goto errout; }
@@ -592,7 +592,7 @@ static int u32_change(struct tcf_proto * }else handle =gen_new_kid (ht, htid); -if (tb[TCA_U32_SEL -1 ] ==0 || +if (tb[TCA_U32_SEL -1 ] ==NULL ||RTA_PAYLOAD (tb[TCA_U32_SEL -1 ]) <sizeof (struct tc_u32_sel ))return -EINVAL ;
net/socket.c +1 -1
@@ -1929,7 +1929,7 @@ asmlinkage long sys_recvmsg(int fd, stru* kernel msghdr to use the kernel address space) */ - uaddr = (void __user *)msg_sys.msg_name; + uaddr = (__force void __user *)msg_sys.msg_name; uaddr_len =COMPAT_NAMELEN (msg);if (MSG_CMSG_COMPAT & flags) { err =verify_compat_iovec (&msg_sys, iov, addr,VERIFY_WRITE );
Re: [PATCH net-2.6.24] net: sparse warning fixes
From: Stephen Hemminger <[email protected]>
Date: Fri, 5 Oct 2007 17:14:07 -0700
Quoted 10 lines
Fix a bunch of sparse warnings. Mostly about 0 used as NULL pointer, and shadowed variable declarations.
The two noteable changes are:
* hash size should have been unsigned
*cls_u32had a case where error code wasn't been propogated properly, so it could return 0 but still have an error.Signed-off-by Stephen Hemminger <[email protected]>
Applied, and I stuffed the cls_u32 fix into net-2.6 as well.
But please fix the following, this is the second time I've had to remove this bit from one of your patches.
net/core/pktgen.c line 12
Quoted 9 lines
net/core/pktgen.c +1
-1@@ -6,7 +6,7 @@* * Alexey Kuznetsov <[email protected]> * Ben Greear <[email protected]> -* Jens Låås <[email protected]> +* Jens Låås <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
Please please please please, for the second time, fix the encoding your editor uses when you save copies of this source file, this hunk of your patches never applies cleanly.
Thanks.
Re: [PATCH net-2.6.24] net: sparse warning fixes
Quoted 19 lines · On Sun, 07 Oct 2007 23:59:56 -0700 (PDT) David Miller <[email protected]>…
From: Stephen Hemminger <[email protected]>
Date: Fri, 5 Oct 2007 17:14:07 -0700Quoted 10 lines
Fix a bunch of sparse warnings. Mostly about 0 used as NULL pointer, and shadowed variable declarations.
The two noteable changes are:
* hash size should have been unsigned
*cls_u32had a case where error code wasn't been propogated properly, so it could return 0 but still have an error.Signed-off-by Stephen Hemminger <[email protected]>Applied, and I stuffed the
cls_u32fix into net-2.6 as well.But please fix the following, this is the second time I've had to remove this bit from one of your patches.
Quoted 14 lines
net/core/pktgen.c line 12
Quoted 9 lines
net/core/pktgen.c +1
-1@@ -6,7 +6,7 @@* * Alexey Kuznetsov <[email protected]> * Ben Greear <[email protected]> -* Jens Låås <[email protected]> +* Jens Låås <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Please please please please, for the second time, fix the encoding your editor uses when you save copies of this source file, this hunk of your patches never applies cleanly.
It's either an Emacs or quilt problem. Probably emacs.
Signature · 1 line
Stephen Hemminger <[email protected]>