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

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>

authored by

Harvey Harrison and committed by
Linus Torvalds
97a4feb4 58d485d4

+19 -20
+19 -20
fs/ncpfs/ncplib_kernel.c
··· 102 102 } 103 103 104 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 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 116 - ncp_reply_byte(struct ncp_server *server, int offset) 115 + static u8 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 127 - ncp_reply_le16(struct ncp_server *server, int offset) 125 + static u16 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 133 - ncp_reply_be16(struct ncp_server *server, int offset) 131 + static u16 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 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 148 static inline __u32 ncp_reply_dword_lh(struct ncp_server* server, int offset) { ··· 1005 1006 result = ncp_request2(server, 72, bounce, bufsize); 1006 1007 ncp_unlock_server(server); 1007 1008 if (!result) { 1008 - int len = be16_to_cpu(get_unaligned((__be16*)((char*)bounce + 1009 - sizeof(struct ncp_reply_header)))); 1009 + int len = get_unaligned_be16((char *)bounce + 1010 + sizeof(struct ncp_reply_header)); 1010 1011 result = -EIO; 1011 1012 if (len <= to_read) { 1012 1013 char* source;