diff options
author | Tony Luck <tony.luck@intel.com> | 2005-08-29 21:13:49 (GMT) |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-08-29 21:13:49 (GMT) |
commit | 95ecc5e5a3b20a3c76164d089c69051662e9d9b3 (patch) | |
tree | c0850c88d511210e52757320af633481dc02f222 | |
parent | 87dbaaabde5ce141ac4f8d726e6d3c937209e0a5 (diff) | |
parent | 1a402aaca51b7d56e62348f50a426c531b6bc29e (diff) | |
download | linux-fsl-qoriq-95ecc5e5a3b20a3c76164d089c69051662e9d9b3.tar.xz |
Pull unaligned-snsc_event into release branch
-rw-r--r-- | drivers/char/snsc_event.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c index d692af5..baaa365 100644 --- a/drivers/char/snsc_event.c +++ b/drivers/char/snsc_event.c @@ -19,6 +19,7 @@ #include <linux/sched.h> #include <linux/byteorder/generic.h> #include <asm/sn/sn_sal.h> +#include <asm/unaligned.h> #include "snsc.h" static struct subch_data_s *event_sd; @@ -62,13 +63,16 @@ static int scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc) { char *desc_end; + __be32 from_buf; /* record event source address */ - *src = be32_to_cpup((__be32 *)event); + from_buf = get_unaligned((__be32 *)event); + *src = be32_to_cpup(&from_buf); event += 4; /* move on to event code */ /* record the system controller's event code */ - *code = be32_to_cpup((__be32 *)event); + from_buf = get_unaligned((__be32 *)event); + *code = be32_to_cpup(&from_buf); event += 4; /* move on to event arguments */ /* how many arguments are in the packet? */ @@ -82,7 +86,8 @@ scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc) /* not an integer argument, so give up */ return -1; } - *esp_code = be32_to_cpup((__be32 *)event); + from_buf = get_unaligned((__be32 *)event); + *esp_code = be32_to_cpup(&from_buf); event += 4; /* parse out the event description */ |