env_dpdk/memory: Fix warning of scanbuild.

We can verify readdir(dir) directly.
And this fixes issue :
memory.c:1233:23: warning: Although the value stored to 'd'
 is used in the enclosing expression, the value is never
actually read from 'd'
        while (count < 3 && (d = readdir(dir)) != NULL) {
                             ^   ~~~~~~~~~~~~

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I34b191c9f89d8ae67697ec8e331f9c7c78c16ab2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4819
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
yidong0635 2020-10-22 11:35:17 -04:00 committed by Tomasz Zawadzki
parent 36d2e93ea1
commit 2a53883af9

View File

@ -1222,7 +1222,6 @@ vfio_enabled(void)
static bool
has_iommu_groups(void)
{
struct dirent *d;
int count = 0;
DIR *dir = opendir("/sys/kernel/iommu_groups");
@ -1230,7 +1229,7 @@ has_iommu_groups(void)
return false;
}
while (count < 3 && (d = readdir(dir)) != NULL) {
while (count < 3 && readdir(dir) != NULL) {
count++;
}