linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <petkovbb@googlemail.com>
To: bzolnier@gmail.com
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 13/15] ide-atapi: remove pc->buf
Date: Fri, 15 May 2009 07:11:31 +0200	[thread overview]
Message-ID: <1242364293-29223-14-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1242364293-29223-1-git-send-email-petkovbb@gmail.com>

Now after all users of pc->buf have been converted, remove the 64B buffer
embedded in each packet command.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-atapi.c        |    6 ------
 drivers/ide/ide-floppy.c       |    8 +-------
 drivers/ide/ide-floppy_ioctl.c |    1 -
 drivers/ide/ide-tape.c         |    7 ++-----
 include/linux/ide.h            |   11 -----------
 5 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 66ea1e7..3075b04 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -74,8 +74,6 @@ EXPORT_SYMBOL_GPL(ide_check_atapi_device);
 void ide_init_pc(struct ide_atapi_pc *pc)
 {
 	memset(pc, 0, sizeof(*pc));
-	pc->buf = pc->pc_buf;
-	pc->buf_size = IDE_PC_BUFFER_SIZE;
 }
 EXPORT_SYMBOL_GPL(ide_init_pc);
 
@@ -254,10 +252,6 @@ void ide_retry_pc(ide_drive_t *drive)
 	ide_init_pc(pc);
 	memcpy(pc->c, sense_rq->cmd, 12);
 
-	/* pointer to mapped address */
-	pc->buf = bio_data(sense_rq->bio);
-	pc->req_xfer = blk_rq_bytes(sense_rq);
-
 	if (drive->media == ide_tape)
 		set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags);
 
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 14e5e9c..800c83a 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -210,8 +210,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive,
 	pc->rq = rq;
 	if (rq->cmd_flags & REQ_RW)
 		pc->flags |= PC_FLAG_WRITING;
-	pc->buf = NULL;
-	pc->buf_size = blk_rq_bytes(rq);
+
 	pc->flags |= PC_FLAG_DMA_OK;
 }
 
@@ -226,9 +225,6 @@ static void idefloppy_blockpc_cmd(struct ide_disk_obj *floppy,
 		if (rq_data_dir(rq) == WRITE)
 			pc->flags |= PC_FLAG_WRITING;
 	}
-	/* pio will be performed by ide_pio_bytes() which handles sg fine */
-	pc->buf = NULL;
-	pc->buf_size = blk_rq_bytes(rq);
 }
 
 static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
@@ -388,8 +384,6 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
 	drive->capacity64 = 0;
 
 	ide_floppy_create_read_capacity_cmd(&pc);
-	pc.buf_size = sizeof(pc_buf);
-
 	if (ide_queue_pc_tail(drive, disk, &pc, pc_buf, pc.req_xfer)) {
 		printk(KERN_ERR PFX "Can't get floppy parameters\n");
 		return 1;
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
index 3a1f9b5..9c22882 100644
--- a/drivers/ide/ide-floppy_ioctl.c
+++ b/drivers/ide/ide-floppy_ioctl.c
@@ -47,7 +47,6 @@ static int ide_floppy_get_format_capacities(ide_drive_t *drive,
 		return -EINVAL;
 
 	ide_floppy_create_read_capacity_cmd(pc);
-	pc->buf_size = sizeof(pc_buf);
 
 	if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) {
 		printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n");
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index ead2734..9ca2665 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -568,9 +568,8 @@ static void ide_tape_create_rw_cmd(idetape_tape_t *tape,
 	ide_init_pc(pc);
 	put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]);
 	pc->c[1] = 1;
-	pc->buf = NULL;
-	pc->buf_size = blk_rq_bytes(rq);
-	if (pc->buf_size == tape->buffer_size)
+
+	if (blk_rq_bytes(rq) == tape->buffer_size)
 		pc->flags |= PC_FLAG_DMA_OK;
 
 	if (opcode == READ_6)
@@ -1608,8 +1607,6 @@ static void idetape_get_inquiry_results(ide_drive_t *drive)
 	char fw_rev[4], vendor_id[8], product_id[16];
 
 	idetape_create_inquiry_cmd(&pc);
-	pc.buf_size = sizeof(pc_buf);
-
 	if (ide_queue_pc_tail(drive, tape->disk, &pc, pc_buf, pc.req_xfer)) {
 		printk(KERN_ERR "ide-tape: %s: can't get INQUIRY results\n",
 				tape->name);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 4cd7157..59aedcd 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -341,11 +341,6 @@ enum {
 	PC_FLAG_WRITING			= (1 << 6),
 };
 
-/*
- * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes.
- * This is used for several packet commands (not for READ/WRITE commands).
- */
-#define IDE_PC_BUFFER_SIZE	64
 #define ATAPI_WAIT_PC		(60 * HZ)
 
 struct ide_atapi_pc {
@@ -358,10 +353,6 @@ struct ide_atapi_pc {
 	/* bytes to transfer */
 	int req_xfer;
 
-	/* data buffer */
-	u8 *buf;
-	int buf_size;
-
 	/* the corresponding request */
 	struct request *rq;
 
@@ -371,8 +362,6 @@ struct ide_atapi_pc {
 	 * those are more or less driver-specific and some of them are subject
 	 * to change/removal later.
 	 */
-	u8 pc_buf[IDE_PC_BUFFER_SIZE];
-
 	unsigned long timeout;
 };
 
-- 
1.6.3


  parent reply	other threads:[~2009-05-15  5:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15  5:11 [PATCH 0/15 v2] ide-atapi: remove pc->buf and misc cleanups Borislav Petkov
2009-05-15  5:11 ` [PATCH 01/15] ide-tape: fix potential fs requests bug Borislav Petkov
2009-05-15  5:11 ` [PATCH 02/15] ide-atapi: switch to blk_rq_bytes() on do_request() path Borislav Petkov
2009-05-15  5:11 ` [PATCH 03/15] ide-atapi: switch to rq->resid_len Borislav Petkov
2009-05-15  5:11 ` [PATCH 04/15] ide-atapi: add a len-parameter to ide_queue_pc_tail Borislav Petkov
2009-05-15  5:11 ` [PATCH 05/15] ide-atapi: add a buffer-arg " Borislav Petkov
2009-05-15  5:11 ` [PATCH 06/15] ide-floppy/ide_floppy_get_flexible_disk_page: use local buffer Borislav Petkov
2009-05-15  5:11 ` [PATCH 07/15] ide-floppy/ide_floppy_get_sfrp_bit: " Borislav Petkov
2009-05-15  5:11 ` [PATCH 08/15] ide-floppy/ide_floppy_format_unit: " Borislav Petkov
2009-05-15  5:11 ` [PATCH 09/15] ide-atapi: use local sense buffer Borislav Petkov
2009-05-15  5:11 ` [PATCH 10/15] ide-floppy/ide_floppy_get_format_progress: " Borislav Petkov
2009-05-15  5:11 ` [PATCH 11/15] ide-tape/ide_tape_get_bsize_from_bdesc: use local buffer Borislav Petkov
2009-05-15  5:11 ` [PATCH 12/15] ide-tape: fix READ POSITION cmd handling Borislav Petkov
2009-05-15  5:11 ` Borislav Petkov [this message]
2009-05-15  5:11 ` [PATCH 14/15] ide-cd: use whole request_sense buffer in EH Borislav Petkov
2009-05-15  5:11 ` [PATCH 15/15] ide: unify interrupt reason checking Borislav Petkov
2009-05-16 19:07 ` [PATCH 0/15 v2] ide-atapi: remove pc->buf and misc cleanups Bartlomiej Zolnierkiewicz
2009-05-16 19:23   ` Borislav Petkov
2009-05-16 19:35     ` Bartlomiej Zolnierkiewicz
2009-05-17 10:33       ` Borislav Petkov
2009-05-17 13:12         ` Bartlomiej Zolnierkiewicz
2009-05-16 22:08   ` Tejun Heo
2009-05-17 10:26     ` Borislav Petkov
2009-05-17 10:36     ` 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=1242364293-29223-14-git-send-email-petkovbb@gmail.com \
    --to=petkovbb@googlemail.com \
    --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).