Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82529
b: refs/heads/master
c: 8f62243
h: refs/heads/master
i:
  82527: 2721104
v: v3
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Feb 2, 2008
1 parent a6613cd commit 7700907
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30d67099385dd837b252a604f1593735c5559e13
refs/heads/master: 8f6224308bb5642506af62b88e1b38582220524d
28 changes: 14 additions & 14 deletions trunk/drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ static void idefloppy_create_format_unit_cmd (idefloppy_pc_t *pc, int b, int l,
pc->buffer[1] ^= 0x20; /* ... turn off DCRT bit */
pc->buffer[3] = 8;

put_unaligned(htonl(b), (unsigned int *)(&pc->buffer[4]));
put_unaligned(htonl(l), (unsigned int *)(&pc->buffer[8]));
put_unaligned(cpu_to_be32(b), (unsigned int *)(&pc->buffer[4]));
put_unaligned(cpu_to_be32(l), (unsigned int *)(&pc->buffer[8]));
pc->buffer_size=12;
set_bit(PC_WRITING, &pc->flags);
}
Expand Down Expand Up @@ -1089,7 +1089,7 @@ static void idefloppy_create_mode_sense_cmd (idefloppy_pc_t *pc, u8 page_code, u
printk(KERN_ERR "ide-floppy: unsupported page code "
"in create_mode_sense_cmd\n");
}
put_unaligned(htons(length), (u16 *) &pc->c[7]);
put_unaligned(cpu_to_be16(length), (u16 *) &pc->c[7]);
pc->request_transfer = length;
}

Expand Down Expand Up @@ -1119,12 +1119,12 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t
idefloppy_init_pc(pc);
if (test_bit(IDEFLOPPY_USE_READ12, &floppy->flags)) {
pc->c[0] = cmd == READ ? GPCMD_READ_12 : GPCMD_WRITE_12;
put_unaligned(htonl(blocks), (unsigned int *) &pc->c[6]);
put_unaligned(cpu_to_be32(blocks), (unsigned int *) &pc->c[6]);
} else {
pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10;
put_unaligned(htons(blocks), (unsigned short *) &pc->c[7]);
put_unaligned(cpu_to_be16(blocks), (unsigned short *)&pc->c[7]);
}
put_unaligned(htonl(block), (unsigned int *) &pc->c[2]);
put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[2]);
pc->callback = &idefloppy_rw_callback;
pc->rq = rq;
pc->b_count = cmd == READ ? 0 : rq->bio->bi_size;
Expand Down Expand Up @@ -1252,10 +1252,10 @@ static int idefloppy_get_flexible_disk_page (ide_drive_t *drive)
set_disk_ro(floppy->disk, floppy->wp);
page = (idefloppy_flexible_disk_page_t *) (header + 1);

page->transfer_rate = ntohs(page->transfer_rate);
page->sector_size = ntohs(page->sector_size);
page->cyls = ntohs(page->cyls);
page->rpm = ntohs(page->rpm);
page->transfer_rate = be16_to_cpu(page->transfer_rate);
page->sector_size = be16_to_cpu(page->sector_size);
page->cyls = be16_to_cpu(page->cyls);
page->rpm = be16_to_cpu(page->rpm);
capacity = page->cyls * page->heads * page->sectors * page->sector_size;
if (memcmp (page, &floppy->flexible_disk_page, sizeof (idefloppy_flexible_disk_page_t)))
printk(KERN_INFO "%s: %dkB, %d/%d/%d CHS, %d kBps, "
Expand Down Expand Up @@ -1328,8 +1328,8 @@ static int idefloppy_get_capacity (ide_drive_t *drive)
descriptor = (idefloppy_capacity_descriptor_t *) (header + 1);

for (i = 0; i < descriptors; i++, descriptor++) {
blocks = descriptor->blocks = ntohl(descriptor->blocks);
length = descriptor->length = ntohs(descriptor->length);
blocks = descriptor->blocks = be32_to_cpu(descriptor->blocks);
length = descriptor->length = be16_to_cpu(descriptor->length);

if (!i)
{
Expand Down Expand Up @@ -1456,8 +1456,8 @@ static int idefloppy_get_format_capacities(ide_drive_t *drive, int __user *arg)
if (i == 0)
continue; /* Skip the first descriptor */

blocks = ntohl(descriptor->blocks);
length = ntohs(descriptor->length);
blocks = be32_to_cpu(descriptor->blocks);
length = be16_to_cpu(descriptor->length);

if (put_user(blocks, argp))
return(-EFAULT);
Expand Down

0 comments on commit 7700907

Please sign in to comment.