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

[ROSE]: Supress sparse warnings

CHECK net/rose/af_rose.c
net/rose/af_rose.c:125:11: warning: expensive signed divide
net/rose/af_rose.c:976:46: warning: expensive signed divide
net/rose/af_rose.c:1379:13: warning: context imbalance in 'rose_info_start' - wrong count at exit
net/rose/af_rose.c:1406:13: warning: context imbalance in 'rose_info_stop' - unexpected unlock
CHECK net/rose/rose_in.c
net/rose/rose_in.c:185:25: warning: expensive signed divide
CHECK net/rose/rose_route.c
net/rose/rose_route.c:997:46: warning: expensive signed divide
net/rose/rose_route.c:1070:13: warning: context imbalance in 'rose_node_start' - wrong count at exit
net/rose/rose_route.c:1093:13: warning: context imbalance in 'rose_node_stop' - unexpected unlock
net/rose/rose_route.c:1146:13: warning: context imbalance in 'rose_neigh_start' - wrong count at exit
net/rose/rose_route.c:1169:13: warning: context imbalance in 'rose_neigh_stop' - unexpected unlock
net/rose/rose_route.c:1229:13: warning: context imbalance in 'rose_route_start' - wrong count at exit
net/rose/rose_route.c:1252:13: warning: context imbalance in 'rose_route_stop' - unexpected unlock

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
95b7d924 5c17d5f1

+14 -6
+5 -3
net/rose/af_rose.c
··· 116 116 */ 117 117 int rosecmpm(rose_address *addr1, rose_address *addr2, unsigned short mask) 118 118 { 119 - int i, j; 119 + unsigned int i, j; 120 120 121 121 if (mask > 10) 122 122 return 1; ··· 973 973 */ 974 974 memset(&facilities, 0x00, sizeof(struct rose_facilities_struct)); 975 975 976 - len = (((skb->data[3] >> 4) & 0x0F) + 1) / 2; 977 - len += (((skb->data[3] >> 0) & 0x0F) + 1) / 2; 976 + len = (((skb->data[3] >> 4) & 0x0F) + 1) >> 1; 977 + len += (((skb->data[3] >> 0) & 0x0F) + 1) >> 1; 978 978 if (!rose_parse_facilities(skb->data + len + 4, &facilities)) { 979 979 rose_transmit_clear_request(neigh, lci, ROSE_INVALID_FACILITY, 76); 980 980 return 0; ··· 1377 1377 1378 1378 #ifdef CONFIG_PROC_FS 1379 1379 static void *rose_info_start(struct seq_file *seq, loff_t *pos) 1380 + __acquires(rose_list_lock) 1380 1381 { 1381 1382 int i; 1382 1383 struct sock *s; ··· 1405 1404 } 1406 1405 1407 1406 static void rose_info_stop(struct seq_file *seq, void *v) 1407 + __releases(rose_list_lock) 1408 1408 { 1409 1409 spin_unlock_bh(&rose_list_lock); 1410 1410 }
+1 -1
net/rose/rose_in.c
··· 182 182 break; 183 183 } 184 184 if (atomic_read(&sk->sk_rmem_alloc) > 185 - (sk->sk_rcvbuf / 2)) 185 + (sk->sk_rcvbuf >> 1)) 186 186 rose->condition |= ROSE_COND_OWN_RX_BUSY; 187 187 } 188 188 /*
+8 -2
net/rose/rose_route.c
··· 994 994 goto out; 995 995 } 996 996 997 - len = (((skb->data[3] >> 4) & 0x0F) + 1) / 2; 998 - len += (((skb->data[3] >> 0) & 0x0F) + 1) / 2; 997 + len = (((skb->data[3] >> 4) & 0x0F) + 1) >> 1; 998 + len += (((skb->data[3] >> 0) & 0x0F) + 1) >> 1; 999 999 1000 1000 memset(&facilities, 0x00, sizeof(struct rose_facilities_struct)); 1001 1001 ··· 1068 1068 #ifdef CONFIG_PROC_FS 1069 1069 1070 1070 static void *rose_node_start(struct seq_file *seq, loff_t *pos) 1071 + __acquires(rose_neigh_list_lock) 1071 1072 { 1072 1073 struct rose_node *rose_node; 1073 1074 int i = 1; ··· 1092 1091 } 1093 1092 1094 1093 static void rose_node_stop(struct seq_file *seq, void *v) 1094 + __releases(rose_neigh_list_lock) 1095 1095 { 1096 1096 spin_unlock_bh(&rose_neigh_list_lock); 1097 1097 } ··· 1146 1144 }; 1147 1145 1148 1146 static void *rose_neigh_start(struct seq_file *seq, loff_t *pos) 1147 + __acquires(rose_neigh_list_lock) 1149 1148 { 1150 1149 struct rose_neigh *rose_neigh; 1151 1150 int i = 1; ··· 1170 1167 } 1171 1168 1172 1169 static void rose_neigh_stop(struct seq_file *seq, void *v) 1170 + __releases(rose_neigh_list_lock) 1173 1171 { 1174 1172 spin_unlock_bh(&rose_neigh_list_lock); 1175 1173 } ··· 1231 1227 1232 1228 1233 1229 static void *rose_route_start(struct seq_file *seq, loff_t *pos) 1230 + __acquires(rose_route_list_lock) 1234 1231 { 1235 1232 struct rose_route *rose_route; 1236 1233 int i = 1; ··· 1255 1250 } 1256 1251 1257 1252 static void rose_route_stop(struct seq_file *seq, void *v) 1253 + __releases(rose_route_list_lock) 1258 1254 { 1259 1255 spin_unlock_bh(&rose_route_list_lock); 1260 1256 }