Re: [PATCH 21/32] ide-tape: idetape_chrdev_direction_t:shorten enum 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 |   60 ---
>  1 files changed, 31 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
> index cf308d7..b487d56 100644
> --- a/drivers/ide/ide-tape.c
> +++ b/drivers/ide/ide-tape.c
> @@ -178,11 +178,13 @@ enum {
>  /*
>   *   For general magnetic tape device compatibility.
>   */
> +
> +/* tape directions */
>  typedef enum {
> - idetape_direction_none,
> - idetape_direction_read,
> - idetape_direction_write
> -} idetape_chrdev_direction_t;
> + idetape_dir_none,
> + idetape_dir_read,
> + idetape_dir_write

Could you convert them to upper-case while at it?

> +} idetape_chrdev_dir_t;
-
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


[PATCH 21/32] ide-tape: idetape_chrdev_direction_t:shorten enum names

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

Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
---
 drivers/ide/ide-tape.c |   60 ---
 1 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index cf308d7..b487d56 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -178,11 +178,13 @@ enum {
 /*
  * For general magnetic tape device compatibility.
  */
+
+/* tape directions */
 typedef enum {
-   idetape_direction_none,
-   idetape_direction_read,
-   idetape_direction_write
-} idetape_chrdev_direction_t;
+   idetape_dir_none,
+   idetape_dir_read,
+   idetape_dir_write
+} idetape_chrdev_dir_t;
 
 struct idetape_bh {
u32 b_size;
@@ -318,7 +320,7 @@ typedef struct ide_tape_obj {
/* device name */
char name[4];
/* Current character device data transfer direction */
-   idetape_chrdev_direction_t chrdev_direction;
+   idetape_chrdev_dir_t chrdev_direction;
 
/*
 *  Device information
@@ -1934,7 +1936,7 @@ static void idetape_init_merge_stage (idetape_tape_t 
*tape)
struct idetape_bh *bh = tape->merge_stage->bh;

tape->bh = bh;
-   if (tape->chrdev_direction == idetape_direction_write)
+   if (tape->chrdev_direction == idetape_dir_write)
atomic_set(&bh->b_count, 0);
else {
tape->b_data = bh->b_data;
@@ -2205,7 +2207,7 @@ static int __idetape_discard_read_pipeline (ide_drive_t 
*drive)
unsigned long flags;
int cnt;
 
-   if (tape->chrdev_direction != idetape_direction_read)
+   if (tape->chrdev_direction != idetape_dir_read)
return 0;
 
/* Remove merge stage. */
@@ -2220,7 +,7 @@ static int __idetape_discard_read_pipeline (ide_drive_t 
*drive)
 
/* Clear pipeline flags. */
clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags);
-   tape->chrdev_direction = idetape_direction_none;
+   tape->chrdev_direction = idetape_dir_none;
 
/* Remove pipeline stages. */
if (tape->first_stage == NULL)
@@ -2260,7 +2262,7 @@ static int idetape_position_tape (ide_drive_t *drive, 
unsigned int block, u8 par
int retval;
idetape_pc_t pc;
 
-   if (tape->chrdev_direction == idetape_direction_read)
+   if (tape->chrdev_direction == idetape_dir_read)
__idetape_discard_read_pipeline(drive);
idetape_wait_ready(drive, 60 * 5 * HZ);
idetape_create_locate_cmd(drive, &pc, block, partition, skip);
@@ -2487,7 +2489,7 @@ static void idetape_empty_write_pipeline (ide_drive_t 
*drive)
int blocks, min;
struct idetape_bh *bh;
 
-   if (tape->chrdev_direction != idetape_direction_write) {
+   if (tape->chrdev_direction != idetape_dir_write) {
printk(KERN_ERR "ide-tape: bug: Trying to empty write pipeline, 
but we are not writing.\n");
return;
}
@@ -2530,7 +2532,7 @@ static void idetape_empty_write_pipeline (ide_drive_t 
*drive)
tape->merge_stage = NULL;
}
clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags);
-   tape->chrdev_direction = idetape_direction_none;
+   tape->chrdev_direction = idetape_dir_none;
 
/*
 *  On the next backup, perform the feedback loop again.
@@ -2574,8 +2576,8 @@ static int idetape_initiate_read (ide_drive_t *drive, int 
max_stages)
u16 blocks = *(u16 *)&tape->caps[12];
 
/* Initialize read operation */
-   if (tape->chrdev_direction != idetape_direction_read) {
-   if (tape->chrdev_direction == idetape_direction_write) {
+   if (tape->chrdev_direction != idetape_dir_read) {
+   if (tape->chrdev_direction == idetape_dir_write) {
idetape_empty_write_pipeline(drive);
idetape_flush_tape_buffers(drive);
}
@@ -2585,7 +2587,7 @@ static int idetape_initiate_read (ide_drive_t *drive, int 
max_stages)
}
if ((tape->merge_stage = __idetape_kmalloc_stage(tape, 0, 0)) 
== NULL)
return -ENOMEM;
-   tape->chrdev_direction = idetape_direction_read;
+   tape->chrdev_direction = idetape_dir_read;
 
/*
 *  Issue a read 0 command to ensure that DSC handshake
@@ -2599,7 +2601,7 @@ static int idetape_initiate_read (ide_drive_t *drive, int 
max_stages)
if (bytes_read < 0) {
__idetape_kfree_stage(tape->merge_stage);
tape->merge_stage = NULL;
-   tape->chrdev_direction = idetape_direction_none;
+   tape->chrdev_direction = idetape_dir_none;
return bytes_read;
}
}
@@ -2815,7 +2817,7 @@ st