[PATCH] bios: smm: remove redundant variable n

Colin King colin.king at canonical.com
Wed Sep 22 10:22:57 UTC 2021


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

The variable n is being assigned but is not read afterwards. The
variable can be removed. Cleans up cppcheck style warnings.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/bios/smm/smm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/bios/smm/smm.c b/src/bios/smm/smm.c
index 24ca126e..5b2eb2cc 100644
--- a/src/bios/smm/smm.c
+++ b/src/bios/smm/smm.c
@@ -58,14 +58,13 @@ static int smm_test0(fwts_framework *fw)
 {
 	uint8_t config[256];
 	bool passed = true;
-	ssize_t n;
 	int fd;
 
 	if ((fd = open(FWTS_INTEL_HOST_PATH, O_RDONLY)) < 0) {
 		fwts_log_warning(fw, "Could not open PCI HOST bridge config data\n");
 		return FWTS_ERROR;
 	}
-	if ((n = read(fd, config, sizeof(config))) < 0) {
+	if (read(fd, config, sizeof(config)) < 0) {
 		fwts_log_warning(fw, "Could not read PCI HOST bridge config data\n");
 		(void)close(fd);
 		return FWTS_ERROR;
-- 
2.32.0




More information about the fwts-devel mailing list