diff options
Diffstat (limited to 'drivers/video/metronomefb.c')
-rw-r--r-- | drivers/video/metronomefb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c index 249791286367..cc4c038a1b3f 100644 --- a/drivers/video/metronomefb.c +++ b/drivers/video/metronomefb.c | |||
@@ -206,8 +206,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t, | |||
206 | } | 206 | } |
207 | 207 | ||
208 | /* check waveform mode table address checksum */ | 208 | /* check waveform mode table address checksum */ |
209 | wmta = le32_to_cpu(get_unaligned((__le32 *) wfm_hdr->wmta)); | 209 | wmta = get_unaligned_le32(wfm_hdr->wmta) & 0x00FFFFFF; |
210 | wmta &= 0x00FFFFFF; | ||
211 | cksum_idx = wmta + m*4 + 3; | 210 | cksum_idx = wmta + m*4 + 3; |
212 | if (cksum_idx > size) | 211 | if (cksum_idx > size) |
213 | return -EINVAL; | 212 | return -EINVAL; |
@@ -219,8 +218,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t, | |||
219 | } | 218 | } |
220 | 219 | ||
221 | /* check waveform temperature table address checksum */ | 220 | /* check waveform temperature table address checksum */ |
222 | tta = le32_to_cpu(get_unaligned((int *) (mem + wmta + m*4))); | 221 | tta = get_unaligned_le32(mem + wmta + m * 4) & 0x00FFFFFF; |
223 | tta &= 0x00FFFFFF; | ||
224 | cksum_idx = tta + trn*4 + 3; | 222 | cksum_idx = tta + trn*4 + 3; |
225 | if (cksum_idx > size) | 223 | if (cksum_idx > size) |
226 | return -EINVAL; | 224 | return -EINVAL; |
@@ -233,8 +231,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t, | |||
233 | 231 | ||
234 | /* here we do the real work of putting the waveform into the | 232 | /* here we do the real work of putting the waveform into the |
235 | metromem buffer. this does runlength decoding of the waveform */ | 233 | metromem buffer. this does runlength decoding of the waveform */ |
236 | wfm_idx = le32_to_cpu(get_unaligned((__le32 *) (mem + tta + trn*4))); | 234 | wfm_idx = get_unaligned_le32(mem + tta + trn * 4) & 0x00FFFFFF; |
237 | wfm_idx &= 0x00FFFFFF; | ||
238 | owfm_idx = wfm_idx; | 235 | owfm_idx = wfm_idx; |
239 | if (wfm_idx > size) | 236 | if (wfm_idx > size) |
240 | return -EINVAL; | 237 | return -EINVAL; |