iscsi: replace incorrect off_t with ptrdiff_t

This code calculates the difference between two pointers and then stores
it in an off_t, which is intended for file offsets.

In this particular case, the offset will never be large enough to
overflow off_t, but use the correct ptrdiff_t type anyway.

Change-Id: I6b159bf0286a7f5962d08b9894538f4d99c8647b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-09-29 13:23:56 -07:00
parent d5dffc0596
commit a87d8a45a2

View File

@ -54,6 +54,7 @@
#include <rte_version.h>
#include <inttypes.h>
#include <stddef.h>
#include <unistd.h>
#include "iscsi/iscsi.h"
@ -319,7 +320,7 @@ spdk_mobj_ctor(struct rte_mempool *mp, __attribute__((unused)) void *arg,
{
struct spdk_mobj *m = _m;
uint64_t *phys_addr;
off_t off;
ptrdiff_t off;
m->mp = mp;
m->buf = (uint8_t *)m + sizeof(struct spdk_mobj);