Commit 53999bf34d55981328f8ba9def558d3e104d6e36

Authored by Kevin Winchester
Committed by Linus Torvalds
1 parent 122804ecb5

error: implicit declaration of function 'module_flags_taint'

Recent changes to kernel/module.c caused the following compile
error:

  kernel/module.c: In function ‘show_taint’:
  kernel/module.c:1024:2: error: implicit declaration of function ‘module_flags_taint’ [-Werror=implicit-function-declaration]
  cc1: some warnings being treated as errors

Correct this error by moving the definition of module_flags_taint
outside of the #ifdef CONFIG_MODULE_UNLOAD section.

Signed-off-by: Kevin Winchester <kjwinchester@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 20 additions and 20 deletions Side-by-side Diff

... ... @@ -842,26 +842,6 @@
842 842 return ret;
843 843 }
844 844  
845   -static size_t module_flags_taint(struct module *mod, char *buf)
846   -{
847   - size_t l = 0;
848   -
849   - if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE))
850   - buf[l++] = 'P';
851   - if (mod->taints & (1 << TAINT_OOT_MODULE))
852   - buf[l++] = 'O';
853   - if (mod->taints & (1 << TAINT_FORCED_MODULE))
854   - buf[l++] = 'F';
855   - if (mod->taints & (1 << TAINT_CRAP))
856   - buf[l++] = 'C';
857   - /*
858   - * TAINT_FORCED_RMMOD: could be added.
859   - * TAINT_UNSAFE_SMP, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't
860   - * apply to modules.
861   - */
862   - return l;
863   -}
864   -
865 845 static inline void print_unload_info(struct seq_file *m, struct module *mod)
866 846 {
867 847 struct module_use *use;
... ... @@ -961,6 +941,26 @@
961 941 return 0;
962 942 }
963 943 #endif /* CONFIG_MODULE_UNLOAD */
  944 +
  945 +static size_t module_flags_taint(struct module *mod, char *buf)
  946 +{
  947 + size_t l = 0;
  948 +
  949 + if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE))
  950 + buf[l++] = 'P';
  951 + if (mod->taints & (1 << TAINT_OOT_MODULE))
  952 + buf[l++] = 'O';
  953 + if (mod->taints & (1 << TAINT_FORCED_MODULE))
  954 + buf[l++] = 'F';
  955 + if (mod->taints & (1 << TAINT_CRAP))
  956 + buf[l++] = 'C';
  957 + /*
  958 + * TAINT_FORCED_RMMOD: could be added.
  959 + * TAINT_UNSAFE_SMP, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't
  960 + * apply to modules.
  961 + */
  962 + return l;
  963 +}
964 964  
965 965 static ssize_t show_initstate(struct module_attribute *mattr,
966 966 struct module_kobject *mk, char *buffer)