From a950fd789c1ce0fbdc4f5486ccdd8301d6258ba7 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Thu, 3 Oct 2019 15:23:41 +0930 Subject: [PATCH] blocklevel: smart_write: Tidy local variable declarations Group them by use (and name). It's not reverse christmas tree, but it's a bit easier on the eye. Signed-off-by: Andrew Jeffery Signed-off-by: Oliver O'Halloran --- libflash/blocklevel.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c index 07d339974462..6cc4a8122701 100644 --- a/libflash/blocklevel.c +++ b/libflash/blocklevel.c @@ -506,15 +506,18 @@ int blocklevel_smart_erase(struct blocklevel_device *bl, uint64_t pos, uint64_t int blocklevel_smart_write(struct blocklevel_device *bl, uint64_t pos, const void *buf, uint64_t len) { + void *ecc_buf = NULL; + uint64_t ecc_start; + int ecc_protection; + + void *erase_buf = NULL; uint32_t erase_size; + const void *write_buf = buf; uint64_t write_len; uint64_t write_pos; - void *ecc_buf = NULL; - uint64_t ecc_start; - void *erase_buf; + int rc = 0; - int ecc_protection; if (!buf || !bl) { errno = EINVAL;