aboutsummaryrefslogtreecommitdiff
path: root/core/flash.c
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2015-05-07 16:11:23 +0930
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-13 14:01:35 +1000
commitcbc09f525317b02dc6490c7c4bc0928d37b8b405 (patch)
treeabe5dbee847bdf8b0f717f19e56355a8cf07ea81 /core/flash.c
parentbc91157f4b40f503c2bd8ce925f6799fc261a207 (diff)
downloadskiboot-cbc09f525317b02dc6490c7c4bc0928d37b8b405.zip
skiboot-cbc09f525317b02dc6490c7c4bc0928d37b8b405.tar.gz
skiboot-cbc09f525317b02dc6490c7c4bc0928d37b8b405.tar.bz2
flash: Fix uninitialised variable warning
core/flash.c:271:14: error: variable 'flash' is used uninitialized whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized] for (i = 0; i < ARRAY_SIZE(flashes); i++) { ^~~~~~~~~~~~~~~~~~~~~~~ core/flash.c:284:7: note: uninitialized use occurs here if (!flash) { ^~~~~ core/flash.c:271:14: note: remove the condition if it is always true for (i = 0; i < ARRAY_SIZE(flashes); i++) { ^~~~~~~~~~~~~~~~~~~~~~~ core/flash.c:257:21: note: initialize the variable 'flash' to silence this warning struct flash *flash; ^ = NULL Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r--core/flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/flash.c b/core/flash.c
index c08bb49..9018ecd 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -255,7 +255,7 @@ int flash_register(struct flash_chip *chip, bool is_system_flash)
uint32_t size, block_size;
struct ffs_handle *ffs;
struct dt_node *node;
- struct flash *flash;
+ struct flash *flash = NULL;
const char *name;
unsigned int i;
int rc;