diff mbox series

MIPS: octeon: Include required header; fix octeon ethernet build

Message ID 20191001215622.4173931-1-paul.burton@mips.com (mailing list archive)
State Mainlined
Commit 0228ecf6128c92b47eadd2ac270c5574d9150c09
Headers show
Series MIPS: octeon: Include required header; fix octeon ethernet build | expand

Commit Message

Paul Burton Oct. 1, 2019, 9:56 p.m. UTC
Commit 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") moved
the inclusion of a bunch of headers by various files in the Octeon
ethernet driver into a common header, but in doing so it changed the
order in which those headers are included.

Prior to the referenced commit drivers/staging/octeon/ethernet.c
included asm/octeon/cvmx-pip.h before asm/octeon/cvmx-ipd.h, which makes
use of the CVMX_PIP_SFT_RST definition pulled in by the former. After
commit 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") we
pull in asm/octeon/cvmx-ipd.h first & builds fail with:

  In file included from drivers/staging/octeon/octeon-ethernet.h:27,
                   from drivers/staging/octeon/ethernet.c:22:
  arch/mips/include/asm/octeon/cvmx-ipd.h: In function 'cvmx_ipd_free_ptr':
  arch/mips/include/asm/octeon/cvmx-ipd.h:330:27: error: storage size of
    'pip_sft_rst' isn't known
      union cvmx_pip_sft_rst pip_sft_rst;
                             ^~~~~~~~~~~
  arch/mips/include/asm/octeon/cvmx-ipd.h:331:36: error: 'CVMX_PIP_SFT_RST'
    undeclared (first use in this function); did you mean 'CVMX_CIU_SOFT_RST'?
      pip_sft_rst.u64 = cvmx_read_csr(CVMX_PIP_SFT_RST);
                                      ^~~~~~~~~~~~~~~~
                                      CVMX_CIU_SOFT_RST
  arch/mips/include/asm/octeon/cvmx-ipd.h:331:36: note: each undeclared
    identifier is reported only once for each function it appears in
  arch/mips/include/asm/octeon/cvmx-ipd.h:330:27: warning: unused variable
    'pip_sft_rst' [-Wunused-variable]
      union cvmx_pip_sft_rst pip_sft_rst;
                             ^~~~~~~~~~~
  make[4]: *** [scripts/Makefile.build:266: drivers/staging/octeon/ethernet.o]
    Error 1
  make[3]: *** [scripts/Makefile.build:509: drivers/staging/octeon] Error 2

Fix this by having asm/octeon/cvmx-ipd.h include the
asm/octeon/cvmx-pip-defs.h header that it is reliant upon, rather than
requiring its users to pull in that header before it.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS")
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
---

 arch/mips/include/asm/octeon/cvmx-ipd.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Paul Burton Oct. 2, 2019, 5:14 p.m. UTC | #1
Hello,

Paul Burton wrote:
> Commit 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") moved
> the inclusion of a bunch of headers by various files in the Octeon
> ethernet driver into a common header, but in doing so it changed the
> order in which those headers are included.
> 
> Prior to the referenced commit drivers/staging/octeon/ethernet.c
> included asm/octeon/cvmx-pip.h before asm/octeon/cvmx-ipd.h, which makes
> use of the CVMX_PIP_SFT_RST definition pulled in by the former. After
> commit 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") we
> pull in asm/octeon/cvmx-ipd.h first & builds fail with:
> 
>   In file included from drivers/staging/octeon/octeon-ethernet.h:27,
>                    from drivers/staging/octeon/ethernet.c:22:
>   arch/mips/include/asm/octeon/cvmx-ipd.h: In function 'cvmx_ipd_free_ptr':
>   arch/mips/include/asm/octeon/cvmx-ipd.h:330:27: error: storage size of
>     'pip_sft_rst' isn't known
>       union cvmx_pip_sft_rst pip_sft_rst;
>                              ^~~~~~~~~~~
>   arch/mips/include/asm/octeon/cvmx-ipd.h:331:36: error: 'CVMX_PIP_SFT_RST'
>     undeclared (first use in this function); did you mean 'CVMX_CIU_SOFT_RST'?
>       pip_sft_rst.u64 = cvmx_read_csr(CVMX_PIP_SFT_RST);
>                                       ^~~~~~~~~~~~~~~~
>                                       CVMX_CIU_SOFT_RST
>   arch/mips/include/asm/octeon/cvmx-ipd.h:331:36: note: each undeclared
>     identifier is reported only once for each function it appears in
>   arch/mips/include/asm/octeon/cvmx-ipd.h:330:27: warning: unused variable
>     'pip_sft_rst' [-Wunused-variable]
>       union cvmx_pip_sft_rst pip_sft_rst;
>                              ^~~~~~~~~~~
>   make[4]: *** [scripts/Makefile.build:266: drivers/staging/octeon/ethernet.o]
>     Error 1
>   make[3]: *** [scripts/Makefile.build:509: drivers/staging/octeon] Error 2
> 
> Fix this by having asm/octeon/cvmx-ipd.h include the
> asm/octeon/cvmx-pip-defs.h header that it is reliant upon, rather than
> requiring its users to pull in that header before it.

Applied to mips-fixes.

> commit 0228ecf6128c
> https://git.kernel.org/mips/c/0228ecf6128c
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>
> Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS")

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/include/asm/octeon/cvmx-ipd.h b/arch/mips/include/asm/octeon/cvmx-ipd.h
index cbdc14b77435..adab7b54c3b4 100644
--- a/arch/mips/include/asm/octeon/cvmx-ipd.h
+++ b/arch/mips/include/asm/octeon/cvmx-ipd.h
@@ -36,6 +36,7 @@ 
 #include <asm/octeon/octeon-feature.h>
 
 #include <asm/octeon/cvmx-ipd-defs.h>
+#include <asm/octeon/cvmx-pip-defs.h>
 
 enum cvmx_ipd_mode {
    CVMX_IPD_OPC_MODE_STT = 0LL,	  /* All blocks DRAM, not cached in L2 */