Skip to content

Commit cd8e467

Browse files
hharrisonteigland
authored andcommitted
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>
1 parent d6d7b70 commit cd8e467

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎fs/dlm/dir.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
374374
struct list_head *list;
375375
struct dlm_rsb *r;
376376
int offset = 0, dir_nodeid;
377-
uint16_t be_namelen;
377+
__be16 be_namelen;
378378

379379
down_read(&ls->ls_root_sem);
380380

@@ -410,15 +410,15 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
410410

411411
if (offset + sizeof(uint16_t)*2 + r->res_length > outlen) {
412412
/* 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);
416416
goto out;
417417
}
418418

419419
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);
422422
memcpy(outbuf + offset, r->res_name, r->res_length);
423423
offset += r->res_length;
424424
}
@@ -430,9 +430,9 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
430430

431431
if ((list == &ls->ls_root_list) &&
432432
(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);
436436
}
437437

438438
out:

0 commit comments

Comments
 (0)