[Skiboot] [PATCH 8/9] blocklevel: smart_write: Tidy local variable declarations

Andrew Jeffery andrew at aj.id.au
Thu Oct 3 15:53:41 AEST 2019


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 <andrew at aj.id.au>
---
 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 @@ out:
 
 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;
-- 
2.20.1



More information about the Skiboot mailing list