diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-01-17 10:39:47 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2025-01-17 18:09:32 +0000 |
| commit | f2cb035c8f931efff4a020b164e657f16f51934b (patch) | |
| tree | 967cd39fb98171cba878893a41ca461ffa993c8c /tools/syz-declextract/testdata/file_operations.c | |
| parent | 38ee454540b9b41d5cc173871dfbf7dd140e8abc (diff) | |
pkg/declextract: remove unused includes and defines
This is nice on its own, but this will also help to prevent
lots of problems when we export more info from the clang tool in future.
The clang tool does not know what will end up in the final descriptions,
so it exports info about all consts that it encounters.
As the result we pull in lots of includes/defines, and lots of kernel
includes/defines are broken or create problems.
So the fewer we have, the better.
Diffstat (limited to 'tools/syz-declextract/testdata/file_operations.c')
| -rw-r--r-- | tools/syz-declextract/testdata/file_operations.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/syz-declextract/testdata/file_operations.c b/tools/syz-declextract/testdata/file_operations.c index 04d548f98..0dd8b9b21 100644 --- a/tools/syz-declextract/testdata/file_operations.c +++ b/tools/syz-declextract/testdata/file_operations.c @@ -3,6 +3,7 @@ #include "include/fs.h" #include "include/uapi/file_operations.h" +#include "include/uapi/unused_ioctl.h" static void foo_open() {} static void foo_read() {} @@ -43,3 +44,16 @@ const struct file_operations proc_ops[] = { .unlocked_ioctl = proc_ioctl, }, }; + +#define UNUSED_IOCTL2 _IO('c', 2) + +static void unused_ioctl(unsigned int cmd) { + switch (cmd) { + case UNUSED_IOCTL1: + case UNUSED_IOCTL2: + } +} + +const struct file_operations unused = { + .unlocked_ioctl = unused_ioctl, +}; |
