aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-07-24 16:53:33 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:33 -0400
commitcd740ab0f69f6c94d9c7f916758e308f30a439fa (patch)
tree29e9d566e573b404d8087c57faafbb0691cffde7 /drivers/ide
parenta326b02b0c576001353dbc489154959b0889c6bf (diff)
ide: ide-tape.c sparse annotations and unaligned access removal
If this is actually unaligned the access of speed/max_speed above is already broken and needs a get_unaligned. Otherwise it is aligned and they can be removed. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-tape.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 789f3428f072..82c2afe4d28a 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -655,10 +655,10 @@ static void ide_tape_callback(ide_drive_t *drive)
655 uptodate = 0; 655 uptodate = 0;
656 } else { 656 } else {
657 debug_log(DBG_SENSE, "Block Location - %u\n", 657 debug_log(DBG_SENSE, "Block Location - %u\n",
658 be32_to_cpu(*(u32 *)&readpos[4])); 658 be32_to_cpup((__be32 *)&readpos[4]));
659 659
660 tape->partition = readpos[1]; 660 tape->partition = readpos[1];
661 tape->first_frame = be32_to_cpu(*(u32 *)&readpos[4]); 661 tape->first_frame = be32_to_cpup((__be32 *)&readpos[4]);
662 set_bit(IDE_AFLAG_ADDRESS_VALID, &drive->atapi_flags); 662 set_bit(IDE_AFLAG_ADDRESS_VALID, &drive->atapi_flags);
663 } 663 }
664 } 664 }
@@ -2381,23 +2381,23 @@ static void idetape_get_mode_sense_results(ide_drive_t *drive)
2381 caps = pc.buf + 4 + pc.buf[3]; 2381 caps = pc.buf + 4 + pc.buf[3];
2382 2382
2383 /* convert to host order and save for later use */ 2383 /* convert to host order and save for later use */
2384 speed = be16_to_cpu(*(u16 *)&caps[14]); 2384 speed = be16_to_cpup((__be16 *)&caps[14]);
2385 max_speed = be16_to_cpu(*(u16 *)&caps[8]); 2385 max_speed = be16_to_cpup((__be16 *)&caps[8]);
2386 2386
2387 put_unaligned(max_speed, (u16 *)&caps[8]); 2387 *(u16 *)&caps[8] = max_speed;
2388 put_unaligned(be16_to_cpu(*(u16 *)&caps[12]), (u16 *)&caps[12]); 2388 *(u16 *)&caps[12] = be16_to_cpup((__be16 *)&caps[12]);
2389 put_unaligned(speed, (u16 *)&caps[14]); 2389 *(u16 *)&caps[14] = speed;
2390 put_unaligned(be16_to_cpu(*(u16 *)&caps[16]), (u16 *)&caps[16]); 2390 *(u16 *)&caps[16] = be16_to_cpup((__be16 *)&caps[16]);
2391 2391
2392 if (!speed) { 2392 if (!speed) {
2393 printk(KERN_INFO "ide-tape: %s: invalid tape speed " 2393 printk(KERN_INFO "ide-tape: %s: invalid tape speed "
2394 "(assuming 650KB/sec)\n", drive->name); 2394 "(assuming 650KB/sec)\n", drive->name);
2395 put_unaligned(650, (u16 *)&caps[14]); 2395 *(u16 *)&caps[14] = 650;
2396 } 2396 }
2397 if (!max_speed) { 2397 if (!max_speed) {
2398 printk(KERN_INFO "ide-tape: %s: invalid max_speed " 2398 printk(KERN_INFO "ide-tape: %s: invalid max_speed "
2399 "(assuming 650KB/sec)\n", drive->name); 2399 "(assuming 650KB/sec)\n", drive->name);
2400 put_unaligned(650, (u16 *)&caps[8]); 2400 *(u16 *)&caps[8] = 650;
2401 } 2401 }
2402 2402
2403 memcpy(&tape->caps, caps, 20); 2403 memcpy(&tape->caps, caps, 20);