Skip to content

Commit 980d8f3

Browse files
committed
Remove unnecessary enum assignments
1 parent f3405fe commit 980d8f3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/chardev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ static ssize_t device_write(struct file *, const char __user *, size_t,
3434
static int major; /* major number assigned to our device driver */
3535

3636
enum {
37-
CDEV_NOT_USED = 0,
38-
CDEV_EXCLUSIVE_OPEN = 1,
37+
CDEV_NOT_USED,
38+
CDEV_EXCLUSIVE_OPEN,
3939
};
4040

4141
/* Is device open? Used to prevent multiple access to device */

examples/chardev2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#define BUF_LEN 80
2323

2424
enum {
25-
CDEV_NOT_USED = 0,
26-
CDEV_EXCLUSIVE_OPEN = 1,
25+
CDEV_NOT_USED,
26+
CDEV_EXCLUSIVE_OPEN,
2727
};
2828

2929
/* Is the device open right now? Used to prevent concurrent access into

examples/static_key.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ static ssize_t device_write(struct file *file, const char __user *buf,
2929
static int major;
3030

3131
enum {
32-
CDEV_NOT_USED = 0,
33-
CDEV_EXCLUSIVE_OPEN = 1,
32+
CDEV_NOT_USED,
33+
CDEV_EXCLUSIVE_OPEN,
3434
};
3535

3636
static atomic_t already_open = ATOMIC_INIT(CDEV_NOT_USED);

0 commit comments

Comments
 (0)