#include "../../include/linux/license.h"
/* Are we using CONFIG_MODVERSIONS? */
-static int modversions;
+static bool modversions;
/* Is CONFIG_MODULE_SRCVERSION_ALL set? */
-static int all_versions;
+static bool all_versions;
/* If we are modposting external module set to 1 */
-static int external_module;
+static bool external_module;
/* Only warn about unresolved symbols */
-static int warn_unresolved;
+static bool warn_unresolved;
/* How a symbol is exported */
static int sec_mismatch_count;
-static int sec_mismatch_warn_only = true;
+static bool sec_mismatch_warn_only = true;
/* ignore missing files */
-static int ignore_missing_files;
+static bool ignore_missing_files;
/* If set to 1, only warn (instead of error) about missing ns imports */
-static int allow_missing_ns_imports;
+static bool allow_missing_ns_imports;
static bool error_occurred;
struct symbol {
struct symbol *next;
struct module *module;
- unsigned int crc;
- int crc_valid;
char *namespace;
- unsigned int weak:1;
- unsigned int is_static:1; /* 1 if symbol is not global */
+ unsigned int crc;
+ bool crc_valid;
+ bool weak;
+ bool is_static; /* true if symbol is not global */
enum export export; /* Type of export */
char name[];
};
* Allocate a new symbols for use in the hash of exported symbols or
* the list of unresolved symbols per module
**/
-static struct symbol *alloc_symbol(const char *name, unsigned int weak,
+static struct symbol *alloc_symbol(const char *name, bool weak,
struct symbol *next)
{
struct symbol *s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
strcpy(s->name, name);
s->weak = weak;
s->next = next;
- s->is_static = 1;
+ s->is_static = true;
return s;
}
unsigned int hash;
hash = tdb_hash(name) % SYMBOL_HASH_SIZE;
- symbolhash[hash] = alloc_symbol(name, 0, symbolhash[hash]);
+ symbolhash[hash] = alloc_symbol(name, false, symbolhash[hash]);
return symbolhash[hash];
}
return;
s->crc = crc;
- s->crc_valid = 1;
+ s->crc_valid = true;
}
static void *grab_file(const char *filename, size_t *size)
sym_add_exported(name, mod, export);
}
if (strcmp(symname, "init_module") == 0)
- mod->has_init = 1;
+ mod->has_init = true;
if (strcmp(symname, "cleanup_module") == 0)
- mod->has_cleanup = 1;
+ mod->has_cleanup = true;
break;
}
}
sym->st_name));
if (s)
- s->is_static = 0;
+ s->is_static = false;
}
}
* the automatic versioning doesn't pick it up, but it's really
* important anyhow */
if (modversions)
- mod->unres = alloc_symbol("module_layout", 0, mod->unres);
+ mod->unres = alloc_symbol("module_layout", false, mod->unres);
}
static void read_symbols_from_files(const char *filename)
if (s->module->seen)
continue;
- s->module->seen = 1;
+ s->module->seen = true;
p = strrchr(s->module->name, '/');
if (p)
p++;
mod = find_module(modname);
if (!mod) {
mod = new_module(modname);
- mod->from_dump = 1;
+ mod->from_dump = true;
}
s = sym_add_exported(symname, mod, export_no(export));
- s->is_static = 0;
+ s->is_static = false;
sym_set_crc(symname, crc);
sym_update_namespace(symname, namespace);
}
while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) {
switch (opt) {
case 'e':
- external_module = 1;
+ external_module = true;
break;
case 'i':
*dump_read_iter =
dump_read_iter = &(*dump_read_iter)->next;
break;
case 'm':
- modversions = 1;
+ modversions = true;
break;
case 'n':
- ignore_missing_files = 1;
+ ignore_missing_files = true;
break;
case 'o':
dump_write = optarg;
break;
case 'a':
- all_versions = 1;
+ all_versions = true;
break;
case 'T':
files_source = optarg;
break;
case 'w':
- warn_unresolved = 1;
+ warn_unresolved = true;
break;
case 'E':
sec_mismatch_warn_only = false;
break;
case 'N':
- allow_missing_ns_imports = 1;
+ allow_missing_ns_imports = true;
break;
case 'd':
missing_namespace_deps = optarg;