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

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>

authored by

Harvey Harrison and committed by
Linus Torvalds
973ea70c c105068f

+4 -8
+1 -1
drivers/char/rocket_int.h
··· 55 55 56 56 static inline void out32(unsigned short port, Byte_t *p) 57 57 { 58 - u32 value = le32_to_cpu(get_unaligned((__le32 *)p)); 58 + u32 value = get_unaligned_le32(p); 59 59 #ifdef ROCKET_DEBUG_IO 60 60 printk(KERN_DEBUG "out32(%x, %lx)...\n", port, value); 61 61 #endif
+3 -7
drivers/char/snsc_event.c
··· 63 63 scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc) 64 64 { 65 65 char *desc_end; 66 - __be32 from_buf; 67 66 68 67 /* record event source address */ 69 - from_buf = get_unaligned((__be32 *)event); 70 - *src = be32_to_cpup(&from_buf); 68 + *src = get_unaligned_be32(event); 71 69 event += 4; /* move on to event code */ 72 70 73 71 /* record the system controller's event code */ 74 - from_buf = get_unaligned((__be32 *)event); 75 - *code = be32_to_cpup(&from_buf); 72 + *code = get_unaligned_be32(event); 76 73 event += 4; /* move on to event arguments */ 77 74 78 75 /* how many arguments are in the packet? */ ··· 83 86 /* not an integer argument, so give up */ 84 87 return -1; 85 88 } 86 - from_buf = get_unaligned((__be32 *)event); 87 - *esp_code = be32_to_cpup(&from_buf); 89 + *esp_code = get_unaligned_be32(event); 88 90 event += 4; 89 91 90 92 /* parse out the event description */