lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200801271930.53933.bzolnier@gmail.com>
Date:	Sun, 27 Jan 2008 19:30:53 +0100
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	Borislav Petkov <petkovbb@...glemail.com>
Cc:	linux-kernel@...r.kernel.org, linux-ide@...r.kernel.org,
	Borislav Petkov <bbpetkov@...oo.de>
Subject: Re: [PATCH 31/32] ide-tape: remove idetape_config_t typedef

On Sunday 27 January 2008, Borislav Petkov wrote:
> From: Borislav Petkov <bbpetkov@...oo.de>
> 
> Since this is used only in idetape_blkdev_ioctl(), remove the typedef and make
> the struct function-local.
> 
> Signed-off-by: Borislav Petkov <bbpetkov@...oo.de>

applied

> ---
>  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)))

s/sizeof(struct idetape_config)/sizeof(config)/ so it fits nicely in one line

>  				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)))

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ