]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix Linux kernel coding style warning
authorDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sat, 17 Jul 2021 09:24:58 +0000 (11:24 +0200)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Mon, 19 Jul 2021 04:49:52 +0000 (06:49 +0200)
Single statement macros should not use a do {} while (0) loop

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
jni.c
openssl.c
yubikey.c

diff --git a/jni.c b/jni.c
index a1e047b50bc77e01554bfe32cc17520207ae3449..5f71e9cda536e1e770c0abd5e37dc2a8bc814110 100644 (file)
--- a/jni.c
+++ b/jni.c
@@ -51,7 +51,7 @@ static void throw_excep(JNIEnv *jenv, const char *exc, int line)
                (*jenv)->ThrowNew(jenv, excep, msg);
 }
 
-#define OOM(jenv)      do { throw_excep(jenv, "java/lang/OutOfMemoryError", __LINE__); } while (0)
+#define OOM(jenv)      throw_excep(jenv, "java/lang/OutOfMemoryError", __LINE__)
 
 static struct libctx *getctx(JNIEnv *jenv, jobject jobj)
 {
index 1248da4e4dfc4a780ea11a0a5fdc2da14bad49f1..0d282fa696f28f94860595a323256176e071ffad 100644 (file)
--- a/openssl.c
+++ b/openssl.c
@@ -1472,7 +1472,7 @@ static int match_cert_hostname(struct openconnect_info *vpninfo, X509 *peer_cert
 /* Before OpenSSL 1.1 we could do this directly. And needed to. */
 #ifndef SSL_CTX_get_extra_chain_certs_only
 #define SSL_CTX_get_extra_chain_certs_only(ctx, st) \
-       do { *(st) = (ctx)->extra_certs; } while(0)
+       (void)(*(st) = (ctx)->extra_certs)
 #endif
 
 static void workaround_openssl_certchain_bug(struct openconnect_info *vpninfo,
index 024bb7491649a51bc600be1d1bf0a33db8f634cc..dbe6fbf25dfbff51ac67f39c578a5a55be86fc80 100644 (file)
--- a/yubikey.c
+++ b/yubikey.c
@@ -55,7 +55,7 @@ static const unsigned char send_remaining[] = { 0x00, SEND_REMAINING_INS, 0x00,
 #define free_scard_error(str) free(str)
 #else
 #define scard_error(st) ((char *)pcsc_stringify_error(st))
-#define free_scard_error(str) do { ; } while (0)
+#define free_scard_error(str)
 
 #endif