net/bnxt: enable shadow tables during session open
[dpdk.git] / drivers / crypto / scheduler / rte_cryptodev_scheduler.c
index a214286..730504d 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2017 Intel Corporation
  */
+#include <rte_string_fns.h>
 #include <rte_reorder.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
@@ -9,8 +10,6 @@
 #include "rte_cryptodev_scheduler.h"
 #include "scheduler_pmd_private.h"
 
-int scheduler_logtype_driver;
-
 /** update the scheduler pmd's capability with attaching device's
  *  capability.
  *  For each device to be attached, the scheduler's capability should be
@@ -443,8 +442,7 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id,
                                RTE_CRYPTODEV_NAME_MAX_LEN);
                return -EINVAL;
        }
-       snprintf(sched_ctx->name, sizeof(sched_ctx->name), "%s",
-                       scheduler->name);
+       strlcpy(sched_ctx->name, scheduler->name, sizeof(sched_ctx->name));
 
        if (strlen(scheduler->description) >
                        RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1) {
@@ -453,8 +451,8 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id,
                                RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1);
                return -EINVAL;
        }
-       snprintf(sched_ctx->description, sizeof(sched_ctx->description), "%s",
-                       scheduler->description);
+       strlcpy(sched_ctx->description, scheduler->description,
+               sizeof(sched_ctx->description));
 
        /* load scheduler instance operations functions */
        sched_ctx->ops.config_queue_pair = scheduler->ops->config_queue_pair;
@@ -578,7 +576,5 @@ rte_cryptodev_scheduler_option_get(uint8_t scheduler_id,
        return (*sched_ctx->ops.option_get)(dev, option_type, option);
 }
 
-RTE_INIT(scheduler_init_log)
-{
-       scheduler_logtype_driver = rte_log_register("pmd.crypto.scheduler");
-}
+
+RTE_LOG_REGISTER(scheduler_logtype_driver, pmd.crypto.scheduler, INFO);