vcsm: add macros for cache functions
authorDan Pasanen <dan.pasanen@gmail.com>
Thu, 21 Sep 2017 14:57:44 +0000 (09:57 -0500)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 8 Oct 2017 01:09:16 +0000 (01:09 +0000)
drivers/char/broadcom/vc_sm/vc_sm_knl.h
drivers/char/broadcom/vc_sm/vmcs_sm.c

index f7f74750d8358779c61dfcd6fc841aa1789a2c5e..e50fd8eaecef7a3c8451c040ffc3888cc37e28fc 100644 (file)
@@ -27,6 +27,11 @@ enum vc_sm_lock_cache_mode {
        VC_SM_LOCK_NON_CACHED,
 };
 
+/* Cache functions */
+#define VCSM_CACHE_OP_INV       0x01
+#define VCSM_CACHE_OP_FLUSH     0x02
+#define VCSM_CACHE_OP_CLEAN     0x03
+
 /* Allocate a shared memory handle and block. */
 int vc_sm_alloc(struct vc_sm_alloc_t *alloc, int *handle);
 
index 754f29e88968ec8b7b8a9bd7e89b25ba16de66c3..80c5381a64c2f7b854c01e7aef93f63660d6c4ca 100644 (file)
@@ -2964,12 +2964,9 @@ static long vc_sm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        }
                        for (i = 0; i < sizeof(ioparam.s) / sizeof(*ioparam.s); i++) {
                                switch (ioparam.s[i].cmd) {
-                               default:
-                               case 0:
-                                       break; /* NOOP */
-                               case 1: /* L1/L2 invalidate virtual range */
-                               case 2: /* L1/L2 clean physical range */
-                               case 3: /* L1/L2 clean+invalidate all */
+                               case VCSM_CACHE_OP_INV: /* L1/L2 invalidate virtual range */
+                               case VCSM_CACHE_OP_FLUSH: /* L1/L2 clean physical range */
+                               case VCSM_CACHE_OP_CLEAN: /* L1/L2 clean+invalidate all */
                                        /* Locate resource from GUID. */
                                        resource =
                                            vmcs_sm_acquire_resource(file_data, ioparam.s[i].handle);
@@ -2993,6 +2990,8 @@ static long vc_sm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                                vmcs_sm_release_resource(resource, 0);
 
                                        break;
+                               default:
+                                       break; /* NOOP */
                                }
                        }
                }