option->opt_* is redundant.
The field should also be constant.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
*/
struct rte_option {
TAILQ_ENTRY(rte_option) next; /**< Next entry in the list. */
*/
struct rte_option {
TAILQ_ENTRY(rte_option) next; /**< Next entry in the list. */
- char *opt_str; /**< The option name. */
+ const char *name; /**< The option name. */
const char *usage; /**< Option summary string. */
rte_option_cb cb; /**< Function called when option is used. */
int enabled; /**< Set when the option is used. */
const char *usage; /**< Option summary string. */
rte_option_cb cb; /**< Function called when option is used. */
int enabled; /**< Set when the option is used. */
/* Check if the option is registered */
TAILQ_FOREACH(option, &rte_option_list, next) {
/* Check if the option is registered */
TAILQ_FOREACH(option, &rte_option_list, next) {
- if (strcmp(&opt[2], option->opt_str) == 0) {
+ if (strcmp(&opt[2], option->name) == 0) {
option->enabled = 1;
return 0;
}
option->enabled = 1;
return 0;
}
struct rte_option *option;
TAILQ_FOREACH(option, &rte_option_list, next) {
struct rte_option *option;
TAILQ_FOREACH(option, &rte_option_list, next) {
- if (strcmp(opt->opt_str, option->opt_str) == 0) {
+ if (strcmp(opt->name, option->name) == 0) {
RTE_LOG(INFO, EAL, "Option %s has already been registered.\n",
RTE_LOG(INFO, EAL, "Option %s has already been registered.\n",
printf("EAL dynamic options:\n");
TAILQ_FOREACH(option, &rte_option_list, next)
printf("EAL dynamic options:\n");
TAILQ_FOREACH(option, &rte_option_list, next)
- printf(" --%-*s %s\n", 17, option->opt_str, option->usage);
+ printf(" --%-*s %s\n", 17, option->name, option->usage);
int telemetry_log_level;
static struct rte_option option = {
int telemetry_log_level;
static struct rte_option option = {
- .opt_str = "telemetry",
.usage = "Enable telemetry backend",
.cb = &rte_telemetry_init,
.enabled = 0
.usage = "Enable telemetry backend",
.cb = &rte_telemetry_init,
.enabled = 0