Skip to content

Commit 1b9974c

Browse files
quic-bjorandeandersson
authored andcommitted
patch: Don't spam the log when no patch file was loaded
When invoking QDL in a way that doesn't involve patching (e.g. by invoking a read) the "0 patches applied" is annoying and can be confusing. Make this statement conditional on patch files actually having been loaded. Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 33e6ec7 commit 1b9974c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

patch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "qdl.h"
1515

1616
static struct list_head patches = LIST_INIT(patches);
17+
static bool patches_loaded;
1718

1819
int patch_load(const char *patch_file)
1920
{
@@ -63,6 +64,8 @@ int patch_load(const char *patch_file)
6364

6465
xmlFreeDoc(doc);
6566

67+
patches_loaded = true;
68+
6669
return 0;
6770
}
6871

@@ -73,6 +76,9 @@ int patch_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, s
7376
unsigned int idx = 0;
7477
int ret;
7578

79+
if (!patches_loaded)
80+
return 0;
81+
7682
list_for_each_entry(patch, &patches, node) {
7783
if (!strcmp(patch->filename, "DISK"))
7884
count++;

0 commit comments

Comments
 (0)