From 07065edd5e8ccb334f7b865396dd8196be5c76c5 Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Thu, 25 Oct 2018 10:37:24 +0200 Subject: src/mainboard: Remove irrelevant conditional statement Using a conditional statement to return 0 or 1 depending on a logic value is unnecessarily complex. Change-Id: I449ce2b71b72374de5ec4986f9cc9f91a67856ee Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/29265 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/mainboard/amd/tilapia_fam10/mainboard.c | 8 +------- src/mainboard/asus/m4a78-em/mainboard.c | 8 +------- src/mainboard/asus/m4a785-m/mainboard.c | 8 +------- src/mainboard/gigabyte/ma785gmt/mainboard.c | 8 +------- 4 files changed, 4 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/mainboard/amd/tilapia_fam10/mainboard.c b/src/mainboard/amd/tilapia_fam10/mainboard.c index 543b77508b..5c052ec829 100644 --- a/src/mainboard/amd/tilapia_fam10/mainboard.c +++ b/src/mainboard/amd/tilapia_fam10/mainboard.c @@ -102,13 +102,7 @@ int is_dev3_present(void) /* read the GPIO68 input status */ word = pci_read_config16(sm_dev, 0x7e); - if(word & (1 << 10)){ - /*not exist*/ - return 0; - }else{ - /*exist*/ - return 1; - } + return !(word & (1 << 10)); } diff --git a/src/mainboard/asus/m4a78-em/mainboard.c b/src/mainboard/asus/m4a78-em/mainboard.c index b39f9db259..b075c6938e 100644 --- a/src/mainboard/asus/m4a78-em/mainboard.c +++ b/src/mainboard/asus/m4a78-em/mainboard.c @@ -94,13 +94,7 @@ int is_dev3_present(void) /* read the GPIO68 input status */ word = pci_read_config16(sm_dev, 0x7e); - if(word & (1 << 10)){ - /*not exist*/ - return 0; - }else{ - /*exist*/ - return 1; - } + return !(word & (1 << 10)); } diff --git a/src/mainboard/asus/m4a785-m/mainboard.c b/src/mainboard/asus/m4a785-m/mainboard.c index 0a0eedd859..53c97b8d43 100644 --- a/src/mainboard/asus/m4a785-m/mainboard.c +++ b/src/mainboard/asus/m4a785-m/mainboard.c @@ -104,13 +104,7 @@ int is_dev3_present(void) /* read the GPIO68 input status */ word = pci_read_config16(sm_dev, 0x7e); - if(word & (1 << 10)){ - /*not exist*/ - return 0; - }else{ - /*exist*/ - return 1; - } + return !(word & (1 << 10)); } /* diff --git a/src/mainboard/gigabyte/ma785gmt/mainboard.c b/src/mainboard/gigabyte/ma785gmt/mainboard.c index a0e963190d..5949741b45 100644 --- a/src/mainboard/gigabyte/ma785gmt/mainboard.c +++ b/src/mainboard/gigabyte/ma785gmt/mainboard.c @@ -102,13 +102,7 @@ int is_dev3_present(void) /* read the GPIO68 input status */ word = pci_read_config16(sm_dev, 0x7e); - if(word & (1 << 10)){ - /*not exist*/ - return 0; - }else{ - /*exist*/ - return 1; - } + return !(word & (1 << 10)); } /* -- cgit v1.2.3