kernel: use library import

This commit is contained in:
weishu
2024-04-27 09:55:16 +08:00
parent 0be7846f9d
commit efbc07fde3
20 changed files with 171 additions and 148 deletions

View File

@@ -1,21 +1,23 @@
#include "linux/err.h"
#include "linux/fs.h"
#include "linux/gfp.h"
#include "linux/kernel.h"
#include "linux/moduleparam.h"
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/gfp.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/version.h>
#ifdef CONFIG_KSU_DEBUG
#include <linux/moduleparam.h>
#endif
#include <crypto/hash.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
#include <crypto/sha2.h>
#else
#include <crypto/sha.h>
#endif
#include "apk_sign.h"
#include "klog.h" // IWYU pragma: keep
#include "kernel_compat.h"
#include "crypto/hash.h"
#include "linux/slab.h"
#include "linux/version.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
#include "crypto/sha2.h"
#else
#include "crypto/sha.h"
#endif
struct sdesc {
struct shash_desc shash;
@@ -229,7 +231,7 @@ static __always_inline bool check_v2_signature(char *path,
goto clean;
}
int loop_count = 0;
int loop_count = 0;
while (loop_count++ < 10) {
uint32_t id;
uint32_t offset;
@@ -307,8 +309,8 @@ static struct kernel_param_ops expected_size_ops = {
.get = param_get_uint,
};
module_param_cb(ksu_debug_manager_uid, &expected_size_ops, &ksu_debug_manager_uid,
S_IRUSR | S_IWUSR);
module_param_cb(ksu_debug_manager_uid, &expected_size_ops,
&ksu_debug_manager_uid, S_IRUSR | S_IWUSR);
#endif