X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fulnds%2Fsocklnd%2Ftable.c;h=986c5ce83fb3daf080c930ab8f25a259ca93fba9;hp=eb390c42a36dbe5abbcb8979f4e8faa00cab220a;hb=ebd160a59b75af068bd502e27ae61002ff2c635b;hpb=17717b8742e2c16505296c310eefd531203d9311 diff --git a/lnet/ulnds/socklnd/table.c b/lnet/ulnds/socklnd/table.c index eb390c4..986c5ce 100644 --- a/lnet/ulnds/socklnd/table.c +++ b/lnet/ulnds/socklnd/table.c @@ -93,11 +93,14 @@ unsigned int key_from_int(int i) */ unsigned int key_from_string(char *s) { - unsigned int result=0; + unsigned int result=0, i; unsigned char *n; - int i; - if (!s) return(1); - for (n=s,i=0;*n;n++,i++) result^=(*n*57)^*n*i; + + if (!s) + return(1); + for (n = (unsigned char *)s, i = 0; *n; n++, i++) + result ^= (*n * 57) ^ *n * i; + return(result); }