MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lookup

Function lookup

freebsd/kern/subr_firmware.c:146–158  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

144 * with some other data structure.
145 */
146static struct priv_fw *
147lookup(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

Callers 4

firmware_registerFunction · 0.70
firmware_unregisterFunction · 0.70
loadimageFunction · 0.70
firmware_get_flagsFunction · 0.70

Calls 2

mtx_assertFunction · 0.85
strcasecmpFunction · 0.85

Tested by

no test coverage detected