diff mbox series

[v2,5/7] btrfs-progs: crypto/sha: declare the x86 optimized implementation

Message ID dea5a7974e136142599c57de28aa2cdd0a49896c.1683093416.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: fix -Wmissing-prototypes warnings and enable that warning option | expand

Commit Message

Qu Wenruo May 3, 2023, 6:03 a.m. UTC
The optimized implementation sha256_process_x86() is not declared
anywhere, this can be caught by -Wmissing-prototypes option.

Just declare it properly in sha.h.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 crypto/sha.h        | 3 +++
 crypto/sha256-x86.c | 2 ++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/crypto/sha.h b/crypto/sha.h
index e65418ccd0d3..ea387c212dc6 100644
--- a/crypto/sha.h
+++ b/crypto/sha.h
@@ -211,4 +211,7 @@  extern int hmacResult(HMACContext *context,
 
 void sha256_init_accel(void);
 
+/* Export for optimized version to silent -Wmissing-prototypes. */
+void sha256_process_x86(uint32_t state[8], const uint8_t data[], uint32_t length);
+
 #endif /* _SHA_H_ */
diff --git a/crypto/sha256-x86.c b/crypto/sha256-x86.c
index 602c53cf4f60..57be3f0db38f 100644
--- a/crypto/sha256-x86.c
+++ b/crypto/sha256-x86.c
@@ -13,6 +13,8 @@ 
 # include <x86intrin.h>
 #endif
 
+#include "sha.h"
+
 /* Process multiple blocks. The caller is responsible for setting the initial */
 /*  state, and the caller is responsible for padding the final block.        */
 void sha256_process_x86(uint32_t state[8], const uint8_t data[], uint32_t length)