16 Nov
2014
16 Nov
'14
9:57 p.m.
Takashi Sakamoto wrote:
+++ b/sound/firewire/oxfw/oxfw.c +static bool detect_loud_models(struct fw_unit *unit) +{
- const char *const models[] = {
"Onyxi",
"Onyx-i",
"d.Pro",
"Mackie Onyx Satellite",
"Tapco LINK.firewire 4x6",
"U.420"};
- char model[32] = {0};
This initialization is not needed.
- unsigned int i;
- int err;
- err = fw_csr_string(unit->directory, CSR_MODEL,
model, sizeof(model));
- if (err < 0)
return err;
- model[31] = '\0';
The returned string is guaranteed to be zero-terminated.
- for (i = 0; i < ARRAY_SIZE(models); i++) {
if (strncmp(models[i], model, strlen(model) == 0))
Why not simply strcmp()?
static int name_card(struct snd_oxfw *oxfw) { struct fw_device *fw_dev = fw_parent_device(oxfw->unit);
- char vendor[24] = {0};
- char model[32] = {0};
Same unneeded initialization.
Regards, Clemens