diff mbox

[v2] fpga: allow to compile-test Altera FPGA bridge drivers

Message ID 20170412072048.22788-1-tklauser@distanz.ch (mailing list archive)
State Under Review, archived
Delegated to: Moritz Fischer
Headers show

Commit Message

Tobias Klauser April 12, 2017, 7:20 a.m. UTC
Add COMPILE_TEST to the Kconfig entry for the Altera SoCFPGA FPGA
Bridge. The Altera FPGA Freeze Bridge can also be used on Altera PEIe
FPGAs, so the driver shouldn't depend on ARCH_SOCFPGA in the first place.
This allows test-compiling the drivers on other architectures to catch
compiler errors/warnings, e.g. due to API/header changes earlier on.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/fpga/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alan Tull April 12, 2017, 2:39 p.m. UTC | #1
On Wed, Apr 12, 2017 at 2:20 AM, Tobias Klauser <tklauser@distanz.ch> wrote:
> Add COMPILE_TEST to the Kconfig entry for the Altera SoCFPGA FPGA
> Bridge. The Altera FPGA Freeze Bridge can also be used on Altera PEIe
> FPGAs, so the driver shouldn't depend on ARCH_SOCFPGA in the first place.
> This allows test-compiling the drivers on other architectures to catch
> compiler errors/warnings, e.g. due to API/header changes earlier on.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Signed-off-by: Alan Tull <atull@kernel.org>

> ---
>  drivers/fpga/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
> index 161ba9dccede..544600db8052 100644
> --- a/drivers/fpga/Kconfig
> +++ b/drivers/fpga/Kconfig
> @@ -69,14 +69,14 @@ config FPGA_BRIDGE
>
>  config SOCFPGA_FPGA_BRIDGE
>         tristate "Altera SoCFPGA FPGA Bridges"
> -       depends on ARCH_SOCFPGA && FPGA_BRIDGE
> +       depends on (ARCH_SOCFPGA || COMPILE_TEST) && FPGA_BRIDGE
>         help
>           Say Y to enable drivers for FPGA bridges for Altera SOCFPGA
>           devices.
>
>  config ALTERA_FREEZE_BRIDGE
>         tristate "Altera FPGA Freeze Bridge"
> -       depends on ARCH_SOCFPGA && FPGA_BRIDGE
> +       depends on FPGA_BRIDGE
>         help
>           Say Y to enable drivers for Altera FPGA Freeze bridges.  A
>           freeze bridge is a bridge that exists in the FPGA fabric to
> --
> 2.12.2
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
kernel test robot April 25, 2017, 4:14 a.m. UTC | #2
Hi Tobias,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.11-rc8]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Tobias-Klauser/fpga-allow-to-compile-test-Altera-FPGA-bridge-drivers/20170412-180901
config: um-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=um 

All errors (new ones prefixed by >>):

   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc9f1): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc83c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xcb55): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoaddr':
   (.text+0x1d5e5): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametonetaddr':
   (.text+0x1d685): warning: Using 'getnetbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoproto':
   (.text+0x1d8a5): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoport':
   (.text+0x1d6d7): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
   drivers/built-in.o: In function `img_ascii_lcd_probe':
   drivers/auxdisplay/img-ascii-lcd.c:385: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `altera_freeze_br_probe':
>> drivers/fpga/altera-freeze-bridge.c:235: undefined reference to `devm_ioremap_resource'
   collect2: error: ld returned 1 exit status

vim +235 drivers/fpga/altera-freeze-bridge.c

ca24a648 Alan Tull 2016-11-01  219  	struct device *dev = &pdev->dev;
ca24a648 Alan Tull 2016-11-01  220  	struct device_node *np = pdev->dev.of_node;
ca24a648 Alan Tull 2016-11-01  221  	struct altera_freeze_br_data *priv;
ca24a648 Alan Tull 2016-11-01  222  	struct resource *res;
ca24a648 Alan Tull 2016-11-01  223  	u32 status, revision;
ca24a648 Alan Tull 2016-11-01  224  
ca24a648 Alan Tull 2016-11-01  225  	if (!np)
ca24a648 Alan Tull 2016-11-01  226  		return -ENODEV;
ca24a648 Alan Tull 2016-11-01  227  
ca24a648 Alan Tull 2016-11-01  228  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
ca24a648 Alan Tull 2016-11-01  229  	if (!priv)
ca24a648 Alan Tull 2016-11-01  230  		return -ENOMEM;
ca24a648 Alan Tull 2016-11-01  231  
ca24a648 Alan Tull 2016-11-01  232  	priv->dev = dev;
ca24a648 Alan Tull 2016-11-01  233  
ca24a648 Alan Tull 2016-11-01  234  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ca24a648 Alan Tull 2016-11-01 @235  	priv->base_addr = devm_ioremap_resource(dev, res);
ca24a648 Alan Tull 2016-11-01  236  	if (IS_ERR(priv->base_addr))
ca24a648 Alan Tull 2016-11-01  237  		return PTR_ERR(priv->base_addr);
ca24a648 Alan Tull 2016-11-01  238  
ca24a648 Alan Tull 2016-11-01  239  	status = readl(priv->base_addr + FREEZE_CSR_STATUS_OFFSET);
ca24a648 Alan Tull 2016-11-01  240  	if (status & FREEZE_CSR_STATUS_UNFREEZE_REQ_DONE)
ca24a648 Alan Tull 2016-11-01  241  		priv->enable = 1;
ca24a648 Alan Tull 2016-11-01  242  
ca24a648 Alan Tull 2016-11-01  243  	revision = readl(priv->base_addr + FREEZE_CSR_REG_VERSION);

:::::: The code at line 235 was first introduced by commit
:::::: ca24a648f535a02b4163ca4f4d2e51869f155a3a fpga: add altera freeze bridge support

:::::: TO: Alan Tull <atull@opensource.altera.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
index 161ba9dccede..544600db8052 100644
--- a/drivers/fpga/Kconfig
+++ b/drivers/fpga/Kconfig
@@ -69,14 +69,14 @@  config FPGA_BRIDGE
 
 config SOCFPGA_FPGA_BRIDGE
 	tristate "Altera SoCFPGA FPGA Bridges"
-	depends on ARCH_SOCFPGA && FPGA_BRIDGE
+	depends on (ARCH_SOCFPGA || COMPILE_TEST) && FPGA_BRIDGE
 	help
 	  Say Y to enable drivers for FPGA bridges for Altera SOCFPGA
 	  devices.
 
 config ALTERA_FREEZE_BRIDGE
 	tristate "Altera FPGA Freeze Bridge"
-	depends on ARCH_SOCFPGA && FPGA_BRIDGE
+	depends on FPGA_BRIDGE
 	help
 	  Say Y to enable drivers for Altera FPGA Freeze bridges.  A
 	  freeze bridge is a bridge that exists in the FPGA fabric to