diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-02-26 07:46:27 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-02-27 14:26:34 -0500 |
commit | 9c6bd0c2f103f4748cb4abcaf141f7d11aabfe9f (patch) | |
tree | 178d424cb723b82e2ab2393e0806ab18bb1cf8a7 | |
parent | c5d552487b9eb116b61032239ffb2f8d192f19b8 (diff) |
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>
-rw-r--r-- | lib/mpi/mpi-inline.h | 2 | ||||
-rw-r--r-- | lib/mpi/mpi-internal.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/mpi/mpi-inline.h b/lib/mpi/mpi-inline.h index e2b39852b30a..c245ea31f785 100644 --- a/lib/mpi/mpi-inline.h +++ b/lib/mpi/mpi-inline.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #define G10_MPI_INLINE_H | 30 | #define G10_MPI_INLINE_H |
31 | 31 | ||
32 | #ifndef G10_MPI_INLINE_DECL | 32 | #ifndef G10_MPI_INLINE_DECL |
33 | #define G10_MPI_INLINE_DECL extern inline | 33 | #define G10_MPI_INLINE_DECL static inline |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | G10_MPI_INLINE_DECL mpi_limb_t | 36 | G10_MPI_INLINE_DECL mpi_limb_t |
diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h index c65dd1bff45a..7eceeddb3fb8 100644 --- a/lib/mpi/mpi-internal.h +++ b/lib/mpi/mpi-internal.h | |||
@@ -168,19 +168,19 @@ void mpi_rshift_limbs(MPI a, unsigned int count); | |||
168 | int mpi_lshift_limbs(MPI a, unsigned int count); | 168 | int mpi_lshift_limbs(MPI a, unsigned int count); |
169 | 169 | ||
170 | /*-- mpihelp-add.c --*/ | 170 | /*-- 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, |
172 | mpi_size_t s1_size, mpi_limb_t s2_limb); | 172 | mpi_size_t s1_size, mpi_limb_t s2_limb); |
173 | mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, | 173 | mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, |
174 | mpi_ptr_t s2_ptr, mpi_size_t size); | 174 | 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, |
176 | mpi_ptr_t s2_ptr, mpi_size_t s2_size); | 176 | mpi_ptr_t s2_ptr, mpi_size_t s2_size); |
177 | 177 | ||
178 | /*-- mpihelp-sub.c --*/ | 178 | /*-- 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, |
180 | mpi_size_t s1_size, mpi_limb_t s2_limb); | 180 | mpi_size_t s1_size, mpi_limb_t s2_limb); |
181 | mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, | 181 | mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, |
182 | mpi_ptr_t s2_ptr, mpi_size_t size); | 182 | 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, |
184 | mpi_ptr_t s2_ptr, mpi_size_t s2_size); | 184 | mpi_ptr_t s2_ptr, mpi_size_t s2_size); |
185 | 185 | ||
186 | /*-- mpihelp-cmp.c --*/ | 186 | /*-- mpihelp-cmp.c --*/ |