diff options
author | Jan Engelhardt <jengelh@inai.de> | 2018-06-16 08:45:20 +0200 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-06-18 09:46:56 -0700 |
commit | 867da6fcfb003eb20ae54650f004382325813db6 (patch) | |
tree | 3ccaaca7acf367006e3a42dfc16cfeef6d257472 /libkmod | |
parent | 499778492ab8e4e802368b968460dd26e838b201 (diff) | |
download | kmod-867da6fcfb003eb20ae54650f004382325813db6.tar.gz kmod-867da6fcfb003eb20ae54650f004382325813db6.tar.bz2 kmod-867da6fcfb003eb20ae54650f004382325813db6.zip |
kmod: build: cure compiler warnings showing up externally
When building a C source file with gcc-7 -Wshift-overflow=2, this warning
springs up:
libkmod.h: warning: result of "1 << 31" requires 33 bits to
represent, but "int" only has 32 bits [-Wshift-overflow=]
Change the two _KMOD_* identifiers to fit into 32 bits.
Diffstat (limited to 'libkmod')
-rw-r--r-- | libkmod/libkmod.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h index f9e33c6..352627e 100644 --- a/libkmod/libkmod.h +++ b/libkmod/libkmod.h @@ -72,7 +72,7 @@ enum kmod_index { KMOD_INDEX_MODULES_SYMBOL, KMOD_INDEX_MODULES_BUILTIN, /* Padding to make sure enum is not mapped to char */ - _KMOD_INDEX_PAD = (1 << 31), + _KMOD_INDEX_PAD = 1U << 31, }; int kmod_dump_index(struct kmod_ctx *ctx, enum kmod_index type, int fd); @@ -211,7 +211,7 @@ enum kmod_module_initstate { KMOD_MODULE_COMING, KMOD_MODULE_GOING, /* Padding to make sure enum is not mapped to char */ - _KMOD_MODULE_PAD = (1 << 31), + _KMOD_MODULE_PAD = 1U << 31, }; const char *kmod_module_initstate_str(enum kmod_module_initstate state); int kmod_module_get_initstate(const struct kmod_module *mod); |