[PATCH] powerpc: Set _IO_BASE to POISON_POINTER_DELTA not 0 for CONFIG_PCI=n
Michael Ellerman
mpe at ellerman.id.au
Thu May 2 12:48:31 AEST 2024
Nathan Chancellor <nathan at kernel.org> writes:
> Hi Michael,
>
> On Wed, May 01, 2024 at 12:04:40AM +1000, Michael Ellerman wrote:
...
>> diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
>> index 08c550ed49be..1cd6eb6c8101 100644
>> --- a/arch/powerpc/include/asm/io.h
>> +++ b/arch/powerpc/include/asm/io.h
>> @@ -37,7 +37,7 @@ extern struct pci_dev *isa_bridge_pcidev;
>> * define properly based on the platform
>> */
>> #ifndef CONFIG_PCI
>> -#define _IO_BASE 0
>> +#define _IO_BASE POISON_POINTER_DELTA
>
> This works for CONFIG_PPC64 but not CONFIG_PPC32 (so tinyconfig and
> allnoconfig like Naresh reported) because CONFIG_ILLEGAL_POINTER_VALUE
> is defined as 0 in that case.
>
> $ grep -P 'CONFIG_(ILLEGAL_POINTER_VALUE|PCI|PPC32)' .config
> CONFIG_PPC32=y
> CONFIG_ILLEGAL_POINTER_VALUE=0
:facepalm:
Looks like we can fix the compiler warnings just by doing the arithmetic
before casting to void *. I'll send a v2.
cheers
More information about the Linuxppc-dev
mailing list