Skip to content

Commit

Permalink
Merge pull request #283 from Integral-Tech/simplify-enum
Browse files Browse the repository at this point in the history
Remove unnecessary enum assignments
  • Loading branch information
jserv authored Nov 11, 2024
2 parents af8a3e6 + 980d8f3 commit 60d3915
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/chardev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions examples/chardev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/static_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 60d3915

Please sign in to comment.