diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-04-29 04:03:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:27 -0400 |
commit | 973ea70c7c9be50d5ac34ff82a1c48fbe8fb2efb (patch) | |
tree | 247e411de49b0ec7301e7715e29d27ad741c3590 /drivers/char/snsc_event.c | |
parent | c105068f2b35343eecf2bf16ee29a362b6121fa3 (diff) |
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>
Diffstat (limited to 'drivers/char/snsc_event.c')
-rw-r--r-- | drivers/char/snsc_event.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c index 1b75b0b7d542..31a7765eaf73 100644 --- a/drivers/char/snsc_event.c +++ b/drivers/char/snsc_event.c | |||
@@ -63,16 +63,13 @@ static int | |||
63 | scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc) | 63 | scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc) |
64 | { | 64 | { |
65 | char *desc_end; | 65 | char *desc_end; |
66 | __be32 from_buf; | ||
67 | 66 | ||
68 | /* record event source address */ | 67 | /* record event source address */ |
69 | from_buf = get_unaligned((__be32 *)event); | 68 | *src = get_unaligned_be32(event); |
70 | *src = be32_to_cpup(&from_buf); | ||
71 | event += 4; /* move on to event code */ | 69 | event += 4; /* move on to event code */ |
72 | 70 | ||
73 | /* record the system controller's event code */ | 71 | /* record the system controller's event code */ |
74 | from_buf = get_unaligned((__be32 *)event); | 72 | *code = get_unaligned_be32(event); |
75 | *code = be32_to_cpup(&from_buf); | ||
76 | event += 4; /* move on to event arguments */ | 73 | event += 4; /* move on to event arguments */ |
77 | 74 | ||
78 | /* how many arguments are in the packet? */ | 75 | /* 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) | |||
86 | /* not an integer argument, so give up */ | 83 | /* not an integer argument, so give up */ |
87 | return -1; | 84 | return -1; |
88 | } | 85 | } |
89 | from_buf = get_unaligned((__be32 *)event); | 86 | *esp_code = get_unaligned_be32(event); |
90 | *esp_code = be32_to_cpup(&from_buf); | ||
91 | event += 4; | 87 | event += 4; |
92 | 88 | ||
93 | /* parse out the event description */ | 89 | /* parse out the event description */ |