linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: jitter - add header to fix buildwarnings
@ 2019-10-09  9:12 Ben Dooks
  2019-10-09  9:22 ` Stephan Mueller
  2019-10-18  8:02 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Dooks @ 2019-10-09  9:12 UTC (permalink / raw)
  To: linux-crypto, linux-kernel; +Cc: davem, herbert, linux-kernel, Ben Dooks

Fix the following build warnings by adding a header for
the definitions shared between jitterentropy.c and
jitterentropy-kcapi.c. Fixes the following:

crypto/jitterentropy.c:445:5: warning: symbol 'jent_read_entropy' was not declared. Should it be static?
crypto/jitterentropy.c:475:18: warning: symbol 'jent_entropy_collector_alloc' was not declared. Should it be static?
crypto/jitterentropy.c:509:6: warning: symbol 'jent_entropy_collector_free' was not declared. Should it be static?
crypto/jitterentropy.c:516:5: warning: symbol 'jent_entropy_init' was not declared. Should it be static?
crypto/jitterentropy-kcapi.c:59:6: warning: symbol 'jent_zalloc' was not declared. Should it be static?
crypto/jitterentropy-kcapi.c:64:6: warning: symbol 'jent_zfree' was not declared. Should it be static?
crypto/jitterentropy-kcapi.c:69:5: warning: symbol 'jent_fips_enabled' was not declared. Should it be static?
crypto/jitterentropy-kcapi.c:74:6: warning: symbol 'jent_panic' was not declared. Should it be static?
crypto/jitterentropy-kcapi.c:79:6: warning: symbol 'jent_memcpy' was not declared. Should it be static?
crypto/jitterentropy-kcapi.c:93:6: warning: symbol 'jent_get_nstime' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 crypto/jitterentropy-kcapi.c |  8 +-------
 crypto/jitterentropy.c       |  7 +------
 crypto/jitterentropy.h       | 17 +++++++++++++++++
 3 files changed, 19 insertions(+), 13 deletions(-)
 create mode 100644 crypto/jitterentropy.h

diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c
index 701b8d86ab49..a5ce8f96790f 100644
--- a/crypto/jitterentropy-kcapi.c
+++ b/crypto/jitterentropy-kcapi.c
@@ -44,13 +44,7 @@
 #include <linux/crypto.h>
 #include <crypto/internal/rng.h>
 
-struct rand_data;
-int jent_read_entropy(struct rand_data *ec, unsigned char *data,
-		      unsigned int len);
-int jent_entropy_init(void);
-struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
-					       unsigned int flags);
-void jent_entropy_collector_free(struct rand_data *entropy_collector);
+#include "jitterentropy.h"
 
 /***************************************************************************
  * Helper function
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index 77fa2120fe0c..e342db4084d3 100644
--- a/crypto/jitterentropy.c
+++ b/crypto/jitterentropy.c
@@ -103,12 +103,7 @@ struct rand_data {
  * Helper functions
  ***************************************************************************/
 
-void jent_get_nstime(__u64 *out);
-void *jent_zalloc(unsigned int len);
-void jent_zfree(void *ptr);
-int jent_fips_enabled(void);
-void jent_panic(char *s);
-void jent_memcpy(void *dest, const void *src, unsigned int n);
+#include "jitterentropy.h"
 
 /**
  * Update of the loop count used for the next round of
diff --git a/crypto/jitterentropy.h b/crypto/jitterentropy.h
new file mode 100644
index 000000000000..c83fff32d130
--- /dev/null
+++ b/crypto/jitterentropy.h
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+extern void *jent_zalloc(unsigned int len);
+extern void jent_zfree(void *ptr);
+extern int jent_fips_enabled(void);
+extern void jent_panic(char *s);
+extern void jent_memcpy(void *dest, const void *src, unsigned int n);
+extern void jent_get_nstime(__u64 *out);
+
+struct rand_data;
+extern int jent_entropy_init(void);
+extern int jent_read_entropy(struct rand_data *ec, unsigned char *data,
+			     unsigned int len);
+
+extern struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
+						      unsigned int flags);
+extern void jent_entropy_collector_free(struct rand_data *entropy_collector);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: jitter - add header to fix buildwarnings
  2019-10-09  9:12 [PATCH] crypto: jitter - add header to fix buildwarnings Ben Dooks
@ 2019-10-09  9:22 ` Stephan Mueller
  2019-10-18  8:02 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Stephan Mueller @ 2019-10-09  9:22 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-crypto, linux-kernel, davem, herbert, linux-kernel

Am Mittwoch, 9. Oktober 2019, 11:12:56 CEST schrieb Ben Dooks:

Hi Ben,

> Fix the following build warnings by adding a header for
> the definitions shared between jitterentropy.c and
> jitterentropy-kcapi.c. Fixes the following:
> 
> crypto/jitterentropy.c:445:5: warning: symbol 'jent_read_entropy' was not
> declared. Should it be static? crypto/jitterentropy.c:475:18: warning:
> symbol 'jent_entropy_collector_alloc' was not declared. Should it be
> static? crypto/jitterentropy.c:509:6: warning: symbol
> 'jent_entropy_collector_free' was not declared. Should it be static?
> crypto/jitterentropy.c:516:5: warning: symbol 'jent_entropy_init' was not
> declared. Should it be static? crypto/jitterentropy-kcapi.c:59:6: warning:
> symbol 'jent_zalloc' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:64:6: warning: symbol 'jent_zfree' was not
> declared. Should it be static? crypto/jitterentropy-kcapi.c:69:5: warning:
> symbol 'jent_fips_enabled' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:74:6: warning: symbol 'jent_panic' was not
> declared. Should it be static? crypto/jitterentropy-kcapi.c:79:6: warning:
> symbol 'jent_memcpy' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:93:6: warning: symbol 'jent_get_nstime' was
> not declared. Should it be static?
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Reviewed-by: Stephan Mueller <smueller@chronox.de

Ciao
Stephan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: jitter - add header to fix buildwarnings
  2019-10-09  9:12 [PATCH] crypto: jitter - add header to fix buildwarnings Ben Dooks
  2019-10-09  9:22 ` Stephan Mueller
@ 2019-10-18  8:02 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2019-10-18  8:02 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-crypto, linux-kernel, davem, linux-kernel

On Wed, Oct 09, 2019 at 10:12:56AM +0100, Ben Dooks wrote:
> Fix the following build warnings by adding a header for
> the definitions shared between jitterentropy.c and
> jitterentropy-kcapi.c. Fixes the following:
> 
> crypto/jitterentropy.c:445:5: warning: symbol 'jent_read_entropy' was not declared. Should it be static?
> crypto/jitterentropy.c:475:18: warning: symbol 'jent_entropy_collector_alloc' was not declared. Should it be static?
> crypto/jitterentropy.c:509:6: warning: symbol 'jent_entropy_collector_free' was not declared. Should it be static?
> crypto/jitterentropy.c:516:5: warning: symbol 'jent_entropy_init' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:59:6: warning: symbol 'jent_zalloc' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:64:6: warning: symbol 'jent_zfree' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:69:5: warning: symbol 'jent_fips_enabled' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:74:6: warning: symbol 'jent_panic' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:79:6: warning: symbol 'jent_memcpy' was not declared. Should it be static?
> crypto/jitterentropy-kcapi.c:93:6: warning: symbol 'jent_get_nstime' was not declared. Should it be static?
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  crypto/jitterentropy-kcapi.c |  8 +-------
>  crypto/jitterentropy.c       |  7 +------
>  crypto/jitterentropy.h       | 17 +++++++++++++++++
>  3 files changed, 19 insertions(+), 13 deletions(-)
>  create mode 100644 crypto/jitterentropy.h

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-18  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09  9:12 [PATCH] crypto: jitter - add header to fix buildwarnings Ben Dooks
2019-10-09  9:22 ` Stephan Mueller
2019-10-18  8:02 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).