From 5786ec4ac183fce74e66439b91497b8da86d7740 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sun, 31 Jul 2016 09:59:34 +0200 Subject: CAN: Simplify debug error message generation The warning is already shown in PeakCanBusPlugin::createDevice() and TinyCanBusPlugin::createDevice() so it does not need to be done here. Change-Id: Ifac34d9b96eff5920d09f3c971caeda62d97839a Reviewed-by: Denis Shienkov Reviewed-by: Alex Blasche --- src/plugins/canbus/tinycan/tinycan_symbols_p.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/plugins/canbus/tinycan') diff --git a/src/plugins/canbus/tinycan/tinycan_symbols_p.h b/src/plugins/canbus/tinycan/tinycan_symbols_p.h index 5ad149c..6e05b92 100644 --- a/src/plugins/canbus/tinycan/tinycan_symbols_p.h +++ b/src/plugins/canbus/tinycan/tinycan_symbols_p.h @@ -285,7 +285,7 @@ typedef void (DRV_CALLBACK_TYPE *CanRxEventCallback)( static fp_##symbolName symbolName; #define RESOLVE_SYMBOL(symbolName) \ - symbolName = (fp_##symbolName)resolveSymbol(mhstcanLibrary, #symbolName); \ + symbolName = (fp_##symbolName)mhstcanLibrary->resolve(#symbolName); \ if (!symbolName) \ return false; @@ -317,23 +317,12 @@ GENERATE_SYMBOL_VARIABLE(void, CanSetRxEventCallback, CanRxEventCallback) GENERATE_SYMBOL_VARIABLE(void, CanSetEvents, quint16) GENERATE_SYMBOL_VARIABLE(quint32, CanEventStatus, void) -inline QFunctionPointer resolveSymbol(QLibrary *mhstcanLibrary, const char *symbolName) -{ - QFunctionPointer symbolFunctionPointer = mhstcanLibrary->resolve(symbolName); - if (!symbolFunctionPointer) - qWarning("Failed to resolve the mhstcan symbol: %s", symbolName); - - return symbolFunctionPointer; -} - inline bool resolveSymbols(QLibrary *mhstcanLibrary) { if (!mhstcanLibrary->isLoaded()) { mhstcanLibrary->setFileName(QStringLiteral("mhstcan")); - if (!mhstcanLibrary->load()) { - qWarning("Failed to load the library: %s", qPrintable(mhstcanLibrary->fileName())); + if (!mhstcanLibrary->load()) return false; - } } RESOLVE_SYMBOL(CanInitDriver) -- cgit v1.2.3