char: use get_unaligned_* helpers
Remove unnecessary temp variable from_buf in snsc_event.c Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Jiri Slaby <jirislaby@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>
This commit is contained in:
committed by
Linus Torvalds
parent
c105068f2b
commit
973ea70c7c
@@ -55,7 +55,7 @@ static inline void sOutW(unsigned short port, unsigned short value)
|
|||||||
|
|
||||||
static inline void out32(unsigned short port, Byte_t *p)
|
static inline void out32(unsigned short port, Byte_t *p)
|
||||||
{
|
{
|
||||||
u32 value = le32_to_cpu(get_unaligned((__le32 *)p));
|
u32 value = get_unaligned_le32(p);
|
||||||
#ifdef ROCKET_DEBUG_IO
|
#ifdef ROCKET_DEBUG_IO
|
||||||
printk(KERN_DEBUG "out32(%x, %lx)...\n", port, value);
|
printk(KERN_DEBUG "out32(%x, %lx)...\n", port, value);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -63,16 +63,13 @@ static int
|
|||||||
scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc)
|
scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc)
|
||||||
{
|
{
|
||||||
char *desc_end;
|
char *desc_end;
|
||||||
__be32 from_buf;
|
|
||||||
|
|
||||||
/* record event source address */
|
/* record event source address */
|
||||||
from_buf = get_unaligned((__be32 *)event);
|
*src = get_unaligned_be32(event);
|
||||||
*src = be32_to_cpup(&from_buf);
|
|
||||||
event += 4; /* move on to event code */
|
event += 4; /* move on to event code */
|
||||||
|
|
||||||
/* record the system controller's event code */
|
/* record the system controller's event code */
|
||||||
from_buf = get_unaligned((__be32 *)event);
|
*code = get_unaligned_be32(event);
|
||||||
*code = be32_to_cpup(&from_buf);
|
|
||||||
event += 4; /* move on to event arguments */
|
event += 4; /* move on to event arguments */
|
||||||
|
|
||||||
/* how many arguments are in the packet? */
|
/* how many arguments are in the packet? */
|
||||||
@@ -86,8 +83,7 @@ scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc)
|
|||||||
/* not an integer argument, so give up */
|
/* not an integer argument, so give up */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
from_buf = get_unaligned((__be32 *)event);
|
*esp_code = get_unaligned_be32(event);
|
||||||
*esp_code = be32_to_cpup(&from_buf);
|
|
||||||
event += 4;
|
event += 4;
|
||||||
|
|
||||||
/* parse out the event description */
|
/* parse out the event description */
|
||||||
|
Reference in New Issue
Block a user