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

dlm: trivial annotation of be16 value

fs/dlm/dir.c:419:14: warning: incorrect type in assignment (different base types)
fs/dlm/dir.c:419:14: expected unsigned short [unsigned] [addressable] [assigned] [usertype] be_namelen
fs/dlm/dir.c:419:14: got restricted __be16 [usertype] <noident>

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David Teigland <teigland@redhat.com>

authored by

Harvey Harrison and committed by
David Teigland
cd8e4679 d6d7b702

+9 -9
+9 -9
fs/dlm/dir.c
··· 374 374 struct list_head *list; 375 375 struct dlm_rsb *r; 376 376 int offset = 0, dir_nodeid; 377 - uint16_t be_namelen; 377 + __be16 be_namelen; 378 378 379 379 down_read(&ls->ls_root_sem); 380 380 ··· 410 410 411 411 if (offset + sizeof(uint16_t)*2 + r->res_length > outlen) { 412 412 /* Write end-of-block record */ 413 - be_namelen = 0; 414 - memcpy(outbuf + offset, &be_namelen, sizeof(uint16_t)); 415 - offset += sizeof(uint16_t); 413 + be_namelen = cpu_to_be16(0); 414 + memcpy(outbuf + offset, &be_namelen, sizeof(__be16)); 415 + offset += sizeof(__be16); 416 416 goto out; 417 417 } 418 418 419 419 be_namelen = cpu_to_be16(r->res_length); 420 - memcpy(outbuf + offset, &be_namelen, sizeof(uint16_t)); 421 - offset += sizeof(uint16_t); 420 + memcpy(outbuf + offset, &be_namelen, sizeof(__be16)); 421 + offset += sizeof(__be16); 422 422 memcpy(outbuf + offset, r->res_name, r->res_length); 423 423 offset += r->res_length; 424 424 } ··· 430 430 431 431 if ((list == &ls->ls_root_list) && 432 432 (offset + sizeof(uint16_t) <= outlen)) { 433 - be_namelen = 0xFFFF; 434 - memcpy(outbuf + offset, &be_namelen, sizeof(uint16_t)); 435 - offset += sizeof(uint16_t); 433 + be_namelen = cpu_to_be16(0xFFFF); 434 + memcpy(outbuf + offset, &be_namelen, sizeof(__be16)); 435 + offset += sizeof(__be16); 436 436 } 437 437 438 438 out: