Skip to content

Commit 9c6bd0c

Browse files
arndbherbertx
authored andcommitted
lib/mpi: use "static inline" instead of "extern inline"
When we use CONFIG_PROFILE_ALL_BRANCHES, every 'if()' introduces a static variable, but that is not allowed in 'extern inline' functions: mpi-inline.h:116:204: warning: '______f' is static but declared in inline function 'mpihelp_sub' which is not static mpi-inline.h:113:184: warning: '______f' is static but declared in inline function 'mpihelp_sub' which is not static mpi-inline.h:70:184: warning: '______f' is static but declared in inline function 'mpihelp_add' which is not static mpi-inline.h:56:204: warning: '______f' is static but declared in inline function 'mpihelp_add_1' which is not static This changes the MPI code to use 'static inline' instead, to get rid of hundreds of warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent c5d5524 commit 9c6bd0c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/mpi/mpi-inline.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define G10_MPI_INLINE_H
3131

3232
#ifndef G10_MPI_INLINE_DECL
33-
#define G10_MPI_INLINE_DECL extern inline
33+
#define G10_MPI_INLINE_DECL static inline
3434
#endif
3535

3636
G10_MPI_INLINE_DECL mpi_limb_t

lib/mpi/mpi-internal.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,19 @@ void mpi_rshift_limbs(MPI a, unsigned int count);
168168
int mpi_lshift_limbs(MPI a, unsigned int count);
169169

170170
/*-- mpihelp-add.c --*/
171-
mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
171+
static inline mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
172172
mpi_size_t s1_size, mpi_limb_t s2_limb);
173173
mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
174174
mpi_ptr_t s2_ptr, mpi_size_t size);
175-
mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
175+
static inline mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
176176
mpi_ptr_t s2_ptr, mpi_size_t s2_size);
177177

178178
/*-- mpihelp-sub.c --*/
179-
mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
179+
static inline mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
180180
mpi_size_t s1_size, mpi_limb_t s2_limb);
181181
mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
182182
mpi_ptr_t s2_ptr, mpi_size_t size);
183-
mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
183+
static inline mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
184184
mpi_ptr_t s2_ptr, mpi_size_t s2_size);
185185

186186
/*-- mpihelp-cmp.c --*/

0 commit comments

Comments
 (0)