Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 2e911ad

Browse files
authored
fixes #30 -- remove explicit enumeration of types/functions/vars
1 parent ce54a90 commit 2e911ad

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

build.rs

-53
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,6 @@ use std::path::PathBuf;
33
use std::process::Command;
44
use std::{env, fs};
55

6-
const INCLUDED_TYPES: &[&str] = &["file_system_type", "mode_t", "umode_t", "ctl_table"];
7-
const INCLUDED_FUNCTIONS: &[&str] = &[
8-
"cdev_add",
9-
"cdev_init",
10-
"cdev_del",
11-
"register_filesystem",
12-
"unregister_filesystem",
13-
"krealloc",
14-
"kfree",
15-
"mount_nodev",
16-
"kill_litter_super",
17-
"register_sysctl",
18-
"unregister_sysctl_table",
19-
"access_ok",
20-
"_copy_to_user",
21-
"_copy_from_user",
22-
"alloc_chrdev_region",
23-
"unregister_chrdev_region",
24-
"wait_for_random_bytes",
25-
"get_random_bytes",
26-
"rng_is_initialized",
27-
"add_device_randomness",
28-
];
29-
const INCLUDED_VARS: &[&str] = &[
30-
"EINVAL",
31-
"ENOMEM",
32-
"ESPIPE",
33-
"EFAULT",
34-
"EAGAIN",
35-
"__this_module",
36-
"FS_REQUIRES_DEV",
37-
"FS_BINARY_MOUNTDATA",
38-
"FS_HAS_SUBTYPE",
39-
"FS_USERNS_MOUNT",
40-
"FS_RENAME_DOES_D_MOVE",
41-
"BINDINGS_GFP_KERNEL",
42-
"KERN_INFO",
43-
"VERIFY_WRITE",
44-
"LINUX_VERSION_CODE",
45-
"SEEK_SET",
46-
"SEEK_CUR",
47-
"SEEK_END",
48-
"O_NONBLOCK",
49-
];
506
const OPAQUE_TYPES: &[&str] = &[
517
// These need to be opaque because they're both packed and aligned, which rustc
528
// doesn't support yet. See https://github.com/rust-lang/rust/issues/59154
@@ -149,15 +105,6 @@ fn main() {
149105
println!("cargo:rerun-if-changed=src/bindings_helper.h");
150106
builder = builder.header("src/bindings_helper.h");
151107

152-
for t in INCLUDED_TYPES {
153-
builder = builder.whitelist_type(t);
154-
}
155-
for f in INCLUDED_FUNCTIONS {
156-
builder = builder.whitelist_function(f);
157-
}
158-
for v in INCLUDED_VARS {
159-
builder = builder.whitelist_var(v);
160-
}
161108
for t in OPAQUE_TYPES {
162109
builder = builder.opaque_type(t);
163110
}

0 commit comments

Comments
 (0)