vpnor: correct offset alignment

With the current implementation of the virtual pnor, a window contains
at most one partition, and a partition may be smaller than the window
max size. An offset requested by the host, which starts right after such
a small partition ends, must result in a new window mapping (because
said offset points to another partition).

Change-Id: I07fd51c6af2c8125891073bf10ceb1399a55dc92
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/mboxd_windows.c b/mboxd_windows.c
index 1755c4a..e4d9882 100644
--- a/mboxd_windows.c
+++ b/mboxd_windows.c
@@ -586,6 +586,14 @@
 		cur = find_oldest_window(context);
 	}
 
+/*
+ * In case of the virtual pnor, as of now it's possible that a window may
+ * have content less than it's max size. We basically copy one flash partition
+ * per window, and some partitions are smaller than the max size. An offset
+ * right after such a small partition ends should lead to new mapping. The code
+ * below prevents that.
+ */
+#ifndef VIRTUAL_PNOR_ENABLED
 	if (!exact) {
 		/*
 		 * It would be nice to align the offsets which we map to window
@@ -597,6 +605,7 @@
 		 */
 		offset &= ~(cur->size - 1);
 	}
+#endif
 
 	if ((offset + cur->size) > context->flash_size) {
 		/*