treewide: add some static const notations
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This commit is contained in:
parent
1712a1548e
commit
efc2e4b467
|
@ -551,7 +551,7 @@ KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
|
|||
const char *given_alias,
|
||||
struct kmod_list **list)
|
||||
{
|
||||
const lookup_func lookup[] = {
|
||||
static const lookup_func lookup[] = {
|
||||
kmod_lookup_alias_from_config,
|
||||
kmod_lookup_alias_from_moddep_file,
|
||||
kmod_lookup_alias_from_symbols_file,
|
||||
|
@ -619,7 +619,7 @@ KMOD_EXPORT int kmod_module_new_from_name_lookup(struct kmod_ctx *ctx,
|
|||
const char *modname,
|
||||
struct kmod_module **mod)
|
||||
{
|
||||
const lookup_func lookup[] = {
|
||||
static const lookup_func lookup[] = {
|
||||
kmod_lookup_alias_from_moddep_file,
|
||||
kmod_lookup_alias_from_builtin_file,
|
||||
kmod_lookup_alias_from_kernel_builtin_file,
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
* and is passed to all library operations.
|
||||
*/
|
||||
|
||||
static struct _index_files {
|
||||
static const struct {
|
||||
const char *fn;
|
||||
const char *prefix;
|
||||
} index_files[] = {
|
||||
|
@ -61,7 +61,7 @@ static struct _index_files {
|
|||
[KMOD_INDEX_MODULES_BUILTIN] = { .fn = "modules.builtin", .prefix = ""},
|
||||
};
|
||||
|
||||
static const char *default_config_paths[] = {
|
||||
static const char *const default_config_paths[] = {
|
||||
SYSCONFDIR "/modprobe.d",
|
||||
"/run/modprobe.d",
|
||||
"/usr/local/lib/modprobe.d",
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
static int from_name(const struct test *t)
|
||||
{
|
||||
static const char *modnames[] = {
|
||||
static const char *const modnames[] = {
|
||||
"ext4",
|
||||
"balbalbalbbalbalbalbalbalbalbal",
|
||||
"snd-hda-intel",
|
||||
|
@ -37,7 +37,7 @@ static int from_name(const struct test *t)
|
|||
"iTCO_wdt",
|
||||
NULL,
|
||||
};
|
||||
const char **p;
|
||||
const char *const *p;
|
||||
struct kmod_ctx *ctx;
|
||||
struct kmod_module *mod;
|
||||
const char *null_config = NULL;
|
||||
|
@ -72,11 +72,11 @@ DEFINE_TEST(from_name,
|
|||
|
||||
static int from_alias(const struct test *t)
|
||||
{
|
||||
static const char *modnames[] = {
|
||||
static const char *const modnames[] = {
|
||||
"ext4.*",
|
||||
NULL,
|
||||
};
|
||||
const char **p;
|
||||
const char *const *p;
|
||||
struct kmod_ctx *ctx;
|
||||
int err;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
static int alias_1(const struct test *t)
|
||||
{
|
||||
static const char *input[] = {
|
||||
static const char *const input[] = {
|
||||
"test1234",
|
||||
"test[abcfoobar]2211",
|
||||
"bar[aaa][bbbb]sss",
|
||||
|
@ -42,7 +42,7 @@ static int alias_1(const struct test *t)
|
|||
|
||||
char buf[PATH_MAX];
|
||||
size_t len;
|
||||
const char **alias;
|
||||
const char *const *alias;
|
||||
|
||||
for (alias = input; *alias != NULL; alias++) {
|
||||
int ret;
|
||||
|
|
|
@ -53,7 +53,7 @@ static const struct option options[] = {
|
|||
#define OVERRIDE_LIBDIR ABS_TOP_BUILDDIR "/testsuite/.libs/"
|
||||
#define TEST_TIMEOUT_USEC 2 * USEC_PER_SEC
|
||||
|
||||
struct _env_config {
|
||||
static const struct {
|
||||
const char *key;
|
||||
const char *ldpreload;
|
||||
} env_config[_TC_LAST] = {
|
||||
|
|
|
@ -50,7 +50,7 @@ static int verbose = DEFAULT_VERBOSE;
|
|||
|
||||
static const char CFG_BUILTIN_KEY[] = "built-in";
|
||||
static const char CFG_EXTERNAL_KEY[] = "external";
|
||||
static const char *default_cfg_paths[] = {
|
||||
static const char *const default_cfg_paths[] = {
|
||||
SYSCONFDIR "/depmod.d",
|
||||
"/run/depmod.d",
|
||||
"/usr/local/lib/depmod.d",
|
||||
|
|
Loading…
Reference in New Issue