@@ -144,46 +144,6 @@
#define MAX_STREAMS 16
#define MAX_BUFS 64
-static inline void __cp_fm_usr(void *to, const void __user *from,
- DSP_STATUS *err, unsigned long bytes)
-{
- if (DSP_FAILED(*err))
- return;
-
- if (unlikely(!from)) {
- *err = DSP_EPOINTER;
- return;
- }
-
- if (unlikely(copy_from_user(to, from, bytes))) {
- GT_2trace(WCD_debugMask, GT_7CLASS,
- "%s failed, from=0x%08x\n", __func__, from);
- *err = DSP_EPOINTER;
- }
-}
-#define cp_fm_usr(to, from, err, n) \
- __cp_fm_usr(to, from, &(err), (n) * sizeof(*(to)))
-
-static inline void __cp_to_usr(void __user *to, const void *from,
- DSP_STATUS *err, unsigned long bytes)
-{
- if (DSP_FAILED(*err))
- return;
-
- if (unlikely(!to)) {
- *err = DSP_EPOINTER;
- return;
- }
-
- if (unlikely(copy_to_user(to, from, bytes))) {
- GT_2trace(WCD_debugMask, GT_7CLASS,
- "%s failed, to=0x%08x\n", __func__, to);
- *err = DSP_EPOINTER;
- }
-}
-#define cp_to_usr(to, from, err, n) \
- __cp_to_usr(to, from, &(err), (n) * sizeof(*(from)))
-
/* Device IOCtl function pointer */
struct WCD_Cmd {
u32(*fxn)(union Trapped_Args *args);
@@ -265,6 +225,46 @@ static struct WCD_Cmd WCD_cmdTable[] = {
{CMMWRAP_GetInfo, CMD_CMM_GETINFO_OFFSET}
};
+static inline void __cp_fm_usr(void *to, const void __user *from,
+ DSP_STATUS *err, unsigned long bytes)
+{
+ if (DSP_FAILED(*err))
+ return;
+
+ if (unlikely(!from)) {
+ *err = DSP_EPOINTER;
+ return;
+ }
+
+ if (unlikely(copy_from_user(to, from, bytes))) {
+ GT_2trace(WCD_debugMask, GT_7CLASS,
+ "%s failed, from=0x%08x\n", __func__, from);
+ *err = DSP_EPOINTER;
+ }
+}
+#define cp_fm_usr(to, from, err, n) \
+ __cp_fm_usr(to, from, &(err), (n) * sizeof(*(to)))
+
+static inline void __cp_to_usr(void __user *to, const void *from,
+ DSP_STATUS *err, unsigned long bytes)
+{
+ if (DSP_FAILED(*err))
+ return;
+
+ if (unlikely(!to)) {
+ *err = DSP_EPOINTER;
+ return;
+ }
+
+ if (unlikely(copy_to_user(to, from, bytes))) {
+ GT_2trace(WCD_debugMask, GT_7CLASS,
+ "%s failed, to=0x%08x\n", __func__, to);
+ *err = DSP_EPOINTER;
+ }
+}
+#define cp_to_usr(to, from, err, n) \
+ __cp_to_usr(to, from, &(err), (n) * sizeof(*(from)))
+
/*
* ======== WCD_CallDevIOCtl ========
* Purpose: