staging/lustre/lnet: changes value to correct type for assignment
PATCH v2 1/1 staging/lustre/lnet: changes value to correct type for assignment
The code attempted to add an unsigned int to a an unsigned 64-bit integer. This patch makes the code use the correct type of int to suppress a smatch warning.
Signed-off-by Lidza Louina <[email protected]>
--- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lnet/lnet/api-ni.c +1 -1
@@ -513,7 +513,7 @@ lnet_res_lh_initialize(struct lnet_res_container *rec, lnet_libhandle_t *lh)unsigned int hash; lh->lh_cookie = rec->rec_lh_cookie; - rec->rec_lh_cookie +=1 << ibits; + rec->rec_lh_cookie += (1ULL << ibits); hash = (lh->lh_cookie >> ibits) &LNET_LH_HASH_MASK ;
Signature · 1 line
1.9.1
PATCH v2 1/1 staging/lustre/lnet: changes value to correct type for assignment
Quoted 3 lines · Lidza Louina
The code attempted to add an unsigned int to a an unsigned 64-bit integer. This patch makes the code use the correct type of int to suppress a smatch warning.
I think you might want to update the commit message too, because it does not really make much sense now.
Quoted 28 lines
Signed-off-by Lidza Louina <[email protected]>---
drivers/staging/lustre/lnet/lnet/api-ni.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lnet/lnet/api-ni.c +1
-1@@ -513,7 +513,7 @@ lnet_res_lh_initialize(struct lnet_res_container *rec, lnet_libhandle_t *lh)unsigned int hash; lh->lh_cookie = rec->rec_lh_cookie; - rec->rec_lh_cookie +=1 << ibits; + rec->rec_lh_cookie += (1ULL << ibits); hash = (lh->lh_cookie >> ibits) &LNET_LH_HASH_MASK ;Signature · 8 lines
1.9.1 _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org