vhost/crypto: fix build with gcc 4.7.2
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 27 Apr 2018 09:04:38 +0000 (11:04 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 27 Apr 2018 09:31:39 +0000 (11:31 +0200)
commit996096e629c3b6d08eab4acf51122ff783350b39
tree202f56a703f5e52cb2e9d2a012f9b6538b7c1187
parenta5c9b9278cd4fa0b61db045ed19df449f07ab139
vhost/crypto: fix build with gcc 4.7.2

Build error has been reported by Intel build system:
SUSE12SP3_64 / Linux 3.7.10-1 / GCC 4.7.2
lib/librte_vhost/vhost_crypto.c: In function ‘rte_vhost_crypto_set_zero_copy’:
lib/librte_vhost/vhost_crypto.c:1192:2: error:
comparison of unsigned expression < 0 is always false

As enums can be either signed or unsigned, this patch removes
the negative check and cast to unsigned the upper limit check.

Fixes: 939066d96563 ("vhost/crypto: add public function implementation")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_crypto.c