diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-04-29 04:03:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:28 -0400 |
commit | 97a4feb4a78ae5cd130be7d546471a0779f1aa14 (patch) | |
tree | b8d5c73a281cf101e79bd94007b60e9724daff2f /fs/ncpfs/ncplib_kernel.c | |
parent | 58d485d481013b47f50b7cd2cf9eab7795a0fcbd (diff) |
ncpfs: use get/put_unaligned_* helpers
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ncpfs/ncplib_kernel.c')
-rw-r--r-- | fs/ncpfs/ncplib_kernel.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c index df6d60bdfcd3..97645f112114 100644 --- a/fs/ncpfs/ncplib_kernel.c +++ b/fs/ncpfs/ncplib_kernel.c | |||
@@ -102,48 +102,47 @@ static inline void ncp_init_request_s(struct ncp_server *server, int subfunction | |||
102 | } | 102 | } |
103 | 103 | ||
104 | static inline char * | 104 | static inline char * |
105 | ncp_reply_data(struct ncp_server *server, int offset) | 105 | ncp_reply_data(struct ncp_server *server, int offset) |
106 | { | 106 | { |
107 | return &(server->packet[sizeof(struct ncp_reply_header) + offset]); | 107 | return &(server->packet[sizeof(struct ncp_reply_header) + offset]); |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline __u8 BVAL(void* data) | 110 | static inline u8 BVAL(void *data) |
111 | { | 111 | { |
112 | return get_unaligned((__u8*)data); | 112 | return *(u8 *)data; |
113 | } | 113 | } |
114 | 114 | ||
115 | static __u8 | 115 | static u8 ncp_reply_byte(struct ncp_server *server, int offset) |
116 | ncp_reply_byte(struct ncp_server *server, int offset) | ||
117 | { | 116 | { |
118 | return get_unaligned((__u8 *) ncp_reply_data(server, offset)); | 117 | return *(u8 *)ncp_reply_data(server, offset); |
119 | } | 118 | } |
120 | 119 | ||
121 | static inline __u16 WVAL_LH(void* data) | 120 | static inline u16 WVAL_LH(void *data) |
122 | { | 121 | { |
123 | return le16_to_cpu(get_unaligned((__le16*)data)); | 122 | return get_unaligned_le16(data); |
124 | } | 123 | } |
125 | 124 | ||
126 | static __u16 | 125 | static u16 |
127 | ncp_reply_le16(struct ncp_server *server, int offset) | 126 | ncp_reply_le16(struct ncp_server *server, int offset) |
128 | { | 127 | { |
129 | return le16_to_cpu(get_unaligned((__le16 *) ncp_reply_data(server, offset))); | 128 | return get_unaligned_le16(ncp_reply_data(server, offset)); |
130 | } | 129 | } |
131 | 130 | ||
132 | static __u16 | 131 | static u16 |
133 | ncp_reply_be16(struct ncp_server *server, int offset) | 132 | ncp_reply_be16(struct ncp_server *server, int offset) |
134 | { | 133 | { |
135 | return be16_to_cpu(get_unaligned((__be16 *) ncp_reply_data(server, offset))); | 134 | return get_unaligned_be16(ncp_reply_data(server, offset)); |
136 | } | 135 | } |
137 | 136 | ||
138 | static inline __u32 DVAL_LH(void* data) | 137 | static inline u32 DVAL_LH(void *data) |
139 | { | 138 | { |
140 | return le32_to_cpu(get_unaligned((__le32*)data)); | 139 | return get_unaligned_le32(data); |
141 | } | 140 | } |
142 | 141 | ||
143 | static __le32 | 142 | static __le32 |
144 | ncp_reply_dword(struct ncp_server *server, int offset) | 143 | ncp_reply_dword(struct ncp_server *server, int offset) |
145 | { | 144 | { |
146 | return get_unaligned((__le32 *) ncp_reply_data(server, offset)); | 145 | return get_unaligned((__le32 *)ncp_reply_data(server, offset)); |
147 | } | 146 | } |
148 | 147 | ||
149 | static inline __u32 ncp_reply_dword_lh(struct ncp_server* server, int offset) { | 148 | static inline __u32 ncp_reply_dword_lh(struct ncp_server* server, int offset) { |
@@ -1006,8 +1005,8 @@ ncp_read_bounce(struct ncp_server *server, const char *file_id, | |||
1006 | result = ncp_request2(server, 72, bounce, bufsize); | 1005 | result = ncp_request2(server, 72, bounce, bufsize); |
1007 | ncp_unlock_server(server); | 1006 | ncp_unlock_server(server); |
1008 | if (!result) { | 1007 | if (!result) { |
1009 | int len = be16_to_cpu(get_unaligned((__be16*)((char*)bounce + | 1008 | int len = get_unaligned_be16((char *)bounce + |
1010 | sizeof(struct ncp_reply_header)))); | 1009 | sizeof(struct ncp_reply_header)); |
1011 | result = -EIO; | 1010 | result = -EIO; |
1012 | if (len <= to_read) { | 1011 | if (len <= to_read) { |
1013 | char* source; | 1012 | char* source; |