X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tools%2Flib%2Fcarlfw.c;h=ce61afb244913f1c892a878d5f6b90ac60bc287a;hb=12d3f1ba6ba522cd1ef11483d813fe2c2e64f04b;hp=b75253558cfcfacafb1360849f86067d4127a17c;hpb=1b87ea4a51988adea4d112ada0cb749c8059353c;p=carl9170fw.git diff --git a/tools/lib/carlfw.c b/tools/lib/carlfw.c index b752535..ce61afb 100644 --- a/tools/lib/carlfw.c +++ b/tools/lib/carlfw.c @@ -1,5 +1,5 @@ /* - * Copyright 2010, Christian Lamparter + * Copyright 2010-2011 Christian Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -190,18 +190,18 @@ static void *__carlfw_find_desc(struct carlfw_file *file, struct carl9170fw_desc_head *tmp = NULL; while (scan >= 0) { - if (file->data[scan] == descid[sizeof(descid) - found - 1]) + if (file->data[scan] == descid[CARL9170FW_MAGIC_SIZE - found - 1]) found++; else found = 0; - if (found == sizeof(descid)) + if (found == CARL9170FW_MAGIC_SIZE) break; scan--; } - if (found == sizeof(descid)) { + if (found == CARL9170FW_MAGIC_SIZE) { tmp = (void *) &file->data[scan]; if (!CHECK_HDR_VERSION(tmp, compatible_revision) && @@ -409,19 +409,10 @@ struct carlfw *carlfw_load(const char *basename) init_list_head(&fw->desc_list); - snprintf(filename, sizeof(filename), "%s.dsc", basename); - err = __carlfw_load(&fw->hdr, filename, "r"); - - snprintf(filename, sizeof(filename), "%s.fw", basename); - err = __carlfw_load(&fw->fw, filename, "r"); - if (!err) - goto found; - err = __carlfw_load(&fw->fw, basename, "r"); if (err) goto err_out; -found: if (fw->hdr.name) hdr_file = &fw->hdr; else