Remove unnecessary enum assignments

This commit is contained in:
Integral 2024-11-11 18:51:47 +08:00
parent f3405fecd9
commit 980d8f3b30
No known key found for this signature in database
GPG Key ID: 06313911057DD5A8
3 changed files with 6 additions and 6 deletions

View File

@ -34,8 +34,8 @@ static ssize_t device_write(struct file *, const char __user *, size_t,
static int major; /* major number assigned to our device driver */
enum {
CDEV_NOT_USED = 0,
CDEV_EXCLUSIVE_OPEN = 1,
CDEV_NOT_USED,
CDEV_EXCLUSIVE_OPEN,
};
/* Is device open? Used to prevent multiple access to device */

View File

@ -22,8 +22,8 @@
#define BUF_LEN 80
enum {
CDEV_NOT_USED = 0,
CDEV_EXCLUSIVE_OPEN = 1,
CDEV_NOT_USED,
CDEV_EXCLUSIVE_OPEN,
};
/* Is the device open right now? Used to prevent concurrent access into

View File

@ -29,8 +29,8 @@ static ssize_t device_write(struct file *file, const char __user *buf,
static int major;
enum {
CDEV_NOT_USED = 0,
CDEV_EXCLUSIVE_OPEN = 1,
CDEV_NOT_USED,
CDEV_EXCLUSIVE_OPEN,
};
static atomic_t already_open = ATOMIC_INIT(CDEV_NOT_USED);