From d152937516f2a142f4514aa27036176c70b4a365 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Sat, 17 Jul 2021 11:24:58 +0200 Subject: [PATCH] Fix Linux kernel coding style warning Single statement macros should not use a do {} while (0) loop Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> --- jni.c | 2 +- openssl.c | 2 +- yubikey.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jni.c b/jni.c index a1e047b5..5f71e9cd 100644 --- 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) { diff --git a/openssl.c b/openssl.c index 1248da4e..0d282fa6 100644 --- 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, diff --git a/yubikey.c b/yubikey.c index 024bb749..dbe6fbf2 100644 --- 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 -- 2.50.1