aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bbpetkov@yahoo.de>2008-02-02 13:56:33 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:33 -0500
commit8f6224308bb5642506af62b88e1b38582220524d (patch)
tree5deff231ccc08c5fae8f174b86d7073f8c4b22b1
parent30d67099385dd837b252a604f1593735c5559e13 (diff)
ide-floppy: replace ntoh{s,l} and hton{s,l} calls with the generic byteorder
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-floppy.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index e4ebb2166547..e63758a78969 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1060,8 +1060,8 @@ static void idefloppy_create_format_unit_cmd (idefloppy_pc_t *pc, int b, int l,
1060 pc->buffer[1] ^= 0x20; /* ... turn off DCRT bit */ 1060 pc->buffer[1] ^= 0x20; /* ... turn off DCRT bit */
1061 pc->buffer[3] = 8; 1061 pc->buffer[3] = 8;
1062 1062
1063 put_unaligned(htonl(b), (unsigned int *)(&pc->buffer[4])); 1063 put_unaligned(cpu_to_be32(b), (unsigned int *)(&pc->buffer[4]));
1064 put_unaligned(htonl(l), (unsigned int *)(&pc->buffer[8])); 1064 put_unaligned(cpu_to_be32(l), (unsigned int *)(&pc->buffer[8]));
1065 pc->buffer_size=12; 1065 pc->buffer_size=12;
1066 set_bit(PC_WRITING, &pc->flags); 1066 set_bit(PC_WRITING, &pc->flags);
1067} 1067}
@@ -1089,7 +1089,7 @@ static void idefloppy_create_mode_sense_cmd (idefloppy_pc_t *pc, u8 page_code, u
1089 printk(KERN_ERR "ide-floppy: unsupported page code " 1089 printk(KERN_ERR "ide-floppy: unsupported page code "
1090 "in create_mode_sense_cmd\n"); 1090 "in create_mode_sense_cmd\n");
1091 } 1091 }
1092 put_unaligned(htons(length), (u16 *) &pc->c[7]); 1092 put_unaligned(cpu_to_be16(length), (u16 *) &pc->c[7]);
1093 pc->request_transfer = length; 1093 pc->request_transfer = length;
1094} 1094}
1095 1095
@@ -1119,12 +1119,12 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t
1119 idefloppy_init_pc(pc); 1119 idefloppy_init_pc(pc);
1120 if (test_bit(IDEFLOPPY_USE_READ12, &floppy->flags)) { 1120 if (test_bit(IDEFLOPPY_USE_READ12, &floppy->flags)) {
1121 pc->c[0] = cmd == READ ? GPCMD_READ_12 : GPCMD_WRITE_12; 1121 pc->c[0] = cmd == READ ? GPCMD_READ_12 : GPCMD_WRITE_12;
1122 put_unaligned(htonl(blocks), (unsigned int *) &pc->c[6]); 1122 put_unaligned(cpu_to_be32(blocks), (unsigned int *) &pc->c[6]);
1123 } else { 1123 } else {
1124 pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10; 1124 pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10;
1125 put_unaligned(htons(blocks), (unsigned short *) &pc->c[7]); 1125 put_unaligned(cpu_to_be16(blocks), (unsigned short *)&pc->c[7]);
1126 } 1126 }
1127 put_unaligned(htonl(block), (unsigned int *) &pc->c[2]); 1127 put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[2]);
1128 pc->callback = &idefloppy_rw_callback; 1128 pc->callback = &idefloppy_rw_callback;
1129 pc->rq = rq; 1129 pc->rq = rq;
1130 pc->b_count = cmd == READ ? 0 : rq->bio->bi_size; 1130 pc->b_count = cmd == READ ? 0 : rq->bio->bi_size;
@@ -1252,10 +1252,10 @@ static int idefloppy_get_flexible_disk_page (ide_drive_t *drive)
1252 set_disk_ro(floppy->disk, floppy->wp); 1252 set_disk_ro(floppy->disk, floppy->wp);
1253 page = (idefloppy_flexible_disk_page_t *) (header + 1); 1253 page = (idefloppy_flexible_disk_page_t *) (header + 1);
1254 1254
1255 page->transfer_rate = ntohs(page->transfer_rate); 1255 page->transfer_rate = be16_to_cpu(page->transfer_rate);
1256 page->sector_size = ntohs(page->sector_size); 1256 page->sector_size = be16_to_cpu(page->sector_size);
1257 page->cyls = ntohs(page->cyls); 1257 page->cyls = be16_to_cpu(page->cyls);
1258 page->rpm = ntohs(page->rpm); 1258 page->rpm = be16_to_cpu(page->rpm);
1259 capacity = page->cyls * page->heads * page->sectors * page->sector_size; 1259 capacity = page->cyls * page->heads * page->sectors * page->sector_size;
1260 if (memcmp (page, &floppy->flexible_disk_page, sizeof (idefloppy_flexible_disk_page_t))) 1260 if (memcmp (page, &floppy->flexible_disk_page, sizeof (idefloppy_flexible_disk_page_t)))
1261 printk(KERN_INFO "%s: %dkB, %d/%d/%d CHS, %d kBps, " 1261 printk(KERN_INFO "%s: %dkB, %d/%d/%d CHS, %d kBps, "
@@ -1328,8 +1328,8 @@ static int idefloppy_get_capacity (ide_drive_t *drive)
1328 descriptor = (idefloppy_capacity_descriptor_t *) (header + 1); 1328 descriptor = (idefloppy_capacity_descriptor_t *) (header + 1);
1329 1329
1330 for (i = 0; i < descriptors; i++, descriptor++) { 1330 for (i = 0; i < descriptors; i++, descriptor++) {
1331 blocks = descriptor->blocks = ntohl(descriptor->blocks); 1331 blocks = descriptor->blocks = be32_to_cpu(descriptor->blocks);
1332 length = descriptor->length = ntohs(descriptor->length); 1332 length = descriptor->length = be16_to_cpu(descriptor->length);
1333 1333
1334 if (!i) 1334 if (!i)
1335 { 1335 {
@@ -1456,8 +1456,8 @@ static int idefloppy_get_format_capacities(ide_drive_t *drive, int __user *arg)
1456 if (i == 0) 1456 if (i == 0)
1457 continue; /* Skip the first descriptor */ 1457 continue; /* Skip the first descriptor */
1458 1458
1459 blocks = ntohl(descriptor->blocks); 1459 blocks = be32_to_cpu(descriptor->blocks);
1460 length = ntohs(descriptor->length); 1460 length = be16_to_cpu(descriptor->length);
1461 1461
1462 if (put_user(blocks, argp)) 1462 if (put_user(blocks, argp))
1463 return(-EFAULT); 1463 return(-EFAULT);