Compare commits

...

2 commits

Author SHA1 Message Date
Imbus
4ae1267b43 Notes on checkpatch 2026-02-24 13:59:04 +01:00
Imbus
8d5f6aab17 Now passes checkpatch 2026-02-24 13:57:41 +01:00
4 changed files with 16 additions and 6 deletions

View file

@ -12,3 +12,7 @@
### Insert & remove
`sudo insmod demo_module.ko`
`sudo rmmod demo_module.ko`
### Style
Check for style with:
`${LINUX_PATH}/scripts/checkpatch.pl -f ./file.c`

View file

@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/device.h>
#include "my-ioctl.h"
@ -14,7 +16,7 @@ static struct class *cls;
static long my_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
/* See: https://elixir.bootlin.com/linux/v6.14.5/source/include/linux/fs.h#L2131 */
static struct file_operations fops = {
static const struct file_operations fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = my_ioctl,
};

View file

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef MY_IOCTL_H
#define MY_IOCTL_H
#include <linux/ioctl.h>

View file

@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
// #include <stdlib.h>
#include <unistd.h>