aboutsummaryrefslogtreecommitdiff
path: root/libflash/libflash.h
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2017-11-17 11:02:45 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-20 20:36:08 -0600
commitba540e0be90f1055fd9d40b0a6858f96aff6b180 (patch)
treeb5f0db99ae6db605bed69d9cebf7979b199b977a /libflash/libflash.h
parentd665e102ef3760d590a35b9051a8941062e22df5 (diff)
downloadskiboot-ba540e0be90f1055fd9d40b0a6858f96aff6b180.zip
skiboot-ba540e0be90f1055fd9d40b0a6858f96aff6b180.tar.gz
skiboot-ba540e0be90f1055fd9d40b0a6858f96aff6b180.tar.bz2
external/pflash: Fix erasing within a single erase block
It is possible to erase within a single erase block. Currently the pflash code assumes that if the erase starts part way into an erase block it is because it needs to be aligned up to the boundary with the next erase block. Doing an erase smaller than a single erase block will cause underflows and looping forever on erase. Fixes: ae6cb86c2 ("external/pflash: Reinstate the progress bars") Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/libflash.h')
-rw-r--r--libflash/libflash.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libflash/libflash.h b/libflash/libflash.h
index ff3a982..01b4d60 100644
--- a/libflash/libflash.h
+++ b/libflash/libflash.h
@@ -28,6 +28,10 @@
*/
#include <libflash/errors.h>
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
/* Flash chip, opaque */
struct flash_chip;
struct spi_flash_ctrl;