diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-11-14 01:41:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-14 01:41:29 -0500 |
commit | 00bcd522ea0a62f5e2a9c6ad4924cbbd8d05b026 (patch) | |
tree | ce16dea6960f9d745120941c6bd32b3ca5abe769 /drivers/isdn/i4l/isdn_net.h | |
parent | 524ad0a79126efabf58d0a49eace6155ab5b4549 (diff) |
isdn: use %pI4, remove get_{u8/u16/u32} and put_{u8/u16/u32} inlines
They would have been better named as get_be16, put_be16, etc.
as they were hiding an endian shift inside.
They don't add much over explicitly coding the byteshifting
and gcc sometimes has a problem with builtin_constant_p inside
inline functions, so it may do a better job of byteswapping
at compile time rather than runtime.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/i4l/isdn_net.h')
-rw-r--r-- | drivers/isdn/i4l/isdn_net.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/drivers/isdn/i4l/isdn_net.h b/drivers/isdn/i4l/isdn_net.h index be4949715d55..2a6c370ea87f 100644 --- a/drivers/isdn/i4l/isdn_net.h +++ b/drivers/isdn/i4l/isdn_net.h | |||
@@ -145,46 +145,3 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp) | |||
145 | spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags); | 145 | spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags); |
146 | } | 146 | } |
147 | 147 | ||
148 | static inline int | ||
149 | put_u8(unsigned char *p, u8 x) | ||
150 | { | ||
151 | *p = x; | ||
152 | return 1; | ||
153 | } | ||
154 | |||
155 | static inline int | ||
156 | put_u16(unsigned char *p, u16 x) | ||
157 | { | ||
158 | *((u16 *)p) = htons(x); | ||
159 | return 2; | ||
160 | } | ||
161 | |||
162 | static inline int | ||
163 | put_u32(unsigned char *p, u32 x) | ||
164 | { | ||
165 | *((u32 *)p) = htonl(x); | ||
166 | return 4; | ||
167 | } | ||
168 | |||
169 | static inline int | ||
170 | get_u8(unsigned char *p, u8 *x) | ||
171 | { | ||
172 | *x = *p; | ||
173 | return 1; | ||
174 | } | ||
175 | |||
176 | static inline int | ||
177 | get_u16(unsigned char *p, u16 *x) | ||
178 | { | ||
179 | *x = ntohs(*((u16 *)p)); | ||
180 | return 2; | ||
181 | } | ||
182 | |||
183 | static inline int | ||
184 | get_u32(unsigned char *p, u32 *x) | ||
185 | { | ||
186 | *x = ntohl(*((u32 *)p)); | ||
187 | return 4; | ||
188 | } | ||
189 | |||
190 | |||