[PATCH 29/46] lib: fwts_efi_module: reduce scope of variable

Colin King colin.king at canonical.com
Tue Jan 13 19:04:48 UTC 2015


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

cppcheck is picking up some minor style issues which can
be easily fixed:

[src/lib/src/fwts_efi_module.c:33]:
	(style) The scope of the variable 'buffer' can be reduced.

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

diff --git a/src/lib/src/fwts_efi_module.c b/src/lib/src/fwts_efi_module.c
index 922d90b..e662d83 100644
--- a/src/lib/src/fwts_efi_module.c
+++ b/src/lib/src/fwts_efi_module.c
@@ -30,10 +30,11 @@ static bool module_already_loaded = false;
 static int check_module_loaded(void)
 {
 	FILE *fp;
-	char buffer[1024];
 
 	module_already_loaded = false;
 	if ((fp = fopen("/proc/modules", "r")) != NULL) {
+		char buffer[1024];
+
 		while (fgets(buffer, sizeof(buffer), fp) != NULL) {
 			if (strstr(buffer, "efi_runtime") != NULL) {
 				module_already_loaded = true;
-- 
2.1.4




More information about the fwts-devel mailing list