X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=utils.h;h=f40e14fc239eb5260844be6926e5af66309650a1;hp=7973b6fb3e3920b3598e02b94c9cf836ca2b391e;hb=HEAD;hpb=8663e9de716248bf72832aee70090f574b3ff5d2 diff --git a/utils.h b/utils.h index 7973b6f..f40e14f 100644 --- a/utils.h +++ b/utils.h @@ -98,10 +98,8 @@ static inline int fls(int x) x <<= 2; r -= 2; } - if (!(x & 0x80000000u)) { - x <<= 1; + if (!(x & 0x80000000u)) r -= 1; - } return r; } #endif @@ -115,7 +113,7 @@ char * format_macaddr(uint8_t *mac); uint32_t crc32_file(FILE *fp); -const char * uci_get_validate_string(const struct uci_blob_param_list *c, int i); +const char * uci_get_validate_string(const struct uci_blob_param_list *p, int i); #ifdef __APPLE__ #define s6_addr32 __u6_addr.__u6_addr32