@@ -52,17 +52,17 @@ static int wolfkmod_init(void)
5252 ret = wolfCrypt_Init ();
5353 if (ret != 0 ) {
5454 printf ("error: wolfCrypt_Init failed: %s\n" , wc_GetErrorString (ret ));
55- return - ECANCELED ;
55+ return ( ECANCELED ) ;
5656 }
5757 #else
5858 ret = wolfSSL_Init ();
5959 if (ret != WOLFSSL_SUCCESS ) {
6060 printf ("error: wolfSSL_Init failed: %s\n" , wc_GetErrorString (ret ));
61- return - ECANCELED ;
61+ return ( ECANCELED ) ;
6262 }
6363 #endif
6464
65- return ret ;
65+ return ( 0 ) ;
6666}
6767
6868static int wolfkmod_cleanup (void )
@@ -73,25 +73,21 @@ static int wolfkmod_cleanup(void)
7373 ret = wolfCrypt_Cleanup ();
7474 if (ret != 0 ) {
7575 printf ("error: wolfCrypt_Cleanup failed: %s\n" , wc_GetErrorString (ret ));
76- }
77- else {
78- #if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG )
79- printf ("info: wolfCrypt " LIBWOLFSSL_VERSION_STRING " cleanup complete.\n" );
80- #endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
76+ return (ECANCELED );
8177 }
8278 #else
8379 ret = wolfSSL_Cleanup ();
8480 if (ret != WOLFSSL_SUCCESS ) {
8581 printf ("error: wolfSSL_Cleanup failed: %s\n" , wc_GetErrorString (ret ));
82+ return (ECANCELED );
8683 }
87- else {
88- #if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG )
89- printf ("info: wolfSSL " LIBWOLFSSL_VERSION_STRING " cleanup complete.\n" );
90- #endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
91- }
92- #endif
84+ #endif /* WOLFCRYPT_ONLY */
9385
94- return ret ;
86+ #if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG )
87+ printf ("info: libwolfssl " LIBWOLFSSL_VERSION_STRING " cleanup complete.\n" );
88+ #endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
89+
90+ return (0 );
9591}
9692
9793static int wolfkmod_load (void )
@@ -100,33 +96,29 @@ static int wolfkmod_load(void)
10096
10197 ret = wolfkmod_init ();
10298 if (ret != 0 ) {
103- return - ECANCELED ;
99+ return ( ECANCELED ) ;
104100 }
105101
106102 #ifndef NO_CRYPT_TEST
107103 ret = wolfcrypt_test (NULL );
108104 if (ret != 0 ) {
109105 printf ("error: wolfcrypt test failed with return code: %d\n" , ret );
110106 (void )wolfkmod_cleanup ();
111- return - ECANCELED ;
112- }
113- else {
114- #if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG )
115- printf ("wolfCrypt self-test passed.\n" );
116- #endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
107+ return (ECANCELED );
117108 }
109+ #if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG )
110+ printf ("info: wolfCrypt self-test passed.\n" );
111+ #endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
118112 #endif /* NO_CRYPT_TEST */
119113
120114 /**
121115 * todo: register wolfcrypt algs here with crypto_get_driverid
122116 * and related.
123117 * */
124118
125- if (ret == 0 ) {
126- printf ("info: libwolfssl loaded\n" );
127- }
119+ printf ("info: libwolfssl loaded\n" );
128120
129- return ret ;
121+ return ( 0 ) ;
130122}
131123
132124static int wolfkmod_unload (void )
@@ -144,7 +136,7 @@ static int wolfkmod_unload(void)
144136 printf ("info: libwolfssl unloaded\n" );
145137 }
146138
147- return ret ;
139+ return ( ret ) ;
148140}
149141
150142/* see /usr/include/sys/module.h for more info. */
@@ -172,7 +164,7 @@ wolfkmod_event(struct module * m, int what, void * arg)
172164 (void )m ;
173165 (void )arg ;
174166
175- return ret ;
167+ return ( ret ) ;
176168}
177169
178170static moduledata_t libwolfmod = {
0 commit comments