diff mbox series

bios: smm: remove redundant variable n

Message ID 20210922102257.177783-1-colin.king@canonical.com
State Accepted
Headers show
Series bios: smm: remove redundant variable n | expand

Commit Message

Colin Ian King Sept. 22, 2021, 10:22 a.m. UTC
From: Colin Ian King <colin.king@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@canonical.com>
---
 src/bios/smm/smm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Alex Hung Sept. 22, 2021, 7:08 p.m. UTC | #1
On 2021-09-22 4:22 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@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@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;
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Sept. 23, 2021, 3:47 a.m. UTC | #2
On 9/22/21 6:22 PM, Colin King wrote:
> From: Colin Ian King <colin.king@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@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;
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

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;