Patchwork [23/26] uefi: csm: use uint32_t for BIOS address ranges

login
register
mail settings
Submitter Colin King
Date Oct. 14, 2012, 8:32 p.m.
Message ID <1350246738-31699-24-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/191410/
State Accepted
Headers show

Comments

Colin King - Oct. 14, 2012, 8:32 p.m.
From: Colin Ian King <colin.king@canonical.com>

Rather than using plain ints, we should be using uint32_t
for traditional 32 bit BIOS address ranges.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/uefi/csm/csm.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Alex Hung - Oct. 15, 2012, 6:51 a.m.
On 10/15/2012 04:32 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Rather than using plain ints, we should be using uint32_t
> for traditional 32 bit BIOS address ranges.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/uefi/csm/csm.c |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/uefi/csm/csm.c b/src/uefi/csm/csm.c
> index 4f755ba..b054049 100644
> --- a/src/uefi/csm/csm.c
> +++ b/src/uefi/csm/csm.c
> @@ -40,7 +40,7 @@ static int csm_test1(fwts_framework *fw)
>   	uint8_t  *optROM;
>   	uint32_t *intVec;
>   	uint32_t int10hVec;
> -	int i;
> +	uint32_t i;
>   	int flag = 0;
>
>   	fwts_log_info(fw, "Checking for UEFI Compatibility Support Module (CSM)");
> @@ -63,9 +63,9 @@ static int csm_test1(fwts_framework *fw)
>
>   	for (i=0; i<BIOS_ROM_REGION_SIZE; i+= 512) {
>   		if ((*(optROM+i) == 0x55) && (*(optROM+i+1) == 0xaa)) {
> -			int length = *(optROM+i+2) << 9;
> -			int ROMstart = BIOS_ROM_REGION_START+i;
> -			int ROMend = BIOS_ROM_REGION_START+i+length;
> +			uint32_t length = *(optROM+i+2) << 9;
> +			uint32_t ROMstart = BIOS_ROM_REGION_START+i;
> +			uint32_t ROMend = BIOS_ROM_REGION_START+i+length;
>
>   			if ((ROMstart <= int10hVec) && (int10hVec <= ROMend)) {
>   				fwts_log_info(fw, "Int 10h jumps to 0x%" PRIx32 " in option ROM at: "
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - Oct. 17, 2012, 7:56 a.m.
On Mon, Oct 15, 2012 at 4:32 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Rather than using plain ints, we should be using uint32_t
> for traditional 32 bit BIOS address ranges.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/uefi/csm/csm.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/uefi/csm/csm.c b/src/uefi/csm/csm.c
> index 4f755ba..b054049 100644
> --- a/src/uefi/csm/csm.c
> +++ b/src/uefi/csm/csm.c
> @@ -40,7 +40,7 @@ static int csm_test1(fwts_framework *fw)
>         uint8_t  *optROM;
>         uint32_t *intVec;
>         uint32_t int10hVec;
> -       int i;
> +       uint32_t i;
>         int flag = 0;
>
>         fwts_log_info(fw, "Checking for UEFI Compatibility Support Module (CSM)");
> @@ -63,9 +63,9 @@ static int csm_test1(fwts_framework *fw)
>
>         for (i=0; i<BIOS_ROM_REGION_SIZE; i+= 512) {
>                 if ((*(optROM+i) == 0x55) && (*(optROM+i+1) == 0xaa)) {
> -                       int length = *(optROM+i+2) << 9;
> -                       int ROMstart = BIOS_ROM_REGION_START+i;
> -                       int ROMend = BIOS_ROM_REGION_START+i+length;
> +                       uint32_t length = *(optROM+i+2) << 9;
> +                       uint32_t ROMstart = BIOS_ROM_REGION_START+i;
> +                       uint32_t ROMend = BIOS_ROM_REGION_START+i+length;
>
>                         if ((ROMstart <= int10hVec) && (int10hVec <= ROMend)) {
>                                 fwts_log_info(fw, "Int 10h jumps to 0x%" PRIx32 " in option ROM at: "
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/uefi/csm/csm.c b/src/uefi/csm/csm.c
index 4f755ba..b054049 100644
--- a/src/uefi/csm/csm.c
+++ b/src/uefi/csm/csm.c
@@ -40,7 +40,7 @@  static int csm_test1(fwts_framework *fw)
 	uint8_t  *optROM;
 	uint32_t *intVec;
 	uint32_t int10hVec;
-	int i;
+	uint32_t i;
 	int flag = 0;
 
 	fwts_log_info(fw, "Checking for UEFI Compatibility Support Module (CSM)");
@@ -63,9 +63,9 @@  static int csm_test1(fwts_framework *fw)
 
 	for (i=0; i<BIOS_ROM_REGION_SIZE; i+= 512) {
 		if ((*(optROM+i) == 0x55) && (*(optROM+i+1) == 0xaa)) {
-			int length = *(optROM+i+2) << 9;
-			int ROMstart = BIOS_ROM_REGION_START+i;
-			int ROMend = BIOS_ROM_REGION_START+i+length;
+			uint32_t length = *(optROM+i+2) << 9;
+			uint32_t ROMstart = BIOS_ROM_REGION_START+i;
+			uint32_t ROMend = BIOS_ROM_REGION_START+i+length;
 
 			if ((ROMstart <= int10hVec) && (int10hVec <= ROMend)) {
 				fwts_log_info(fw, "Int 10h jumps to 0x%" PRIx32 " in option ROM at: "