From: Boris Egorov Date: Tue, 19 Jan 2016 06:18:21 +0000 (+0600) Subject: tests: remove redundant check for NULL [cppcheck] X-Git-Tag: v2.28-rc1~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ec6062678b105389722fd0b7936c1096a96c7d6;p=thirdparty%2Futil-linux.git tests: remove redundant check for NULL [cppcheck] We set SA_SIGINFO flag, so we should not get NULL. [tests/helpers/test_sigreceive.c:45] -> [tests/helpers/test_sigreceive.c:47]: (warning) Either the condition 'if(info)' is redundant or there is possible null pointer dereference: info. --- diff --git a/tests/helpers/test_sigreceive.c b/tests/helpers/test_sigreceive.c index f1b954688b..12b563a0ef 100644 --- a/tests/helpers/test_sigreceive.c +++ b/tests/helpers/test_sigreceive.c @@ -44,9 +44,8 @@ void exiter(int signo __attribute__((__unused__)), { int ret = info->si_signo; - if (info) - if (info->si_code == SI_QUEUE && info->si_value.sival_int != 0) - ret = info->si_value.sival_int; + if (info->si_code == SI_QUEUE && info->si_value.sival_int != 0) + ret = info->si_value.sival_int; _exit(ret); }