[PATCH 4/6] powerpc: fix sparse warnings

Madhavan Srinivasan maddy at linux.ibm.com
Sun May 18 13:54:43 AEST 2025



On 5/2/25 3:46 PM, Christophe Leroy wrote:
> 
> 
> Le 22/04/2025 à 15:10, Madhavan Srinivasan a écrit :
>> structs are local to the source and does not need to
>> be in global scope, so make it static.
>>
>> Signed-off-by: Madhavan Srinivasan <maddy at linux.ibm.com>
>> ---
>>   arch/powerpc/kernel/btext.c              | 2 +-
>>   arch/powerpc/kernel/setup-common.c       | 2 +-
>>   arch/powerpc/platforms/powernv/opal.c    | 2 +-
>>   arch/powerpc/platforms/pseries/lparcfg.c | 2 +-
>>   4 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
>> index 7f63f1cdc6c3..fc7f5a5b6d76 100644
>> --- a/arch/powerpc/kernel/btext.c
>> +++ b/arch/powerpc/kernel/btext.c
>> @@ -40,7 +40,7 @@ static int dispDeviceRect[4] __force_data;
>>   static unsigned char *dispDeviceBase __force_data;
>>   static unsigned char *logicalDisplayBase __force_data;
>>   -unsigned long disp_BAT[2] __initdata = {0, 0};
>> +static unsigned long disp_BAT[2] __initdata = {0, 0};
> 
> disp_BAT is used in assembly, has to remain global:
> 
> arch/powerpc/kernel/head_book3s_32.S:   addis   r8,r3,disp_BAT at ha
> arch/powerpc/kernel/head_book3s_32.S:   addi    r8,r8,disp_BAT at l

Thought I did a top folder level sweep for this. My bad. 
Nice catch. Will drop this. 

Thanks

> 
> Christophe
> 



More information about the Linuxppc-dev mailing list