[PATCH 03/13] lib: fwts_deviceytree: make a function argument const and a style change

Colin King colin.king at canonical.com
Tue Aug 14 11:24:25 UTC 2018


From: Colin Ian King <colin.king at canonical.com>

Make argument 'len' in function check_property_printable const. Also
make one minor white space code style change.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_devicetree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
index 4ab39d02..0669561c 100644
--- a/src/lib/src/fwts_devicetree.c
+++ b/src/lib/src/fwts_devicetree.c
@@ -99,7 +99,7 @@ bool check_status_property_okay(fwts_framework *fw,
 int check_property_printable(fwts_framework *fw,
 	const char *name,
 	const char *buf,
-	size_t len)
+	const size_t len)
 {
 	bool printable = true;
 	unsigned int i;
@@ -128,7 +128,7 @@ int check_property_printable(fwts_framework *fw,
 	}
 
 	/* check for a trailing nul */
-	if (buf[len-1] != '\0') {
+	if (buf[len - 1] != '\0') {
 		fwts_failed(fw, LOG_LEVEL_LOW,
 			"DTPrintablePropertyNoNul",
 			"property \"%s\" isn't nul-terminated", name);
-- 
2.17.1




More information about the fwts-devel mailing list