Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82613
b: refs/heads/master
c: d59823f
h: refs/heads/master
i:
  82611: 8d80f85
v: v3
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Feb 2, 2008
1 parent f8dcb25 commit 9284fa9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d99c9da2159fedac30b9a105a64af91dc572571b
refs/heads/master: d59823fa44f7d9babf586b3c705db314aa0f9822
20 changes: 8 additions & 12 deletions trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,6 @@ typedef struct {
#define IDETAPE_BLOCK_DESCRIPTOR 0
#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.
Expand Down Expand Up @@ -2849,24 +2840,29 @@ 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;
void __user *argp = (void __user *)arg;

struct idetape_config {
int dsc_rw_frequency;
int dsc_media_access_frequency;
int nr_stages;
} config;

#if IDETAPE_DEBUG_LOG
if (tape->debug_level >= 4)
printk(KERN_INFO "ide-tape: Reached idetape_blkdev_ioctl\n");
#endif /* IDETAPE_DEBUG_LOG */
switch (cmd) {
case 0x0340:
if (copy_from_user(&config, argp, sizeof (idetape_config_t)))
if (copy_from_user(&config, argp, sizeof(config)))
return -EFAULT;
tape->best_dsc_rw_frequency = config.dsc_rw_frequency;
tape->max_stages = config.nr_stages;
break;
case 0x0350:
config.dsc_rw_frequency = (int) tape->best_dsc_rw_frequency;
config.nr_stages = tape->max_stages;
if (copy_to_user(argp, &config, sizeof (idetape_config_t)))
if (copy_to_user(argp, &config, sizeof(config)))
return -EFAULT;
break;
default:
Expand Down

0 comments on commit 9284fa9

Please sign in to comment.