소스 검색

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

Remove unnecessary enum assignments
Jim Huang 5 달 전
부모
커밋
60d391509f
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 2
      examples/chardev.c
  2. 2 2
      examples/chardev2.c
  3. 2 2
      examples/static_key.c

+ 2 - 2
examples/chardev.c

@@ -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 */

+ 2 - 2
examples/chardev2.c

@@ -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

+ 2 - 2
examples/static_key.c

@@ -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);