Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2018 16:10:14 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331126 - head/sys/dev/flash
Message-ID:  <201803181610.w2IGAEpn051426@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Mar 18 16:10:14 2018
New Revision: 331126
URL: https://svnweb.freebsd.org/changeset/base/331126

Log:
  Remove a pointless KASSERT and reword a comment a bit.  The KASSERT tested
  for the same condition that the preceeding lines checked for and would have
  returned EIO, so the assert could never possibly trigger (sc_sectorsize must
  inherently be an integer multiple of FLASH_PAGE_SIZE).

Modified:
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/mx25l.c
==============================================================================
--- head/sys/dev/flash/mx25l.c	Sun Mar 18 16:06:35 2018	(r331125)
+++ head/sys/dev/flash/mx25l.c	Sun Mar 18 16:10:14 2018	(r331126)
@@ -300,19 +300,11 @@ mx25l_write(device_t dev, off_t offset, caddr_t data, 
 	write_offset = offset;
 
 	/*
-	 * Use the erase sectorsize here since blocks are fully erased
-	 * first before they're written to.
+	 * Writes must be aligned to the erase sectorsize, since blocks are
+	 * fully erased before they're written to.
 	 */
 	if (count % sc->sc_sectorsize != 0 || offset % sc->sc_sectorsize != 0)
 		return (EIO);
-
-	/*
-	 * Assume here that we write per-sector only 
-	 * and sector size should be 256 bytes aligned
-	 */
-	KASSERT(write_offset % FLASH_PAGE_SIZE == 0,
-	    ("offset for BIO_WRITE is not page size (%d bytes) aligned",
-		FLASH_PAGE_SIZE));
 
 	/*
 	 * Maximum write size for CMD_PAGE_PROGRAM is 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803181610.w2IGAEpn051426>