linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bbpetkov@yahoo.de>
To: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: bzolnier@gmail.com, Borislav Petkov <bbpetkov@yahoo.de>
Subject: [RESEND PATCH 10/10] ide-floppy: replace ntoh{s,l} and hton{s,l} calls with the generic byteorder macros
Date: Thu,  3 Jan 2008 14:20:09 +0100	[thread overview]
Message-ID: <1199366409-26016-11-git-send-email-bbpetkov@yahoo.de> (raw)
In-Reply-To: <1199366409-26016-10-git-send-email-bbpetkov@yahoo.de>

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
---
 drivers/ide/ide-floppy.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 6c29b5f..ddab66c 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -695,8 +695,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);
 }
@@ -723,7 +723,7 @@ static void idefloppy_create_mode_sense_cmd(idefloppy_pc_t *pc, u8 page_code,
 			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;
 }
 
@@ -753,12 +753,12 @@ static void idefloppy_create_rw_cmd(idefloppy_t *floppy, idefloppy_pc_t *pc,
 	idefloppy_init_pc(pc);
 	if (idefl_use_rw(floppy)) {
 		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;
@@ -890,10 +890,10 @@ static int idefloppy_get_flexible_disk_page(ide_drive_t *drive)
 	set_disk_ro(floppy->disk, floppy->wp);
 	page = (idefloppy_flex_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->flex_disk_page,
@@ -972,8 +972,8 @@ static int idefloppy_get_capacity(ide_drive_t *drive)
 	descriptor = (idefloppy_cap_desc_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)
 		{
@@ -1100,8 +1100,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);
-- 
1.5.3.7


  reply	other threads:[~2008-01-03 13:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 13:19 [RESEND PATCH 0/10] ide-floppy redux p1 Borislav Petkov
2008-01-03 13:20 ` [RESEND PATCH 01/10] move ide-floppy historical changelog to Documentation/ide/ChangeLog.ide-floppy.1996-2002; Borislav Petkov
2008-01-03 13:20   ` [RESEND PATCH 02/10] ide-floppy: move ide-floppy struct and macro defs into its own header. While at it Borislav Petkov
2008-01-03 13:20     ` [RESEND PATCH 03/10] ide-floppy: convert to generic packet commands Borislav Petkov
2008-01-03 13:20       ` [RESEND PATCH 04/10] ide-floppy: cleanup debugging macros Borislav Petkov
2008-01-03 13:20         ` [RESEND PATCH 05/10] ide-floppy: factor out ioctl handlers from idefloppy_ioctl() Borislav Petkov
2008-01-03 13:20           ` [RESEND PATCH 06/10] ide-floppy: report DMA handling in idefloppy_pc_intr() properly Borislav Petkov
2008-01-03 13:20             ` [RESEND PATCH 07/10] ide-floppy: remove unnecessary ->handler != NULL check Borislav Petkov
2008-01-03 13:20               ` [RESEND PATCH 08/10] ide-floppy: mv idefloppy_{should_,}report_error Borislav Petkov
2008-01-03 13:20                 ` [RESEND PATCH 09/10] ide-floppy: use test_bit wrappers for testing flags Borislav Petkov
2008-01-03 13:20                   ` Borislav Petkov [this message]
2008-01-04  1:29                     ` [RESEND PATCH 10/10] ide-floppy: replace ntoh{s,l} and hton{s,l} calls with the generic byteorder macros Bartlomiej Zolnierkiewicz
2008-01-05 16:10                   ` [RESEND PATCH 09/10] ide-floppy: use test_bit wrappers for testing flags Bartlomiej Zolnierkiewicz
2008-01-05 15:54                 ` [RESEND PATCH 08/10] ide-floppy: mv idefloppy_{should_,}report_error Bartlomiej Zolnierkiewicz
2008-01-04  1:24               ` [RESEND PATCH 07/10] ide-floppy: remove unnecessary ->handler != NULL check Bartlomiej Zolnierkiewicz
2008-01-05 15:46             ` [RESEND PATCH 06/10] ide-floppy: report DMA handling in idefloppy_pc_intr() properly Bartlomiej Zolnierkiewicz
2008-01-05 21:45               ` Borislav Petkov
2008-01-06 15:21                 ` Bartlomiej Zolnierkiewicz
2008-01-05 15:12           ` [RESEND PATCH 05/10] ide-floppy: factor out ioctl handlers from idefloppy_ioctl() Bartlomiej Zolnierkiewicz
2008-01-04  1:19         ` [RESEND PATCH 04/10] ide-floppy: cleanup debugging macros Bartlomiej Zolnierkiewicz
2008-01-04  1:04       ` [RESEND PATCH 03/10] ide-floppy: convert to generic packet commands Bartlomiej Zolnierkiewicz
2008-01-04 22:49     ` [RESEND PATCH 02/10] ide-floppy: move ide-floppy struct and macro defs into its own header. While at it Bartlomiej Zolnierkiewicz
2008-01-05 12:45       ` Borislav Petkov
2008-01-05 13:15         ` Bartlomiej Zolnierkiewicz
2008-01-04  0:36   ` [RESEND PATCH 01/10] move ide-floppy historical changelog to Documentation/ide/ChangeLog.ide-floppy.1996-2002; Bartlomiej Zolnierkiewicz
2008-01-04  0:14 ` [RESEND PATCH 0/10] ide-floppy redux p1 Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1199366409-26016-11-git-send-email-bbpetkov@yahoo.de \
    --to=bbpetkov@yahoo.de \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).