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

Commit 374555ae authored by David Brownell's avatar David Brownell Committed by David Woodhouse
Browse files

[MTD] [NAND] fix broken debug messages



Fix incorrect debug messages (*write* not read); someone committed some
cut'n'paste bugs.   There might be more, I only noticed these since I was
looking for nand_read usage and landed in some very wrong functions.

IMO all MTD debugging message framework is goofed, anyway.  It uses
"DEBUG" in a way that's incompatible with usage most everywhere else in
the kernel, and which prevents normal pr_dbg() and dev_dbg() calls from
working right.

[True. It predates those by a long way, and should probably be updated 
to use them. dwmw2]

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent ff4569c7
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1946,7 +1946,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
	}
	}


	if (unlikely(ops->ooboffs >= len)) {
	if (unlikely(ops->ooboffs >= len)) {
		DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
		DEBUG(MTD_DEBUG_LEVEL0, "nand_do_write_oob: "
			"Attempt to start write outside oob\n");
			"Attempt to start write outside oob\n");
		return -EINVAL;
		return -EINVAL;
	}
	}
@@ -1956,7 +1956,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
		     ops->ooboffs + ops->ooblen >
		     ops->ooboffs + ops->ooblen >
			((mtd->size >> chip->page_shift) -
			((mtd->size >> chip->page_shift) -
			 (to >> chip->page_shift)) * len)) {
			 (to >> chip->page_shift)) * len)) {
		DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
		DEBUG(MTD_DEBUG_LEVEL0, "nand_do_write_oob: "
			"Attempt write beyond end of device\n");
			"Attempt write beyond end of device\n");
		return -EINVAL;
		return -EINVAL;
	}
	}
@@ -2012,8 +2012,8 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to,


	/* Do not allow writes past end of device */
	/* Do not allow writes past end of device */
	if (ops->datbuf && (to + ops->len) > mtd->size) {
	if (ops->datbuf && (to + ops->len) > mtd->size) {
		DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
		DEBUG(MTD_DEBUG_LEVEL0, "nand_write_oob: "
		      "Attempt read beyond end of device\n");
		      "Attempt write beyond end of device\n");
		return -EINVAL;
		return -EINVAL;
	}
	}