example/ioat: Initialize global TAILQ HEAD variables at definition.
Signed-off-by: yidong0635 <dongx.yi@intel.com> Change-Id: I0364992ae1af0e102e5a05857bb4b3251765f7ff Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4597 Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
232bfc75e0
commit
a3d1419b05
@ -52,7 +52,7 @@ struct ioat_device {
|
||||
TAILQ_ENTRY(ioat_device) tailq;
|
||||
};
|
||||
|
||||
static TAILQ_HEAD(, ioat_device) g_devices;
|
||||
static TAILQ_HEAD(, ioat_device) g_devices = TAILQ_HEAD_INITIALIZER(g_devices);
|
||||
static struct ioat_device *g_next_device;
|
||||
|
||||
static struct user_config g_user_config;
|
||||
@ -234,8 +234,6 @@ attach_cb(void *cb_ctx, struct spdk_pci_device *pci_dev, struct spdk_ioat_chan *
|
||||
static int
|
||||
ioat_init(void)
|
||||
{
|
||||
TAILQ_INIT(&g_devices);
|
||||
|
||||
if (spdk_ioat_probe(NULL, probe_cb, attach_cb) != 0) {
|
||||
fprintf(stderr, "ioat_probe() failed\n");
|
||||
return 1;
|
||||
|
@ -57,7 +57,7 @@ struct ioat_device {
|
||||
TAILQ_ENTRY(ioat_device) tailq;
|
||||
};
|
||||
|
||||
static TAILQ_HEAD(, ioat_device) g_devices;
|
||||
static TAILQ_HEAD(, ioat_device) g_devices = TAILQ_HEAD_INITIALIZER(g_devices);
|
||||
static struct ioat_device *g_next_device;
|
||||
|
||||
static struct user_config g_user_config;
|
||||
@ -227,8 +227,6 @@ attach_cb(void *cb_ctx, struct spdk_pci_device *pci_dev, struct spdk_ioat_chan *
|
||||
static int
|
||||
ioat_init(void)
|
||||
{
|
||||
TAILQ_INIT(&g_devices);
|
||||
|
||||
if (spdk_ioat_probe(NULL, probe_cb, attach_cb) != 0) {
|
||||
fprintf(stderr, "ioat_probe() failed\n");
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user