Skip to content

Commit 97a4feb

Browse files
hharrisontorvalds
authored andcommitted
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>
1 parent 58d485d commit 97a4feb

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

‎fs/ncpfs/ncplib_kernel.c‎

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,48 +102,47 @@ static inline void ncp_init_request_s(struct ncp_server *server, int subfunction
102102
}
103103

104104
static inline char *
105-
ncp_reply_data(struct ncp_server *server, int offset)
105+
ncp_reply_data(struct ncp_server *server, int offset)
106106
{
107107
return &(server->packet[sizeof(struct ncp_reply_header) + offset]);
108108
}
109109

110-
static inline __u8 BVAL(void* data)
110+
static inline u8 BVAL(void *data)
111111
{
112-
return get_unaligned((__u8*)data);
112+
return *(u8 *)data;
113113
}
114114

115-
static __u8
116-
ncp_reply_byte(struct ncp_server *server, int offset)
115+
static u8 ncp_reply_byte(struct ncp_server *server, int offset)
117116
{
118-
return get_unaligned((__u8 *) ncp_reply_data(server, offset));
117+
return *(u8 *)ncp_reply_data(server, offset);
119118
}
120119

121-
static inline __u16 WVAL_LH(void* data)
120+
static inline u16 WVAL_LH(void *data)
122121
{
123-
return le16_to_cpu(get_unaligned((__le16*)data));
122+
return get_unaligned_le16(data);
124123
}
125124

126-
static __u16
127-
ncp_reply_le16(struct ncp_server *server, int offset)
125+
static u16
126+
ncp_reply_le16(struct ncp_server *server, int offset)
128127
{
129-
return le16_to_cpu(get_unaligned((__le16 *) ncp_reply_data(server, offset)));
128+
return get_unaligned_le16(ncp_reply_data(server, offset));
130129
}
131130

132-
static __u16
133-
ncp_reply_be16(struct ncp_server *server, int offset)
131+
static u16
132+
ncp_reply_be16(struct ncp_server *server, int offset)
134133
{
135-
return be16_to_cpu(get_unaligned((__be16 *) ncp_reply_data(server, offset)));
134+
return get_unaligned_be16(ncp_reply_data(server, offset));
136135
}
137136

138-
static inline __u32 DVAL_LH(void* data)
137+
static inline u32 DVAL_LH(void *data)
139138
{
140-
return le32_to_cpu(get_unaligned((__le32*)data));
139+
return get_unaligned_le32(data);
141140
}
142141

143142
static __le32
144-
ncp_reply_dword(struct ncp_server *server, int offset)
143+
ncp_reply_dword(struct ncp_server *server, int offset)
145144
{
146-
return get_unaligned((__le32 *) ncp_reply_data(server, offset));
145+
return get_unaligned((__le32 *)ncp_reply_data(server, offset));
147146
}
148147

149148
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,
10061005
result = ncp_request2(server, 72, bounce, bufsize);
10071006
ncp_unlock_server(server);
10081007
if (!result) {
1009-
int len = be16_to_cpu(get_unaligned((__be16*)((char*)bounce +
1010-
sizeof(struct ncp_reply_header))));
1008+
int len = get_unaligned_be16((char *)bounce +
1009+
sizeof(struct ncp_reply_header));
10111010
result = -EIO;
10121011
if (len <= to_read) {
10131012
char* source;

0 commit comments

Comments
 (0)