The function returns what is considered constant data and all the
callers handle it as such. Add the declaration to make things obvious.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/346
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
return file->load(file);
}
-void *kmod_file_get_contents(const struct kmod_file *file)
+const void *kmod_file_get_contents(const struct kmod_file *file)
{
return file->memory;
}
_must_check_ _nonnull_all_ struct kmod_file *kmod_file_open(const struct kmod_ctx *ctx, const char *filename);
_nonnull_all_ struct kmod_elf *kmod_file_get_elf(struct kmod_file *file);
_nonnull_all_ int kmod_file_load_contents(struct kmod_file *file);
-_must_check_ _nonnull_all_ void *kmod_file_get_contents(const struct kmod_file *file);
+_must_check_ _nonnull_all_ const void *kmod_file_get_contents(const struct kmod_file *file);
_must_check_ _nonnull_all_ off_t kmod_file_get_size(const struct kmod_file *file);
_must_check_ _nonnull_all_ enum kmod_file_compression_type kmod_file_get_compression(const struct kmod_file *file);
_must_check_ _nonnull_all_ int kmod_file_get_fd(const struct kmod_file *file);