Either value or text must be NULL. Returns the field that matches "the other" for a given config_id */
| 236 | |
| 237 | /* Either value or text must be NULL. Returns the field that matches "the other" for a given config_id */ |
| 238 | static struct cb_cmos_enums *lookup_cmos_enum_core(struct cb_cmos_option_table *option_table, int config_id, const u8 *value, const char *text) |
| 239 | { |
| 240 | int len = strnlen(text, CB_CMOS_MAX_TEXT_LENGTH); |
| 241 | |
| 242 | /* CMOS enums are located after CMOS entries. */ |
| 243 | struct cb_cmos_enums *cmos_enum; |
| 244 | for ( cmos_enum = first_cmos_enum_of_id(option_table, config_id); |
| 245 | cmos_enum; |
| 246 | cmos_enum = next_cmos_enum_of_id(cmos_enum, config_id)) { |
| 247 | if (((value == NULL) || (cmos_enum->value == *value)) && |
| 248 | ((text == NULL) || (memcmp((const char*)cmos_enum->text, text, len) == 0))) { |
| 249 | return cmos_enum; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | return NULL; |
| 254 | } |
| 255 | |
| 256 | static struct cb_cmos_enums *lookup_cmos_enum_by_value(struct cb_cmos_option_table *option_table, int config_id, const u8 *value) |
| 257 | { |
no test coverage detected