Commit 2a53883a authored by yidong0635's avatar yidong0635 Committed by Tomasz Zawadzki
Browse files

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: default avataryidong0635 <dongx.yi@intel.com>
Change-Id: I34b191c9f89d8ae67697ec8e331f9c7c78c16ab2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4819


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJohn Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 36d2e93e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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++;
	}