Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cc47d31 authored by Yisheng Xie's avatar Yisheng Xie Committed by Takashi Iwai
Browse files

ALSA: oxfw: use match_string() helper



match_string() returns the index of an array for a matching string,
which can be used intead of open coded variant.

Signed-off-by: default avatarYisheng Xie <xieyisheng1@huawei.com>
Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 96382b4f
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -49,7 +49,6 @@ static bool detect_loud_models(struct fw_unit *unit)
		"Tapco LINK.firewire 4x6",
		"Tapco LINK.firewire 4x6",
		"U.420"};
		"U.420"};
	char model[32];
	char model[32];
	unsigned int i;
	int err;
	int err;


	err = fw_csr_string(unit->directory, CSR_MODEL,
	err = fw_csr_string(unit->directory, CSR_MODEL,
@@ -57,12 +56,7 @@ static bool detect_loud_models(struct fw_unit *unit)
	if (err < 0)
	if (err < 0)
		return false;
		return false;


	for (i = 0; i < ARRAY_SIZE(models); i++) {
	return match_string(models, ARRAY_SIZE(models), model) >= 0;
		if (strcmp(models[i], model) == 0)
			break;
	}

	return (i < ARRAY_SIZE(models));
}
}


static int name_card(struct snd_oxfw *oxfw)
static int name_card(struct snd_oxfw *oxfw)