diff options
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 6c4ae27f2..9c3640be7 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -306,7 +306,6 @@ static int count_netmask_bits(const char *dotted_quad) | |||
306 | // d = ~d; /* 11110000 -> 00001111 */ | 306 | // d = ~d; /* 11110000 -> 00001111 */ |
307 | 307 | ||
308 | /* Shorter version */ | 308 | /* Shorter version */ |
309 | int result; | ||
310 | struct in_addr ip; | 309 | struct in_addr ip; |
311 | unsigned d; | 310 | unsigned d; |
312 | 311 | ||
@@ -316,12 +315,7 @@ static int count_netmask_bits(const char *dotted_quad) | |||
316 | d = ~d; /* 11110000 -> 00001111 */ | 315 | d = ~d; /* 11110000 -> 00001111 */ |
317 | if (d & (d+1)) /* check that it is in 00001111 form */ | 316 | if (d & (d+1)) /* check that it is in 00001111 form */ |
318 | return -1; /* no it is not */ | 317 | return -1; /* no it is not */ |
319 | result = 32; | 318 | return bb_popcnt_32(~d); |
320 | while (d) { | ||
321 | d >>= 1; | ||
322 | result--; | ||
323 | } | ||
324 | return result; | ||
325 | } | 319 | } |
326 | # endif | 320 | # endif |
327 | 321 | ||