Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f60710 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by David Woodhouse
Browse files

[MTD] remove unused ecctype,eccsize fields from struct mtd_info



Remove unused and broken mtd->ecctype and mtd->eccsize fields
from struct mtd_info. Do not remove them from userspace API
data structures (don't want to breake userspace) but mark them
as obsolete by a comment. Any userspace program which uses them
should be half-broken anyway, so this is more about saving
data structure size.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent d4160855
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -569,7 +569,6 @@ void DoC2k_init(struct mtd_info *mtd)

	mtd->type = MTD_NANDFLASH;
	mtd->flags = MTD_CAP_NANDFLASH;
	mtd->ecctype = MTD_ECC_RS_DiskOnChip;
	mtd->size = 0;
	mtd->erasesize = 0;
	mtd->writesize = 512;
+0 −1
Original line number Diff line number Diff line
@@ -349,7 +349,6 @@ void DoCMil_init(struct mtd_info *mtd)

	mtd->type = MTD_NANDFLASH;
	mtd->flags = MTD_CAP_NANDFLASH;
	mtd->ecctype = MTD_ECC_RS_DiskOnChip;
	mtd->size = 0;

	/* FIXME: erase size is not always 8KiB */
+0 −1
Original line number Diff line number Diff line
@@ -473,7 +473,6 @@ void DoCMilPlus_init(struct mtd_info *mtd)

	mtd->type = MTD_NANDFLASH;
	mtd->flags = MTD_CAP_NANDFLASH;
	mtd->ecctype = MTD_ECC_RS_DiskOnChip;
	mtd->size = 0;

	mtd->erasesize = 0;
+3 −2
Original line number Diff line number Diff line
@@ -419,8 +419,9 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
		info.erasesize	= mtd->erasesize;
		info.writesize	= mtd->writesize;
		info.oobsize	= mtd->oobsize;
		info.ecctype	= mtd->ecctype;
		info.eccsize	= mtd->eccsize;
		/* The below fields are obsolete */
		info.ecctype	= -1;
		info.eccsize	= 0;
		if (copy_to_user(argp, &info, sizeof(struct mtd_info_user)))
			return -EFAULT;
		break;
+0 −4
Original line number Diff line number Diff line
@@ -727,8 +727,6 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
	concat->mtd.erasesize = subdev[0]->erasesize;
	concat->mtd.writesize = subdev[0]->writesize;
	concat->mtd.oobsize = subdev[0]->oobsize;
	concat->mtd.ecctype = subdev[0]->ecctype;
	concat->mtd.eccsize = subdev[0]->eccsize;
	if (subdev[0]->writev)
		concat->mtd.writev = concat_writev;
	if (subdev[0]->read_oob)
@@ -774,8 +772,6 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
		if (concat->mtd.writesize   !=  subdev[i]->writesize ||
		    concat->mtd.subpage_sft != subdev[i]->subpage_sft ||
		    concat->mtd.oobsize    !=  subdev[i]->oobsize ||
		    concat->mtd.ecctype    !=  subdev[i]->ecctype ||
		    concat->mtd.eccsize    !=  subdev[i]->eccsize ||
		    !concat->mtd.read_oob  != !subdev[i]->read_oob ||
		    !concat->mtd.write_oob != !subdev[i]->write_oob) {
			kfree(concat);
Loading