* Helper function to lookup a name. * As a side effect, it sets the pointer to a free slot, if any. * This way we can concentrate most of the registry scanning in * this function, which makes it easier to replace the registry * with some other data structure. */
| 144 | * with some other data structure. |
| 145 | */ |
| 146 | static struct priv_fw * |
| 147 | lookup(const char *name) |
| 148 | { |
| 149 | struct priv_fw *fp; |
| 150 | |
| 151 | mtx_assert(&firmware_mtx, MA_OWNED); |
| 152 | |
| 153 | LIST_FOREACH(fp, &firmware_table, link) { |
| 154 | if (fp->fw.name != NULL && strcasecmp(name, fp->fw.name) == 0) |
| 155 | break; |
| 156 | } |
| 157 | return (fp); |
| 158 | } |
| 159 | |
| 160 | /* |
| 161 | * Register a firmware image with the specified name. The |
no test coverage detected