| 67 | } |
| 68 | |
| 69 | static int |
| 70 | dma_check_name(const char *name) |
| 71 | { |
| 72 | size_t name_len; |
| 73 | |
| 74 | if (name == NULL) { |
| 75 | RTE_DMA_LOG(ERR, "Name can't be NULL"); |
| 76 | return -EINVAL; |
| 77 | } |
| 78 | |
| 79 | name_len = strnlen(name, RTE_DEV_NAME_MAX_LEN); |
| 80 | if (name_len == 0) { |
| 81 | RTE_DMA_LOG(ERR, "Zero length DMA device name"); |
| 82 | return -EINVAL; |
| 83 | } |
| 84 | if (name_len >= RTE_DEV_NAME_MAX_LEN) { |
| 85 | RTE_DMA_LOG(ERR, "DMA device name is too long"); |
| 86 | return -EINVAL; |
| 87 | } |
| 88 | |
| 89 | return 0; |
| 90 | } |
| 91 | |
| 92 | static int16_t |
| 93 | dma_find_free_id(void) |
no test coverage detected