[PATCH 31/32] ide-tape: remove idetape_config_t typedef

From: Borislav Petkov
Date: Sun Jan 27 2008 - 04:56:39 EST


From: Borislav Petkov <bbpetkov@xxxxxxxx>

Since this is used only in idetape_blkdev_ioctl(), remove the typedef and make
the struct function-local.

Signed-off-by: Borislav Petkov <bbpetkov@xxxxxxxx>
---
drivers/ide/ide-tape.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index c22d7f6..424879d 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -540,15 +540,6 @@ struct idetape_id_gcw {
#define IDETAPE_CAPABILITIES_PAGE 0x2a

/*
- * Run time configurable parameters.
- */
-typedef struct {
- int dsc_rw_frequency;
- int dsc_media_access_frequency;
- int nr_stages;
-} idetape_config_t;
-
-/*
* The variables below are used for the character device interface.
* Additional state variables are defined in our ide_drive_t structure.
*/
@@ -2742,14 +2733,21 @@ static int idetape_rewind_tape (ide_drive_t *drive)
static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned long arg)
{
idetape_tape_t *tape = drive->driver_data;
- idetape_config_t config;
+
+ struct idetape_config {
+ int dsc_rw_frequency;
+ int dsc_media_access_frequency;
+ int nr_stages;
+ } config;
+
void __user *argp = (void __user *)arg;

debug_log(DBG_PROCS, "Enter %s\n", __func__);

switch (cmd) {
case 0x0340:
- if (copy_from_user(&config, argp, sizeof (idetape_config_t)))
+ if (copy_from_user(&config, argp,
+ sizeof(struct idetape_config)))
return -EFAULT;
tape->best_dsc_rw_freq = config.dsc_rw_frequency;
tape->max_stages = config.nr_stages;
@@ -2757,7 +2755,8 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned l
case 0x0350:
config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
config.nr_stages = tape->max_stages;
- if (copy_to_user(argp, &config, sizeof (idetape_config_t)))
+ if (copy_to_user(argp, &config,
+ sizeof(struct idetape_config)))
return -EFAULT;
break;
default:
--
1.5.3.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/