* [PATCH -next] mtd: fsl-quadspi: Never build on SPARC
@ 2015-10-21 14:31 Guenter Roeck
2015-10-23 1:07 ` Brian Norris
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2015-10-21 14:31 UTC (permalink / raw)
To: David Woodhouse; +Cc: Brian Norris, linux-mtd, linux-kernel, Guenter Roeck
Attempts to build fsl-quadspi on SPARC fail with
drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error:
'LUT_0' undeclared (first use in this function)
drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error:
pasting "LUT_" and "(" does not give a valid preprocessing token
drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error:
implicit declaration of function 'LUT_'
Never build it on SPARC, even if COMPILE_TEST is enabled.
Fixes: d26a22d06708 ("mtd: fsl-quadspi: allow building for other ARCHes
with COMPILE_TEST")
Cc: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/mtd/spi-nor/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
index 2fe2a7e90fa9..fceb2886bfd1 100644
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
@@ -23,7 +23,7 @@ config MTD_SPI_NOR_USE_4K_SECTORS
config SPI_FSL_QUADSPI
tristate "Freescale Quad SPI controller"
- depends on ARCH_MXC || COMPILE_TEST
+ depends on ARCH_MXC || (COMPILE_TEST && !SPARC)
depends on HAS_IOMEM
help
This enables support for the Quad SPI controller in master mode.
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: fsl-quadspi: Never build on SPARC
2015-10-21 14:31 [PATCH -next] mtd: fsl-quadspi: Never build on SPARC Guenter Roeck
@ 2015-10-23 1:07 ` Brian Norris
2015-10-23 1:13 ` Guenter Roeck
0 siblings, 1 reply; 6+ messages in thread
From: Brian Norris @ 2015-10-23 1:07 UTC (permalink / raw)
To: Guenter Roeck, Han Xu; +Cc: David Woodhouse, linux-mtd, linux-kernel, Han Xu
+ Han
On Wed, Oct 21, 2015 at 07:31:46AM -0700, Guenter Roeck wrote:
> Attempts to build fsl-quadspi on SPARC fail with
>
> drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
> drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error:
> 'LUT_0' undeclared (first use in this function)
> drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error:
> pasting "LUT_" and "(" does not give a valid preprocessing token
> drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error:
> implicit declaration of function 'LUT_'
I don't think this is only a SPARC problem. The macro concatenation is
generally suspect.
I see that READ and WRITE are problems at least. If something like
<linux/fs.h> gets included somehow, then these tokens resolve to
integers or expressions before they fall through to literal
concatentation, so we get 'LUT_0' or 'LUT_(1ULL << __REQ_WRITE)' instead
of 'LUT_READ' and 'LUT_WRITE'.
Han, are you up for fixing, or should I?
Brian
> Never build it on SPARC, even if COMPILE_TEST is enabled.
>
> Fixes: d26a22d06708 ("mtd: fsl-quadspi: allow building for other ARCHes
> with COMPILE_TEST")
> Cc: Brian Norris <computersforpeace@gmail.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/mtd/spi-nor/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> index 2fe2a7e90fa9..fceb2886bfd1 100644
> --- a/drivers/mtd/spi-nor/Kconfig
> +++ b/drivers/mtd/spi-nor/Kconfig
> @@ -23,7 +23,7 @@ config MTD_SPI_NOR_USE_4K_SECTORS
>
> config SPI_FSL_QUADSPI
> tristate "Freescale Quad SPI controller"
> - depends on ARCH_MXC || COMPILE_TEST
> + depends on ARCH_MXC || (COMPILE_TEST && !SPARC)
> depends on HAS_IOMEM
> help
> This enables support for the Quad SPI controller in master mode.
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: fsl-quadspi: Never build on SPARC
2015-10-23 1:07 ` Brian Norris
@ 2015-10-23 1:13 ` Guenter Roeck
2015-10-23 16:31 ` Han Xu
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2015-10-23 1:13 UTC (permalink / raw)
To: Brian Norris, Han Xu; +Cc: David Woodhouse, linux-mtd, linux-kernel
On 10/22/2015 06:07 PM, Brian Norris wrote:
> + Han
>
> On Wed, Oct 21, 2015 at 07:31:46AM -0700, Guenter Roeck wrote:
>> Attempts to build fsl-quadspi on SPARC fail with
>>
>> drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
>> drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error:
>> 'LUT_0' undeclared (first use in this function)
>> drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error:
>> pasting "LUT_" and "(" does not give a valid preprocessing token
>> drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error:
>> implicit declaration of function 'LUT_'
>
> I don't think this is only a SPARC problem. The macro concatenation is
> generally suspect.
>
> I see that READ and WRITE are problems at least. If something like
> <linux/fs.h> gets included somehow, then these tokens resolve to
> integers or expressions before they fall through to literal
> concatentation, so we get 'LUT_0' or 'LUT_(1ULL << __REQ_WRITE)' instead
> of 'LUT_READ' and 'LUT_WRITE'.
>
You are right, that deserves a better fix. I'll leave it up to you.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: fsl-quadspi: Never build on SPARC
2015-10-23 1:13 ` Guenter Roeck
@ 2015-10-23 16:31 ` Han Xu
2015-10-23 16:53 ` Guenter Roeck
2015-10-23 16:55 ` Brian Norris
0 siblings, 2 replies; 6+ messages in thread
From: Han Xu @ 2015-10-23 16:31 UTC (permalink / raw)
To: Guenter Roeck
Cc: Brian Norris, Han Xu, linux-mtd, David Woodhouse, linux-kernel
On Thu, Oct 22, 2015 at 8:13 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On 10/22/2015 06:07 PM, Brian Norris wrote:
>>
>> + Han
>>
>> On Wed, Oct 21, 2015 at 07:31:46AM -0700, Guenter Roeck wrote:
>>>
>>> Attempts to build fsl-quadspi on SPARC fail with
>>>
>>> drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
>>> drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error:
>>> 'LUT_0' undeclared (first use in this function)
>>> drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error:
>>> pasting "LUT_" and "(" does not give a valid preprocessing token
>>> drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error:
>>> implicit declaration of function 'LUT_'
>>
>>
>> I don't think this is only a SPARC problem. The macro concatenation is
>> generally suspect.
>>
>> I see that READ and WRITE are problems at least. If something like
>> <linux/fs.h> gets included somehow, then these tokens resolve to
>> integers or expressions before they fall through to literal
>> concatentation, so we get 'LUT_0' or 'LUT_(1ULL << __REQ_WRITE)' instead
>> of 'LUT_READ' and 'LUT_WRITE'.
Hi Brian
We have two options, either undef READ and WRITE before these macros
or change the LUT_READ to LUT_FSLREAD and same as WRITE. So what's
your opinion? Thanks.
>>
> You are right, that deserves a better fix. I'll leave it up to you.
>
> Thanks,
> Guenter
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: fsl-quadspi: Never build on SPARC
2015-10-23 16:31 ` Han Xu
@ 2015-10-23 16:53 ` Guenter Roeck
2015-10-23 16:55 ` Brian Norris
1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2015-10-23 16:53 UTC (permalink / raw)
To: Han Xu; +Cc: Brian Norris, Han Xu, linux-mtd, David Woodhouse, linux-kernel
On 10/23/2015 09:31 AM, Han Xu wrote:
> On Thu, Oct 22, 2015 at 8:13 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>> On 10/22/2015 06:07 PM, Brian Norris wrote:
>>>
>>> + Han
>>>
>>> On Wed, Oct 21, 2015 at 07:31:46AM -0700, Guenter Roeck wrote:
>>>>
>>>> Attempts to build fsl-quadspi on SPARC fail with
>>>>
>>>> drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
>>>> drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error:
>>>> 'LUT_0' undeclared (first use in this function)
>>>> drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error:
>>>> pasting "LUT_" and "(" does not give a valid preprocessing token
>>>> drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error:
>>>> implicit declaration of function 'LUT_'
>>>
>>>
>>> I don't think this is only a SPARC problem. The macro concatenation is
>>> generally suspect.
>>>
>>> I see that READ and WRITE are problems at least. If something like
>>> <linux/fs.h> gets included somehow, then these tokens resolve to
>>> integers or expressions before they fall through to literal
>>> concatentation, so we get 'LUT_0' or 'LUT_(1ULL << __REQ_WRITE)' instead
>>> of 'LUT_READ' and 'LUT_WRITE'.
> Hi Brian
> We have two options, either undef READ and WRITE before these macros
> or change the LUT_READ to LUT_FSLREAD and same as WRITE. So what's
> your opinion? Thanks.
Undef sounds like a really bad solution to me.
Guenter
>>>
>> You are right, that deserves a better fix. I'll leave it up to you.
>>
>> Thanks,
>> Guenter
>>
>>
>>
>> ______________________________________________________
>> Linux MTD discussion mailing list
>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: fsl-quadspi: Never build on SPARC
2015-10-23 16:31 ` Han Xu
2015-10-23 16:53 ` Guenter Roeck
@ 2015-10-23 16:55 ` Brian Norris
1 sibling, 0 replies; 6+ messages in thread
From: Brian Norris @ 2015-10-23 16:55 UTC (permalink / raw)
To: Han Xu; +Cc: Guenter Roeck, Han Xu, linux-mtd, David Woodhouse, linux-kernel
On Fri, Oct 23, 2015 at 11:31:47AM -0500, Han Xu wrote:
> On Thu, Oct 22, 2015 at 8:13 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> > On 10/22/2015 06:07 PM, Brian Norris wrote:
> >>
> >> + Han
> >>
> >> On Wed, Oct 21, 2015 at 07:31:46AM -0700, Guenter Roeck wrote:
> >>>
> >>> Attempts to build fsl-quadspi on SPARC fail with
> >>>
> >>> drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
> >>> drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error:
> >>> 'LUT_0' undeclared (first use in this function)
> >>> drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error:
> >>> pasting "LUT_" and "(" does not give a valid preprocessing token
> >>> drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error:
> >>> implicit declaration of function 'LUT_'
> >>
> >>
> >> I don't think this is only a SPARC problem. The macro concatenation is
> >> generally suspect.
> >>
> >> I see that READ and WRITE are problems at least. If something like
> >> <linux/fs.h> gets included somehow, then these tokens resolve to
> >> integers or expressions before they fall through to literal
> >> concatentation, so we get 'LUT_0' or 'LUT_(1ULL << __REQ_WRITE)' instead
> >> of 'LUT_READ' and 'LUT_WRITE'.
> Hi Brian
> We have two options, either undef READ and WRITE before these macros
> or change the LUT_READ to LUT_FSLREAD and same as WRITE. So what's
> your opinion? Thanks.
I'd rule out #undef'ing other macros. That just looks like a hack.
There's at least one other option: de-obfuscate your code by directly
using macros instead of concatenating LUT_ to save a few characters. So:
#define LUT0(ins, pad, opr) \
(((opr) << OPRND0_SHIFT) | ((pad) << PAD0_SHIFT) | \
((ins) << INSTR0_SHIFT))
and for example:
writel(LUT0(LUT_WRITE, LUT_PAD1, 0), base + QUADSPI_LUT(lut_base + 1));
I'd take either that option, or renaming your LUT_READ and LUT_WRITE to
LUT_FSL_READ and LUT_FSL_WRITE (not LUT_FSLREAD and LUT_FSLWRITE).
Brian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-23 16:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 14:31 [PATCH -next] mtd: fsl-quadspi: Never build on SPARC Guenter Roeck
2015-10-23 1:07 ` Brian Norris
2015-10-23 1:13 ` Guenter Roeck
2015-10-23 16:31 ` Han Xu
2015-10-23 16:53 ` Guenter Roeck
2015-10-23 16:55 ` Brian Norris
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.