]> git.ipfire.org Git - thirdparty/openvpn.git/commit
polarssl: optimize polar_ok() for non-errors
authorSteffan Karger <steffan.karger@fox-it.com>
Thu, 7 Jan 2016 09:15:16 +0000 (10:15 +0100)
committerGert Doering <gert@greenie.muc.de>
Thu, 7 Jan 2016 10:07:23 +0000 (11:07 +0100)
commit3a39bf7dfe5a57fe8bc43c073b2a009bb6994e78
tree7a4238c9f0468c95ce8dbb471590191e47728003
parentaa416be9500441313c703ad7cb848c289378bbd3
polarssl: optimize polar_ok() for non-errors

Adding polar_ok() was a good plan for improving error reporting, but also
added two function calls (one to polar_log_func_line() and one to
polar_log_err()) for each function call wrapped with polar_ok().
Especially in the critical path, this is a waste of time.

To avoid this overhead, add a simple static inline wrapper to reduce it to
a single branch.

v2 - use a static inline wrapper to prevent evaluating 'errval' twice in
     the macro.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1452158116-17363-1-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10949
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto_polarssl.h