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]
Date:	Mon, 1 Nov 2010 20:05:17 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	Tracey Dent <tdent48227@...il.com>
cc:	greg@...ah.com, manningc2@...rix.gen.nz,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 15/29] Staging: yaffs2: yaffs_mtdif2: Add files

On Mon, 1 Nov 2010, Tracey Dent wrote:

> Adding files to yaffs2 directory.
> 
> Signed-off-by: Tracey Dent <tdent48227@...il.com>
> ---
>  drivers/staging/yaffs2/yaffs_mtdif2.c |  256 +++++++++++++++++++++++++++++++++
>  drivers/staging/yaffs2/yaffs_mtdif2.h |   29 ++++
>  2 files changed, 285 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/staging/yaffs2/yaffs_mtdif2.c
>  create mode 100644 drivers/staging/yaffs2/yaffs_mtdif2.h
> 
> diff --git a/drivers/staging/yaffs2/yaffs_mtdif2.c b/drivers/staging/yaffs2/yaffs_mtdif2.c
> new file mode 100644
> index 0000000..1c60a44
> --- /dev/null
> +++ b/drivers/staging/yaffs2/yaffs_mtdif2.c
...
> +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
> +	ops.mode = MTD_OOB_AUTO;
> +	ops.ooblen = (dev->param.inband_tags) ? 0 : packed_tags_size;
> +	ops.len = dev->param.total_bytes_per_chunk;
> +	ops.ooboffs = 0;
> +	ops.datbuf = (__u8 *)data;
> +	ops.oobbuf = (dev->param.inband_tags) ? NULL : packed_tags_ptr;
> +	retval = mtd->write_oob(mtd, addr, &ops);
> +
> +#else
...
> +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
> +	if (dev->param.inband_tags || (data && !tags))
> +		retval = mtd->read(mtd, addr, dev->param.total_bytes_per_chunk,
> +				&dummy, data);
> +	else if (tags) {
> +		ops.mode = MTD_OOB_AUTO;
> +		ops.ooblen = packed_tags_size;
> +		ops.len = data ? dev->data_bytes_per_chunk : packed_tags_size;
> +		ops.ooboffs = 0;
> +		ops.datbuf = data;
> +		ops.oobbuf = yaffs_dev_to_lc(dev)->spare_buffer;
> +		retval = mtd->read_oob(mtd, addr, &ops);
> +	}
> +#else
...

If/when this code gets merged it will definitely be into a kernel with a 
version greater than 2.6.17, so I believe you should just get rid of the 
#ifdef and the code in the #else parts.

-- 
Jesper Juhl <jj@...osbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

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