[PATCH 22/32] ide-tape: struct idetape_packet_command_s: shorten member names

2008-01-27 Thread Borislav Petkov
From: Borislav Petkov [EMAIL PROTECTED]

Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
---
 drivers/ide/ide-tape.c |   88 ---
 1 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index b487d56..4690f71 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -193,24 +193,25 @@ struct idetape_bh {
char *b_data;
 };
 
-/*
- * Our view of a packet command.
- */
 typedef struct idetape_packet_command_s {
-   u8 c[12];   /* Actual packet bytes */
-   int retries;/* On each retry, we increment 
retries */
-   int error;  /* Error code */
-   int request_transfer;   /* Bytes to transfer */
-   int actually_transferred;   /* Bytes actually transferred */
-   int buffer_size;/* Size of our data buffer */
+   u8 c[12];   /* Actual packet bytes */
+   int retries;/* On each retry, we increment retries */
+   int error;  /* Error code */
+   int rq_xfer;/* Request bytes to transfer */
+   int xferred;/* Bytes actually transferred */
+   int buf_size;   /* Size of our data buffer */
struct idetape_bh *bh;
char *b_data;
int b_count;
-   u8 *buffer; /* Data buffer */
-   u8 *current_position;   /* Pointer into the above 
buffer */
-   ide_startstop_t (*callback) (ide_drive_t *);/* Called when this 
packet command is completed */
+   u8 *buffer; /* Data buffer */
+   u8 *cur_pos;/* Pointer into the above buffer */
+
+   /* Called when this packet command is completed */
+   ide_startstop_t (*callback) (ide_drive_t *);
u8 pc_buffer[IDETAPE_PC_BUFFER_SIZE];   /* Temporary buffer */
-   unsigned long flags;/* Status/Action bit flags: 
long for set_bit */
+
+   /* Status/Action bit flags: long for set_bit */
+   unsigned long flags;
 } idetape_pc_t;
 
 /*
@@ -684,7 +685,7 @@ static void idetape_update_buffers (idetape_pc_t *pc)
 {
struct idetape_bh *bh = pc-bh;
int count;
-   unsigned int bcount = pc-actually_transferred;
+   unsigned int bcount = pc-xferred;
 
if (test_bit(PC_WRITING, pc-flags))
return;
@@ -752,9 +753,9 @@ static void idetape_init_pc (idetape_pc_t *pc)
memset(pc-c, 0, 12);
pc-retries = 0;
pc-flags = 0;
-   pc-request_transfer = 0;
+   pc-rq_xfer = 0;
pc-buffer = pc-pc_buffer;
-   pc-buffer_size = IDETAPE_PC_BUFFER_SIZE;
+   pc-buf_size = IDETAPE_PC_BUFFER_SIZE;
pc-bh = NULL;
pc-b_data = NULL;
 }
@@ -775,9 +776,9 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 
*sense)
debug_log(DBG_ERR, pc = %x, sense key = %x, asc = %x, ascq = %x\n,
 pc-c[0], tape-sense_key, tape-asc, tape-ascq);
 
-   /* Correct pc-actually_transferred by asking the tape.  */
+   /* Correct pc-xferred by asking the tape.   */
if (test_bit(PC_DMA_ERROR, pc-flags)) {
-   pc-actually_transferred = pc-request_transfer -
+   pc-xferred = pc-rq_xfer -
tape-tape_block_size *
be32_to_cpu(get_unaligned((u32 *)sense[3]));
idetape_update_buffers(pc);
@@ -817,7 +818,7 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 
*sense)
set_bit(PC_ABORT, pc-flags);
}
if (!test_bit(PC_ABORT, pc-flags) 
-   pc-actually_transferred)
+   pc-xferred)
pc-retries = IDETAPE_MAX_PC_RETRIES + 1;
}
 }
@@ -1047,7 +1048,7 @@ static void idetape_create_request_sense_cmd 
(idetape_pc_t *pc)
idetape_init_pc(pc);
pc-c[0] = REQUEST_SENSE;
pc-c[4] = 20;
-   pc-request_transfer = 20;
+   pc-rq_xfer = 20;
pc-callback = idetape_request_sense_callback;
 }
 
@@ -1172,7 +1173,7 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t 
*drive)
 */
set_bit(PC_DMA_ERROR, pc-flags);
} else {
-   pc-actually_transferred = pc-request_transfer;
+   pc-xferred = pc-rq_xfer;
idetape_update_buffers(pc);
}
debug_log(DBG_PROCS, DMA finished\n);
@@ -1182,7 +1183,7 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t 
*drive)
/* No more interrupts */
if ((stat  DRQ_STAT) == 0) {
debug_log(DBG_SENSE, Packet command completed, %d bytes
-transferred\n, pc-actually_transferred);
+transferred\n, 

Re: [PATCH 22/32] ide-tape: struct idetape_packet_command_s: shorten member names

2008-01-27 Thread Bartlomiej Zolnierkiewicz
On Sunday 27 January 2008, Borislav Petkov wrote:
 From: Borislav Petkov [EMAIL PROTECTED]
 
 Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
 ---
  drivers/ide/ide-tape.c |   88 ---
  1 files changed, 45 insertions(+), 43 deletions(-)
 
 diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
 index b487d56..4690f71 100644
 --- a/drivers/ide/ide-tape.c
 +++ b/drivers/ide/ide-tape.c
 @@ -193,24 +193,25 @@ struct idetape_bh {
   char *b_data;
  };
  
 -/*
 - *   Our view of a packet command.
 - */
  typedef struct idetape_packet_command_s {
 - u8 c[12];   /* Actual packet bytes */
 - int retries;/* On each retry, we increment 
 retries */
 - int error;  /* Error code */
 - int request_transfer;   /* Bytes to transfer */
 - int actually_transferred;   /* Bytes actually transferred */
 - int buffer_size;/* Size of our data buffer */
 + u8 c[12];   /* Actual packet bytes */
 + int retries;/* On each retry, we increment retries */
 + int error;  /* Error code */
 + int rq_xfer;/* Request bytes to transfer */
 + int xferred;/* Bytes actually transferred */
 + int buf_size;   /* Size of our data buffer */
   struct idetape_bh *bh;
   char *b_data;
   int b_count;
 - u8 *buffer; /* Data buffer */
 - u8 *current_position;   /* Pointer into the above 
 buffer */
 - ide_startstop_t (*callback) (ide_drive_t *);/* Called when this 
 packet command is completed */
 + u8 *buffer; /* Data buffer */
 + u8 *cur_pos;/* Pointer into the above buffer */
 +
 + /* Called when this packet command is completed */
 + ide_startstop_t (*callback) (ide_drive_t *);
   u8 pc_buffer[IDETAPE_PC_BUFFER_SIZE];   /* Temporary buffer */
 - unsigned long flags;/* Status/Action bit flags: 
 long for set_bit */
 +
 + /* Status/Action bit flags: long for set_bit */
 + unsigned long flags;
  } idetape_pc_t;

ide-{floppy,scsi} are using 'request_transfer', 'actually_transferred',
'buffer_size' and 'current_position' in their packet command structures.

We are going to unify ATAPI packet command handling for all ATAPI
device drivers and this patch is a change in the opposite direction.
(IOW I suggest to drop it until ATAPI handling gets unified). 

Thanks,
Bart
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html