Merge pull request #283 from Integral-Tech/simplify-enum

Remove unnecessary enum assignments
This commit is contained in:
Jim Huang 2024-11-11 19:53:56 +08:00 committed by GitHub
commit 60d391509f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);