FreeBSD/sys/dev/bhnd/bhndb/bhndb.c
/**
 * Return true if @p devlist matches the @p hw specification.
 * 
 * @param devlist A device table to match against.
 * @param num_devs The number of devices in @p devlist.
 * @param hw The hardware description to be matched against.
 */
Return true if @p devlist matches the @p hw specification.

@param devlist A device table to match against.
@param num_devs The number of devices in @p devlist.
@param hw The hardware description to be matched against.
Return true if @p devlist matches the @p hw specification . @param devlist A device table to match against . @param num_devs The number of devices in @p devlist . @param hw The hardware description to be matched against .
static bool
bhndb_hw_matches(device_t *devlist, int num_devs, const struct bhndb_hw *hw)
{
	for (u_int i = 0; i < hw->num_hw_reqs; i++) {
		const struct bhnd_core_match	*match;
		struct bhnd_core_info		 ci;
		bool				 found;
		match =  &hw->hw_reqs[i];
		found = false;
		for (int d = 0; d < num_devs; d++) {
			ci = bhnd_get_core_info(devlist[d]);
			if (!bhnd_core_matches(&ci, match))
				continue;
			found = true;
			break;
		}
		if (!found)
			return (false);
	}
	return (true);
}
static bool bhndb_hw_matches ( device_t * devlist , int num_devs , const struct bhndb_hw * hw ) { for ( u_int i = 0 ; i < hw -> num_hw_reqs ; i ++ ) { const struct bhnd_core_match * match ; struct bhnd_core_info ci ; bool found ; match = & hw -> hw_reqs [ i ] ; found = false ; for ( int d = 0 ; d < num_devs ; d ++ ) { ci = bhnd_get_core_info ( devlist [ d ] ) ; if ( ! bhnd_core_matches ( & ci , match ) ) continue ; found = true ; break ; } if ( ! found ) return ( false ) ; } return ( true ) ; }
Return true if @p devlist matches the @p hw specification.
Return true if @p devlist matches the @p hw specification .