1 From: Harvey Harrison <harvey.harrison@gmail.com>
2 commit cd8e4679bdcf9b54564f2cda2389bd0f0457e12d
3 Author: Harvey Harrison <harvey.harrison@gmail.com>
4 Date: Wed Nov 12 16:28:43 2008 -0600
5 Subject: dlm: trivial annotation of be16 value
7 fs/dlm/dir.c:419:14: warning: incorrect type in assignment (different base types)
8 fs/dlm/dir.c:419:14: expected unsigned short [unsigned] [addressable] [assigned] [usertype] be_namelen
9 fs/dlm/dir.c:419:14: got restricted __be16 [usertype] <noident>
11 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
12 Signed-off-by: David Teigland <teigland@redhat.com>
13 Signed-off-by: Coly Li <coly.li@suse.de>
15 diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c
16 index 85defeb..92969f8 100644
19 @@ -374,7 +374,7 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
20 struct list_head *list;
22 int offset = 0, dir_nodeid;
23 - uint16_t be_namelen;
26 down_read(&ls->ls_root_sem);
28 @@ -410,15 +410,15 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
30 if (offset + sizeof(uint16_t)*2 + r->res_length > outlen) {
31 /* Write end-of-block record */
33 - memcpy(outbuf + offset, &be_namelen, sizeof(uint16_t));
34 - offset += sizeof(uint16_t);
35 + be_namelen = cpu_to_be16(0);
36 + memcpy(outbuf + offset, &be_namelen, sizeof(__be16));
37 + offset += sizeof(__be16);
41 be_namelen = cpu_to_be16(r->res_length);
42 - memcpy(outbuf + offset, &be_namelen, sizeof(uint16_t));
43 - offset += sizeof(uint16_t);
44 + memcpy(outbuf + offset, &be_namelen, sizeof(__be16));
45 + offset += sizeof(__be16);
46 memcpy(outbuf + offset, r->res_name, r->res_length);
47 offset += r->res_length;
49 @@ -430,9 +430,9 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
51 if ((list == &ls->ls_root_list) &&
52 (offset + sizeof(uint16_t) <= outlen)) {
53 - be_namelen = 0xFFFF;
54 - memcpy(outbuf + offset, &be_namelen, sizeof(uint16_t));
55 - offset += sizeof(uint16_t);
56 + be_namelen = cpu_to_be16(0xFFFF);
57 + memcpy(outbuf + offset, &be_namelen, sizeof(__be16));
58 + offset += sizeof(__be16);