diff mbox series

libgcc: Add forward declarations for generic library routines

Message ID 5cdbe08296693dd53849f199c3933e16e97b33c1.1682088593.git.geert+renesas@glider.be (mailing list archive)
State Accepted
Commit 4f20b7471c57032860065591a17efd3325216bde
Headers show
Series libgcc: Add forward declarations for generic library routines | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD 310c33dc7a12
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 1 and now 1
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 19 this patch: 18
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 20 this patch: 18
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Geert Uytterhoeven April 21, 2023, 2:54 p.m. UTC
With W=1 on platforms that use the generic gcc library routines
(csky/loongarch/mips/riscv/sh/xtensa):

    lib/ashldi3.c:9:19: warning: no previous prototype for '__ashldi3' [-Wmissing-prototypes]
	9 | long long notrace __ashldi3(long long u, word_type b)
	  |                   ^~~~~~~~~
      CC      lib/ashrdi3.o
    lib/ashrdi3.c:9:19: warning: no previous prototype for '__ashrdi3' [-Wmissing-prototypes]
	9 | long long notrace __ashrdi3(long long u, word_type b)
	  |                   ^~~~~~~~~
      CC      lib/cmpdi2.o
    lib/cmpdi2.c:9:19: warning: no previous prototype for '__cmpdi2' [-Wmissing-prototypes]
	9 | word_type notrace __cmpdi2(long long a, long long b)
	  |                   ^~~~~~~~
      CC      lib/lshrdi3.o
    lib/lshrdi3.c:9:19: warning: no previous prototype for '__lshrdi3' [-Wmissing-prototypes]
	9 | long long notrace __lshrdi3(long long u, word_type b)
	  |                   ^~~~~~~~~
      CC      lib/muldi3.o
    lib/muldi3.c:49:19: warning: no previous prototype for '__muldi3' [-Wmissing-prototypes]
       49 | long long notrace __muldi3(long long u, long long v)
	  |                   ^~~~~~~~
      CC      lib/ucmpdi2.o
    lib/ucmpdi2.c:8:19: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes]
	8 | word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
	  |                   ^~~~~~~~~

Fix this by adding forward declarations to the common libgcc header
file.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303272214.RxzpA6bP-lkp@intel.com/
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 include/linux/libgcc.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Arnd Bergmann April 21, 2023, 8:38 p.m. UTC | #1
On Fri, Apr 21, 2023, at 16:54, Geert Uytterhoeven wrote:
> With W=1 on platforms that use the generic gcc library routines
> (csky/loongarch/mips/riscv/sh/xtensa):
>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202303272214.RxzpA6bP-lkp@intel.com/
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Nice, this is one I don't have in my series,

Acked-by: Arnd Bergmann <arnd@arndb.de>

I have patches for a lot of other missing prototype warnings, plan
to send them out after -rc1.

      Arnd
Palmer Dabbelt April 29, 2023, 8:20 p.m. UTC | #2
On Fri, 21 Apr 2023 13:38:52 PDT (-0700), Arnd Bergmann wrote:
> On Fri, Apr 21, 2023, at 16:54, Geert Uytterhoeven wrote:
>> With W=1 on platforms that use the generic gcc library routines
>> (csky/loongarch/mips/riscv/sh/xtensa):
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Link: https://lore.kernel.org/oe-kbuild-all/202303272214.RxzpA6bP-lkp@intel.com/
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Nice, this is one I don't have in my series,
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> I have patches for a lot of other missing prototype warnings, plan
> to send them out after -rc1.

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

I think I've merged some stuff around here before, but it's probably 
better for some more generic tree?  LMK if you guys wanted me to pick 
these up, though, I've got a smattering of small stuff already so I'll 
have another PR either way.
Geert Uytterhoeven April 30, 2023, 1:03 p.m. UTC | #3
Hi Palmer,

On Sat, Apr 29, 2023 at 10:20 PM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> On Fri, 21 Apr 2023 13:38:52 PDT (-0700), Arnd Bergmann wrote:
> > On Fri, Apr 21, 2023, at 16:54, Geert Uytterhoeven wrote:
> >> With W=1 on platforms that use the generic gcc library routines
> >> (csky/loongarch/mips/riscv/sh/xtensa):
> >>
> >> Reported-by: kernel test robot <lkp@intel.com>
> >> Link: https://lore.kernel.org/oe-kbuild-all/202303272214.RxzpA6bP-lkp@intel.com/
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > Nice, this is one I don't have in my series,
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > I have patches for a lot of other missing prototype warnings, plan
> > to send them out after -rc1.
>
> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

Thanks!

> I think I've merged some stuff around here before, but it's probably
> better for some more generic tree?  LMK if you guys wanted me to pick
> these up, though, I've got a smattering of small stuff already so I'll
> have another PR either way.

Too late ;-) Already upstream via akpm's tree.

Gr{oetje,eeting}s,

                        Geert
patchwork-bot+linux-riscv@kernel.org May 8, 2023, 2:41 p.m. UTC | #4
Hello:

This patch was applied to riscv/linux.git (fixes)
by Andrew Morton <akpm@linux-foundation.org>:

On Fri, 21 Apr 2023 16:54:24 +0200 you wrote:
> With W=1 on platforms that use the generic gcc library routines
> (csky/loongarch/mips/riscv/sh/xtensa):
> 
>     lib/ashldi3.c:9:19: warning: no previous prototype for '__ashldi3' [-Wmissing-prototypes]
> 	9 | long long notrace __ashldi3(long long u, word_type b)
> 	  |                   ^~~~~~~~~
>       CC      lib/ashrdi3.o
>     lib/ashrdi3.c:9:19: warning: no previous prototype for '__ashrdi3' [-Wmissing-prototypes]
> 	9 | long long notrace __ashrdi3(long long u, word_type b)
> 	  |                   ^~~~~~~~~
>       CC      lib/cmpdi2.o
>     lib/cmpdi2.c:9:19: warning: no previous prototype for '__cmpdi2' [-Wmissing-prototypes]
> 	9 | word_type notrace __cmpdi2(long long a, long long b)
> 	  |                   ^~~~~~~~
>       CC      lib/lshrdi3.o
>     lib/lshrdi3.c:9:19: warning: no previous prototype for '__lshrdi3' [-Wmissing-prototypes]
> 	9 | long long notrace __lshrdi3(long long u, word_type b)
> 	  |                   ^~~~~~~~~
>       CC      lib/muldi3.o
>     lib/muldi3.c:49:19: warning: no previous prototype for '__muldi3' [-Wmissing-prototypes]
>        49 | long long notrace __muldi3(long long u, long long v)
> 	  |                   ^~~~~~~~
>       CC      lib/ucmpdi2.o
>     lib/ucmpdi2.c:8:19: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes]
> 	8 | word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
> 	  |                   ^~~~~~~~~
> 
> [...]

Here is the summary with links:
  - libgcc: Add forward declarations for generic library routines
    https://git.kernel.org/riscv/c/4f20b7471c57

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/linux/libgcc.h b/include/linux/libgcc.h
index b8dc75f0c8308bd4..fc388da6a027faaf 100644
--- a/include/linux/libgcc.h
+++ b/include/linux/libgcc.h
@@ -27,4 +27,11 @@  typedef union {
 	long long ll;
 } DWunion;
 
+long long notrace __ashldi3(long long u, word_type b);
+long long notrace __ashrdi3(long long u, word_type b);
+word_type notrace __cmpdi2(long long a, long long b);
+long long notrace __lshrdi3(long long u, word_type b);
+long long notrace __muldi3(long long u, long long v);
+word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b);
+
 #endif /* __ASM_LIBGCC_H */