diff mbox series

ACPI/IORT: Fix GCC 12 warning

Message ID 1644453141-1181-1-git-send-email-victor.erminpour@oracle.com
State New
Headers show
Series ACPI/IORT: Fix GCC 12 warning | expand

Commit Message

Victor Erminpour Feb. 10, 2022, 12:32 a.m. UTC
When building with automatic stack variable initialization, GCC 12
complains about variables defined outside of switch case statements.
Move the variable into the case that uses it, which silences the warning:

./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be executed [-Werror=switch-unreachable]
  1670 |                         struct acpi_iort_named_component *ncomp;
       |                                                           ^~~~~

Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
---
 drivers/acpi/arm64/iort.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Ard Biesheuvel Feb. 10, 2022, 9:11 a.m. UTC | #1
On Thu, 10 Feb 2022 at 01:34, Victor Erminpour
<victor.erminpour@oracle.com> wrote:
>
> When building with automatic stack variable initialization, GCC 12
> complains about variables defined outside of switch case statements.
> Move the variable into the case that uses it, which silences the warning:
>
> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be executed [-Werror=switch-unreachable]
>   1670 |                         struct acpi_iort_named_component *ncomp;
>        |                                                           ^~~~~
>
> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>

GCC 12 is not released yet, and this is clearly a compiler bug (a
declaration is not a statement, and the hidden offending statement
[the zero-init] is emitted by the compiler itself), so please report
this to the GCC folks instead.


> ---
>  drivers/acpi/arm64/iort.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 3b23fb775ac4..5c5d2e56d756 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1645,7 +1645,7 @@ void __init acpi_iort_init(void)
>   */
>  phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>  {
> -       phys_addr_t limit = PHYS_ADDR_MAX;
> +       phys_addr_t local_limit, limit = PHYS_ADDR_MAX;
>         struct acpi_iort_node *node, *end;
>         struct acpi_table_iort *iort;
>         acpi_status status;
> @@ -1667,17 +1667,15 @@ phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>                         break;
>
>                 switch (node->type) {
> -                       struct acpi_iort_named_component *ncomp;
> -                       struct acpi_iort_root_complex *rc;
> -                       phys_addr_t local_limit;
> -
>                 case ACPI_IORT_NODE_NAMED_COMPONENT:
> +                       struct acpi_iort_named_component *ncomp;
>                         ncomp = (struct acpi_iort_named_component *)node->node_data;
>                         local_limit = DMA_BIT_MASK(ncomp->memory_address_limit);
>                         limit = min_not_zero(limit, local_limit);
>                         break;
>
>                 case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
> +                       struct acpi_iort_root_complex *rc;
>                         if (node->revision < 1)
>                                 break;
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Victor Erminpour Feb. 10, 2022, 5:36 p.m. UTC | #2
On 2/10/22 1:11 AM, Ard Biesheuvel wrote:
> On Thu, 10 Feb 2022 at 01:34, Victor Erminpour
> <victor.erminpour@oracle.com> wrote:
>> When building with automatic stack variable initialization, GCC 12
>> complains about variables defined outside of switch case statements.
>> Move the variable into the case that uses it, which silences the warning:
>>
>> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be executed [-Werror=switch-unreachable]
>>    1670 |                         struct acpi_iort_named_component *ncomp;
>>         |                                                           ^~~~~
>>
>> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
> GCC 12 is not released yet, and this is clearly a compiler bug (a
> declaration is not a statement, and the hidden offending statement
> [the zero-init] is emitted by the compiler itself), so please report
> this to the GCC folks instead.

Hi Ard,

Thanks for the reply.
This fix is similar to the following commits that have been integrated 
upstream:
https://lore.kernel.org/linux-hardening/20211209043456.1377875-1-keescook@chromium.org/
https://lore.kernel.org/linux-hardening/20211209043915.1378393-1-keescook@chromium.org/

You're not obligated to integrate this commit, but you may run into this 
issue once
upstream starts using GCC 12 (or a patched version of GCC 11 in my case) 
with the
CONFIG_INIT_STACK_ALL_ZERO option enabled.

Regards,
--Victor


>
>> ---
>>   drivers/acpi/arm64/iort.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
>> index 3b23fb775ac4..5c5d2e56d756 100644
>> --- a/drivers/acpi/arm64/iort.c
>> +++ b/drivers/acpi/arm64/iort.c
>> @@ -1645,7 +1645,7 @@ void __init acpi_iort_init(void)
>>    */
>>   phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>>   {
>> -       phys_addr_t limit = PHYS_ADDR_MAX;
>> +       phys_addr_t local_limit, limit = PHYS_ADDR_MAX;
>>          struct acpi_iort_node *node, *end;
>>          struct acpi_table_iort *iort;
>>          acpi_status status;
>> @@ -1667,17 +1667,15 @@ phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>>                          break;
>>
>>                  switch (node->type) {
>> -                       struct acpi_iort_named_component *ncomp;
>> -                       struct acpi_iort_root_complex *rc;
>> -                       phys_addr_t local_limit;
>> -
>>                  case ACPI_IORT_NODE_NAMED_COMPONENT:
>> +                       struct acpi_iort_named_component *ncomp;
>>                          ncomp = (struct acpi_iort_named_component *)node->node_data;
>>                          local_limit = DMA_BIT_MASK(ncomp->memory_address_limit);
>>                          limit = min_not_zero(limit, local_limit);
>>                          break;
>>
>>                  case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
>> +                       struct acpi_iort_root_complex *rc;
>>                          if (node->revision < 1)
>>                                  break;
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> https://urldefense.com/v3/__http://lists.infradead.org/mailman/listinfo/linux-arm-kernel__;!!ACWV5N9M2RV99hQ!dguMEUG-y4wN_Scw_dP1umWKxZKxiQA2Fv9sHuQx6Un9QIqSMbkQVxTeIZInR2h7YL-f$
Robin Murphy Feb. 10, 2022, 6:06 p.m. UTC | #3
On 2022-02-10 00:32, Victor Erminpour wrote:
> When building with automatic stack variable initialization, GCC 12
> complains about variables defined outside of switch case statements.
> Move the variable into the case that uses it, which silences the warning:
> 
> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be executed [-Werror=switch-unreachable]
>    1670 |                         struct acpi_iort_named_component *ncomp;
>         |                                                           ^~~~~

Notwithstanding the fact that that warning is nonsensical, this patch 
changes valid C code into invalid C code that doesn't even compile:

drivers/acpi/arm64/iort.c: In function ‘acpi_iort_dma_get_max_cpu_address’:
drivers/acpi/arm64/iort.c:1669:4: error: a label can only be part of a 
statement and a declaration is not a statement
  1669 |    struct acpi_iort_named_component *ncomp;
       |    ^~~~~~
drivers/acpi/arm64/iort.c:1676:4: error: a label can only be part of a 
statement and a declaration is not a statement
  1676 |    struct acpi_iort_root_complex *rc;
       |    ^~~~~~

Robin.

> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
> ---
>   drivers/acpi/arm64/iort.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 3b23fb775ac4..5c5d2e56d756 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1645,7 +1645,7 @@ void __init acpi_iort_init(void)
>    */
>   phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>   {
> -	phys_addr_t limit = PHYS_ADDR_MAX;
> +	phys_addr_t local_limit, limit = PHYS_ADDR_MAX;
>   	struct acpi_iort_node *node, *end;
>   	struct acpi_table_iort *iort;
>   	acpi_status status;
> @@ -1667,17 +1667,15 @@ phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>   			break;
>   
>   		switch (node->type) {
> -			struct acpi_iort_named_component *ncomp;
> -			struct acpi_iort_root_complex *rc;
> -			phys_addr_t local_limit;
> -
>   		case ACPI_IORT_NODE_NAMED_COMPONENT:
> +			struct acpi_iort_named_component *ncomp;
>   			ncomp = (struct acpi_iort_named_component *)node->node_data;
>   			local_limit = DMA_BIT_MASK(ncomp->memory_address_limit);
>   			limit = min_not_zero(limit, local_limit);
>   			break;
>   
>   		case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
> +			struct acpi_iort_root_complex *rc;
>   			if (node->revision < 1)
>   				break;
>   
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Victor Erminpour Feb. 10, 2022, 6:27 p.m. UTC | #4
On 2/10/22 10:06 AM, Robin Murphy wrote:
> On 2022-02-10 00:32, Victor Erminpour wrote:
>> When building with automatic stack variable initialization, GCC 12
>> complains about variables defined outside of switch case statements.
>> Move the variable into the case that uses it, which silences the 
>> warning:
>>
>> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be 
>> executed [-Werror=switch-unreachable]
>>    1670 |                         struct acpi_iort_named_component 
>> *ncomp;
>> | ^~~~~
>
> Notwithstanding the fact that that warning is nonsensical, this patch 
> changes valid C code into invalid C code that doesn't even compile:
>
> drivers/acpi/arm64/iort.c: In function 
> ‘acpi_iort_dma_get_max_cpu_address’:
> drivers/acpi/arm64/iort.c:1669:4: error: a label can only be part of a 
> statement and a declaration is not a statement
>  1669 |    struct acpi_iort_named_component *ncomp;
>       |    ^~~~~~
> drivers/acpi/arm64/iort.c:1676:4: error: a label can only be part of a 
> statement and a declaration is not a statement
>  1676 |    struct acpi_iort_root_complex *rc;
>       |    ^~~~~~
>
> Robin.
>

Hi Robin,

Thank you for your constructive criticism.
Could the solution be enclosing the case statement in curly braces?

I know this isn't a big issue for you, but this is a legitimate error 
for people
building the kernel with GCC 12 and CONFIG_INIT_STACK_ALL_ZERO enabled.

Regards,
--Victor



>> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
>> ---
>>   drivers/acpi/arm64/iort.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
>> index 3b23fb775ac4..5c5d2e56d756 100644
>> --- a/drivers/acpi/arm64/iort.c
>> +++ b/drivers/acpi/arm64/iort.c
>> @@ -1645,7 +1645,7 @@ void __init acpi_iort_init(void)
>>    */
>>   phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>>   {
>> -    phys_addr_t limit = PHYS_ADDR_MAX;
>> +    phys_addr_t local_limit, limit = PHYS_ADDR_MAX;
>>       struct acpi_iort_node *node, *end;
>>       struct acpi_table_iort *iort;
>>       acpi_status status;
>> @@ -1667,17 +1667,15 @@ phys_addr_t __init 
>> acpi_iort_dma_get_max_cpu_address(void)
>>               break;
>>             switch (node->type) {
>> -            struct acpi_iort_named_component *ncomp;
>> -            struct acpi_iort_root_complex *rc;
>> -            phys_addr_t local_limit;
>> -
>>           case ACPI_IORT_NODE_NAMED_COMPONENT:
>> +            struct acpi_iort_named_component *ncomp;
>>               ncomp = (struct acpi_iort_named_component 
>> *)node->node_data;
>>               local_limit = DMA_BIT_MASK(ncomp->memory_address_limit);
>>               limit = min_not_zero(limit, local_limit);
>>               break;
>>             case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
>> +            struct acpi_iort_root_complex *rc;
>>               if (node->revision < 1)
>>                   break;
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> https://urldefense.com/v3/__http://lists.infradead.org/mailman/listinfo/linux-arm-kernel__;!!ACWV5N9M2RV99hQ!ZcNRWTaQIb1uVqcZAusSzXd2kBnWuqAuICpxkOm6bOWBouQoFygbcIMJVUNp34LqhNrc$ 
>
Robin Murphy Feb. 10, 2022, 6:35 p.m. UTC | #5
On 2022-02-10 18:27, Victor Erminpour wrote:
> 
> On 2/10/22 10:06 AM, Robin Murphy wrote:
>> On 2022-02-10 00:32, Victor Erminpour wrote:
>>> When building with automatic stack variable initialization, GCC 12
>>> complains about variables defined outside of switch case statements.
>>> Move the variable into the case that uses it, which silences the 
>>> warning:
>>>
>>> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be 
>>> executed [-Werror=switch-unreachable]
>>>    1670 |                         struct acpi_iort_named_component 
>>> *ncomp;
>>> | ^~~~~
>>
>> Notwithstanding the fact that that warning is nonsensical, this patch 
>> changes valid C code into invalid C code that doesn't even compile:
>>
>> drivers/acpi/arm64/iort.c: In function 
>> ‘acpi_iort_dma_get_max_cpu_address’:
>> drivers/acpi/arm64/iort.c:1669:4: error: a label can only be part of a 
>> statement and a declaration is not a statement
>>  1669 |    struct acpi_iort_named_component *ncomp;
>>       |    ^~~~~~
>> drivers/acpi/arm64/iort.c:1676:4: error: a label can only be part of a 
>> statement and a declaration is not a statement
>>  1676 |    struct acpi_iort_root_complex *rc;
>>       |    ^~~~~~
>>
>> Robin.
>>
> 
> Hi Robin,
> 
> Thank you for your constructive criticism.
> Could the solution be enclosing the case statement in curly braces?
> 
> I know this isn't a big issue for you, but this is a legitimate error 
> for people
> building the kernel with GCC 12 and CONFIG_INIT_STACK_ALL_ZERO enabled.

As Ard pointed out first, it is not a legitimate error, it is a spurious 
error. The fact that you seemingly didn't get the label errors above, 
nor even "ISO C90 forbids mixed declarations and code 
[-Wdeclaration-after-statement]", implies that GCC 12 currently has a 
completely broken notion of declarations vs. statements with that option 
enabled, so GCC 12 needs fixing.

Robin.

> 
> Regards,
> --Victor
> 
> 
> 
>>> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
>>> ---
>>>   drivers/acpi/arm64/iort.c | 8 +++-----
>>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
>>> index 3b23fb775ac4..5c5d2e56d756 100644
>>> --- a/drivers/acpi/arm64/iort.c
>>> +++ b/drivers/acpi/arm64/iort.c
>>> @@ -1645,7 +1645,7 @@ void __init acpi_iort_init(void)
>>>    */
>>>   phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>>>   {
>>> -    phys_addr_t limit = PHYS_ADDR_MAX;
>>> +    phys_addr_t local_limit, limit = PHYS_ADDR_MAX;
>>>       struct acpi_iort_node *node, *end;
>>>       struct acpi_table_iort *iort;
>>>       acpi_status status;
>>> @@ -1667,17 +1667,15 @@ phys_addr_t __init 
>>> acpi_iort_dma_get_max_cpu_address(void)
>>>               break;
>>>             switch (node->type) {
>>> -            struct acpi_iort_named_component *ncomp;
>>> -            struct acpi_iort_root_complex *rc;
>>> -            phys_addr_t local_limit;
>>> -
>>>           case ACPI_IORT_NODE_NAMED_COMPONENT:
>>> +            struct acpi_iort_named_component *ncomp;
>>>               ncomp = (struct acpi_iort_named_component 
>>> *)node->node_data;
>>>               local_limit = DMA_BIT_MASK(ncomp->memory_address_limit);
>>>               limit = min_not_zero(limit, local_limit);
>>>               break;
>>>             case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
>>> +            struct acpi_iort_root_complex *rc;
>>>               if (node->revision < 1)
>>>                   break;
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel@lists.infradead.org
>>> https://urldefense.com/v3/__http://lists.infradead.org/mailman/listinfo/linux-arm-kernel__;!!ACWV5N9M2RV99hQ!ZcNRWTaQIb1uVqcZAusSzXd2kBnWuqAuICpxkOm6bOWBouQoFygbcIMJVUNp34LqhNrc$ 
>>
>>
Ard Biesheuvel Feb. 10, 2022, 7:29 p.m. UTC | #6
(cc Kees)

On Thu, 10 Feb 2022 at 18:36, Victor Erminpour
<victor.erminpour@oracle.com> wrote:
>
>
> On 2/10/22 1:11 AM, Ard Biesheuvel wrote:
> > On Thu, 10 Feb 2022 at 01:34, Victor Erminpour
> > <victor.erminpour@oracle.com> wrote:
> >> When building with automatic stack variable initialization, GCC 12
> >> complains about variables defined outside of switch case statements.
> >> Move the variable into the case that uses it, which silences the warning:
> >>
> >> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be executed [-Werror=switch-unreachable]
> >>    1670 |                         struct acpi_iort_named_component *ncomp;
> >>         |                                                           ^~~~~
> >>
> >> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
> > GCC 12 is not released yet, and this is clearly a compiler bug (a
> > declaration is not a statement, and the hidden offending statement
> > [the zero-init] is emitted by the compiler itself), so please report
> > this to the GCC folks instead.
>
> Hi Ard,
>
> Thanks for the reply.
> This fix is similar to the following commits that have been integrated
> upstream:
> https://lore.kernel.org/linux-hardening/20211209043456.1377875-1-keescook@chromium.org/
> https://lore.kernel.org/linux-hardening/20211209043915.1378393-1-keescook@chromium.org/
>

If GCC 12 rejects valid C with this feature enabled, the compiler is
broken and needs to be fixed. Papering over this by making changes to
perfectly valid C code is a slippery slope that we should avoid.

Since GCC 12 is not released yet, there is time to get this fixed properly.

> You're not obligated to integrate this commit,

Why, thank you :-)

> but you may run into this
> issue once
> upstream starts using GCC 12 (or a patched version of GCC 11 in my case)
> with the
> CONFIG_INIT_STACK_ALL_ZERO option enabled.
>

Yes, that part was perfectly clear.
Ard Biesheuvel Feb. 10, 2022, 7:39 p.m. UTC | #7
On Thu, 10 Feb 2022 at 20:29, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> (cc Kees)
>

... for real this time :-)

> On Thu, 10 Feb 2022 at 18:36, Victor Erminpour
> <victor.erminpour@oracle.com> wrote:
> >
> >
> > On 2/10/22 1:11 AM, Ard Biesheuvel wrote:
> > > On Thu, 10 Feb 2022 at 01:34, Victor Erminpour
> > > <victor.erminpour@oracle.com> wrote:
> > >> When building with automatic stack variable initialization, GCC 12
> > >> complains about variables defined outside of switch case statements.
> > >> Move the variable into the case that uses it, which silences the warning:
> > >>
> > >> ./drivers/acpi/arm64/iort.c:1670:59: error: statement will never be executed [-Werror=switch-unreachable]
> > >>    1670 |                         struct acpi_iort_named_component *ncomp;
> > >>         |                                                           ^~~~~
> > >>
> > >> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
> > > GCC 12 is not released yet, and this is clearly a compiler bug (a
> > > declaration is not a statement, and the hidden offending statement
> > > [the zero-init] is emitted by the compiler itself), so please report
> > > this to the GCC folks instead.
> >
> > Hi Ard,
> >
> > Thanks for the reply.
> > This fix is similar to the following commits that have been integrated
> > upstream:
> > https://lore.kernel.org/linux-hardening/20211209043456.1377875-1-keescook@chromium.org/
> > https://lore.kernel.org/linux-hardening/20211209043915.1378393-1-keescook@chromium.org/
> >
>
> If GCC 12 rejects valid C with this feature enabled, the compiler is
> broken and needs to be fixed. Papering over this by making changes to
> perfectly valid C code is a slippery slope that we should avoid.
>
> Since GCC 12 is not released yet, there is time to get this fixed properly.
>
> > You're not obligated to integrate this commit,
>
> Why, thank you :-)
>
> > but you may run into this
> > issue once
> > upstream starts using GCC 12 (or a patched version of GCC 11 in my case)
> > with the
> > CONFIG_INIT_STACK_ALL_ZERO option enabled.
> >
>
> Yes, that part was perfectly clear.
diff mbox series

Patch

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 3b23fb775ac4..5c5d2e56d756 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -1645,7 +1645,7 @@  void __init acpi_iort_init(void)
  */
 phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
 {
-	phys_addr_t limit = PHYS_ADDR_MAX;
+	phys_addr_t local_limit, limit = PHYS_ADDR_MAX;
 	struct acpi_iort_node *node, *end;
 	struct acpi_table_iort *iort;
 	acpi_status status;
@@ -1667,17 +1667,15 @@  phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
 			break;
 
 		switch (node->type) {
-			struct acpi_iort_named_component *ncomp;
-			struct acpi_iort_root_complex *rc;
-			phys_addr_t local_limit;
-
 		case ACPI_IORT_NODE_NAMED_COMPONENT:
+			struct acpi_iort_named_component *ncomp;
 			ncomp = (struct acpi_iort_named_component *)node->node_data;
 			local_limit = DMA_BIT_MASK(ncomp->memory_address_limit);
 			limit = min_not_zero(limit, local_limit);
 			break;
 
 		case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
+			struct acpi_iort_root_complex *rc;
 			if (node->revision < 1)
 				break;