···2323#include "../../include/linux/license.h"24242525/* Are we using CONFIG_MODVERSIONS? */2626-static int modversions;2626+static bool modversions;2727/* Is CONFIG_MODULE_SRCVERSION_ALL set? */2828-static int all_versions;2828+static bool all_versions;2929/* If we are modposting external module set to 1 */3030-static int external_module;3030+static bool external_module;3131/* Only warn about unresolved symbols */3232-static int warn_unresolved;3232+static bool warn_unresolved;3333/* How a symbol is exported */3434static int sec_mismatch_count;3535-static int sec_mismatch_warn_only = true;3535+static bool sec_mismatch_warn_only = true;3636/* ignore missing files */3737-static int ignore_missing_files;3737+static bool ignore_missing_files;3838/* If set to 1, only warn (instead of error) about missing ns imports */3939-static int allow_missing_ns_imports;3939+static bool allow_missing_ns_imports;40404141static bool error_occurred;4242···202202struct symbol {203203 struct symbol *next;204204 struct module *module;205205- unsigned int crc;206206- int crc_valid;207205 char *namespace;208208- unsigned int weak:1;209209- unsigned int is_static:1; /* 1 if symbol is not global */206206+ unsigned int crc;207207+ bool crc_valid;208208+ bool weak;209209+ bool is_static; /* true if symbol is not global */210210 enum export export; /* Type of export */211211 char name[];212212};···230230 * Allocate a new symbols for use in the hash of exported symbols or231231 * the list of unresolved symbols per module232232 **/233233-static struct symbol *alloc_symbol(const char *name, unsigned int weak,233233+static struct symbol *alloc_symbol(const char *name, bool weak,234234 struct symbol *next)235235{236236 struct symbol *s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));···239239 strcpy(s->name, name);240240 s->weak = weak;241241 s->next = next;242242- s->is_static = 1;242242+ s->is_static = true;243243 return s;244244}245245···250250 unsigned int hash;251251252252 hash = tdb_hash(name) % SYMBOL_HASH_SIZE;253253- symbolhash[hash] = alloc_symbol(name, 0, symbolhash[hash]);253253+ symbolhash[hash] = alloc_symbol(name, false, symbolhash[hash]);254254255255 return symbolhash[hash];256256}···424424 return;425425426426 s->crc = crc;427427- s->crc_valid = 1;427427+ s->crc_valid = true;428428}429429430430static void *grab_file(const char *filename, size_t *size)···721721 sym_add_exported(name, mod, export);722722 }723723 if (strcmp(symname, "init_module") == 0)724724- mod->has_init = 1;724724+ mod->has_init = true;725725 if (strcmp(symname, "cleanup_module") == 0)726726- mod->has_cleanup = 1;726726+ mod->has_cleanup = true;727727 break;728728 }729729}···20582058 sym->st_name));2059205920602060 if (s)20612061- s->is_static = 0;20612061+ s->is_static = false;20622062 }20632063 }20642064···20782078 * the automatic versioning doesn't pick it up, but it's really20792079 * important anyhow */20802080 if (modversions)20812081- mod->unres = alloc_symbol("module_layout", 0, mod->unres);20812081+ mod->unres = alloc_symbol("module_layout", false, mod->unres);20822082}2083208320842084static void read_symbols_from_files(const char *filename)···23102310 if (s->module->seen)23112311 continue;2312231223132313- s->module->seen = 1;23132313+ s->module->seen = true;23142314 p = strrchr(s->module->name, '/');23152315 if (p)23162316 p++;···24272427 mod = find_module(modname);24282428 if (!mod) {24292429 mod = new_module(modname);24302430- mod->from_dump = 1;24302430+ mod->from_dump = true;24312431 }24322432 s = sym_add_exported(symname, mod, export_no(export));24332433- s->is_static = 0;24332433+ s->is_static = false;24342434 sym_set_crc(symname, crc);24352435 sym_update_namespace(symname, namespace);24362436 }···25082508 while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) {25092509 switch (opt) {25102510 case 'e':25112511- external_module = 1;25112511+ external_module = true;25122512 break;25132513 case 'i':25142514 *dump_read_iter =···25172517 dump_read_iter = &(*dump_read_iter)->next;25182518 break;25192519 case 'm':25202520- modversions = 1;25202520+ modversions = true;25212521 break;25222522 case 'n':25232523- ignore_missing_files = 1;25232523+ ignore_missing_files = true;25242524 break;25252525 case 'o':25262526 dump_write = optarg;25272527 break;25282528 case 'a':25292529- all_versions = 1;25292529+ all_versions = true;25302530 break;25312531 case 'T':25322532 files_source = optarg;25332533 break;25342534 case 'w':25352535- warn_unresolved = 1;25352535+ warn_unresolved = true;25362536 break;25372537 case 'E':25382538 sec_mismatch_warn_only = false;25392539 break;25402540 case 'N':25412541- allow_missing_ns_imports = 1;25412541+ allow_missing_ns_imports = true;25422542 break;25432543 case 'd':25442544 missing_namespace_deps = optarg;
+6-5
scripts/mod/modpost.h
···11/* SPDX-License-Identifier: GPL-2.0 */22+#include <stdbool.h>23#include <stdio.h>34#include <stdlib.h>45#include <stdarg.h>···114113 struct module *next;115114 int gpl_compatible;116115 struct symbol *unres;117117- int from_dump; /* 1 if module was loaded from *.symvers */118118- int is_vmlinux;119119- int seen;120120- int has_init;121121- int has_cleanup;116116+ bool from_dump; /* true if module was loaded from *.symvers */117117+ bool is_vmlinux;118118+ bool seen;119119+ bool has_init;120120+ bool has_cleanup;122121 struct buffer dev_table_buf;123122 char srcversion[25];124123 // Missing namespace dependencies
+3-5
scripts/mod/sumversion.c
···290290 return 1;291291}292292/* Check whether the file is a static library or not */293293-static int is_static_library(const char *objfile)293293+static bool is_static_library(const char *objfile)294294{295295 int len = strlen(objfile);296296- if (objfile[len - 2] == '.' && objfile[len - 1] == 'a')297297- return 1;298298- else299299- return 0;296296+297297+ return objfile[len - 2] == '.' && objfile[len - 1] == 'a';300298}301299302300/* We have dir/file.o. Open dir/.file.o.cmd, look for source_ and deps_ line