[01/16] xtensa: FSF: define XCHAL_HAVE_DIV32

Message ID 20230920052139.10570-2-rdunlap@infradead.org
State New
Headers
Series xtensa: fix W=1 build warnings |

Commit Message

Randy Dunlap Sept. 20, 2023, 5:21 a.m. UTC
  When variant FSF is set, XCHAL_HAVE_DIV32 is not defined,
so add the define for FSF to prevent build warnings:

arch/xtensa/lib/divsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
    9 | #if XCHAL_HAVE_DIV32
arch/xtensa/lib/modsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
    9 | #if XCHAL_HAVE_DIV32

Fixes: 173d6681380a ("xtensa: remove extra header files")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: lore.kernel.org/r/202309150556.t0yCdv3g-lkp@intel.com
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/variants/fsf/include/variant/core.h |    1 +
 1 file changed, 1 insertion(+)
  

Comments

Max Filippov Sept. 20, 2023, 11:53 a.m. UTC | #1
On Tue, Sep 19, 2023 at 10:21 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> When variant FSF is set, XCHAL_HAVE_DIV32 is not defined,
> so add the define for FSF to prevent build warnings:
>
> arch/xtensa/lib/divsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
>     9 | #if XCHAL_HAVE_DIV32
> arch/xtensa/lib/modsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
>     9 | #if XCHAL_HAVE_DIV32
>
> Fixes: 173d6681380a ("xtensa: remove extra header files")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: lore.kernel.org/r/202309150556.t0yCdv3g-lkp@intel.com
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  arch/xtensa/variants/fsf/include/variant/core.h |    1 +
>  1 file changed, 1 insertion(+)

If this configuration overlay doesn't define that macro then other
configurations
from that era may have similar issue. I've posted a different fix that
adds a default
definition for XCHAL_HAVE_DIV32 to asm/core.h instead.
  

Patch

diff -- a/arch/xtensa/variants/fsf/include/variant/core.h b/arch/xtensa/variants/fsf/include/variant/core.h
--- a/arch/xtensa/variants/fsf/include/variant/core.h
+++ b/arch/xtensa/variants/fsf/include/variant/core.h
@@ -41,6 +41,7 @@ 
 #define XCHAL_HAVE_MUL16		0	/* MUL16S/MUL16U instructions */
 #define XCHAL_HAVE_MUL32		0	/* MULL instruction */
 #define XCHAL_HAVE_MUL32_HIGH		0	/* MULUH/MULSH instructions */
+#define XCHAL_HAVE_DIV32		0	/* QUOS/QUOU/REMS/REMU instructions */
 #define XCHAL_HAVE_L32R			1	/* L32R instruction */
 #define XCHAL_HAVE_ABSOLUTE_LITERALS	1	/* non-PC-rel (extended) L32R */
 #define XCHAL_HAVE_CONST16		0	/* CONST16 instruction */