| 290 | } |
| 291 | |
| 292 | int |
| 293 | rte_devargs_insert(struct rte_devargs **da) |
| 294 | { |
| 295 | struct rte_devargs *listed_da; |
| 296 | void *tmp; |
| 297 | |
| 298 | if (*da == NULL || (*da)->bus == NULL) |
| 299 | return -1; |
| 300 | |
| 301 | RTE_TAILQ_FOREACH_SAFE(listed_da, &devargs_list, next, tmp) { |
| 302 | if (listed_da == *da) |
| 303 | /* devargs already in the list */ |
| 304 | return 0; |
| 305 | if (strcmp(listed_da->bus->name, (*da)->bus->name) == 0 && |
| 306 | strcmp(listed_da->name, (*da)->name) == 0) { |
| 307 | /* device already in devargs list, must be updated */ |
| 308 | (*da)->next = listed_da->next; |
| 309 | rte_devargs_reset(listed_da); |
| 310 | *listed_da = **da; |
| 311 | /* replace provided devargs with found one */ |
| 312 | free(*da); |
| 313 | *da = listed_da; |
| 314 | return 0; |
| 315 | } |
| 316 | } |
| 317 | /* new device in the list */ |
| 318 | TAILQ_INSERT_TAIL(&devargs_list, *da, next); |
| 319 | return 0; |
| 320 | } |
| 321 | |
| 322 | /* store in allowed list parameter for later parsing */ |
| 323 | int |
no test coverage detected