diff options
Diffstat (limited to 'drivers/memstick')
-rw-r--r-- | drivers/memstick/core/mspro_block.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index 1f1e3982b1aa..de143deb06f0 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c | |||
@@ -52,14 +52,14 @@ struct mspro_sys_attr { | |||
52 | }; | 52 | }; |
53 | 53 | ||
54 | struct mspro_attr_entry { | 54 | struct mspro_attr_entry { |
55 | unsigned int address; | 55 | __be32 address; |
56 | unsigned int size; | 56 | __be32 size; |
57 | unsigned char id; | 57 | unsigned char id; |
58 | unsigned char reserved[3]; | 58 | unsigned char reserved[3]; |
59 | } __attribute__((packed)); | 59 | } __attribute__((packed)); |
60 | 60 | ||
61 | struct mspro_attribute { | 61 | struct mspro_attribute { |
62 | unsigned short signature; | 62 | __be16 signature; |
63 | unsigned short version; | 63 | unsigned short version; |
64 | unsigned char count; | 64 | unsigned char count; |
65 | unsigned char reserved[11]; | 65 | unsigned char reserved[11]; |
@@ -69,28 +69,28 @@ struct mspro_attribute { | |||
69 | struct mspro_sys_info { | 69 | struct mspro_sys_info { |
70 | unsigned char class; | 70 | unsigned char class; |
71 | unsigned char reserved0; | 71 | unsigned char reserved0; |
72 | unsigned short block_size; | 72 | __be16 block_size; |
73 | unsigned short block_count; | 73 | __be16 block_count; |
74 | unsigned short user_block_count; | 74 | __be16 user_block_count; |
75 | unsigned short page_size; | 75 | __be16 page_size; |
76 | unsigned char reserved1[2]; | 76 | unsigned char reserved1[2]; |
77 | unsigned char assembly_date[8]; | 77 | unsigned char assembly_date[8]; |
78 | unsigned int serial_number; | 78 | __be32 serial_number; |
79 | unsigned char assembly_maker_code; | 79 | unsigned char assembly_maker_code; |
80 | unsigned char assembly_model_code[3]; | 80 | unsigned char assembly_model_code[3]; |
81 | unsigned short memory_maker_code; | 81 | __be16 memory_maker_code; |
82 | unsigned short memory_model_code; | 82 | __be16 memory_model_code; |
83 | unsigned char reserved2[4]; | 83 | unsigned char reserved2[4]; |
84 | unsigned char vcc; | 84 | unsigned char vcc; |
85 | unsigned char vpp; | 85 | unsigned char vpp; |
86 | unsigned short controller_number; | 86 | __be16 controller_number; |
87 | unsigned short controller_function; | 87 | __be16 controller_function; |
88 | unsigned short start_sector; | 88 | __be16 start_sector; |
89 | unsigned short unit_size; | 89 | __be16 unit_size; |
90 | unsigned char ms_sub_class; | 90 | unsigned char ms_sub_class; |
91 | unsigned char reserved3[4]; | 91 | unsigned char reserved3[4]; |
92 | unsigned char interface_type; | 92 | unsigned char interface_type; |
93 | unsigned short controller_code; | 93 | __be16 controller_code; |
94 | unsigned char format_type; | 94 | unsigned char format_type; |
95 | unsigned char reserved4; | 95 | unsigned char reserved4; |
96 | unsigned char device_type; | 96 | unsigned char device_type; |
@@ -124,11 +124,11 @@ struct mspro_specfile { | |||
124 | } __attribute__((packed)); | 124 | } __attribute__((packed)); |
125 | 125 | ||
126 | struct mspro_devinfo { | 126 | struct mspro_devinfo { |
127 | unsigned short cylinders; | 127 | __be16 cylinders; |
128 | unsigned short heads; | 128 | __be16 heads; |
129 | unsigned short bytes_per_track; | 129 | __be16 bytes_per_track; |
130 | unsigned short bytes_per_sector; | 130 | __be16 bytes_per_sector; |
131 | unsigned short sectors_per_track; | 131 | __be16 sectors_per_track; |
132 | unsigned char reserved[6]; | 132 | unsigned char reserved[6]; |
133 | } __attribute__((packed)); | 133 | } __attribute__((packed)); |
134 | 134 | ||
@@ -338,8 +338,7 @@ static ssize_t mspro_block_attr_show_sysinfo(struct device *dev, | |||
338 | rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "assembly date: " | 338 | rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "assembly date: " |
339 | "GMT%+d:%d %04u-%02u-%02u %02u:%02u:%02u\n", | 339 | "GMT%+d:%d %04u-%02u-%02u %02u:%02u:%02u\n", |
340 | date_tz, date_tz_f, | 340 | date_tz, date_tz_f, |
341 | be16_to_cpu(*(unsigned short *) | 341 | be16_to_cpup((__be16 *)&x_sys->assembly_date[1]), |
342 | &x_sys->assembly_date[1]), | ||
343 | x_sys->assembly_date[3], x_sys->assembly_date[4], | 342 | x_sys->assembly_date[3], x_sys->assembly_date[4], |
344 | x_sys->assembly_date[5], x_sys->assembly_date[6], | 343 | x_sys->assembly_date[5], x_sys->assembly_date[6], |
345 | x_sys->assembly_date[7]); | 344 | x_sys->assembly_date[7]); |