security: tlk_driver: result_origin consistency
Aaron Gamble [Fri, 28 Jun 2013 20:17:14 +0000 (13:17 -0700)]
For the sake of consistency with other projects, change:
OTE_ERROR_ORIGIN_*
return_origin
error_origin

to match result_origin

Change-Id: I571c81a387ab35ed05cc3002371bc5d6ae606178
Signed-off-by: Aaron Gamble <jgamble@nvidia.com>
Reviewed-on: http://git-master/r/243549
(cherry picked from commit 1a1e6ac1e74a2594662f4601f7a37baf4d4b78bd)
Reviewed-on: http://git-master/r/256381
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: James Zhao <jamesz@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

security/tlk_driver/ote_comms.c
security/tlk_driver/ote_device.c
security/tlk_driver/ote_protocol.h
security/tlk_driver/ote_types.h

index 693650c..40a3ec7 100644 (file)
@@ -291,7 +291,7 @@ void te_open_session(struct te_opensession *cmd,
        ret = te_setup_temp_buffers(request, context);
        if (ret != OTE_SUCCESS) {
                pr_err("te_setup_temp_buffers failed err (0x%x)\n", ret);
-               SET_RESULT(request, ret, OTE_ERROR_ORIGIN_API);
+               SET_RESULT(request, ret, OTE_RESULT_ORIGIN_API);
                return;
        }
 
@@ -338,7 +338,7 @@ void te_launch_operation(struct te_launchop *cmd,
        ret = te_setup_temp_buffers(request, context);
        if (ret != OTE_SUCCESS) {
                pr_err("te_setup_temp_buffers failed err (0x%x)\n", ret);
-               SET_RESULT(request, ret, OTE_ERROR_ORIGIN_API);
+               SET_RESULT(request, ret, OTE_RESULT_ORIGIN_API);
                return;
        }
 
index 5c5447b..f9b0e56 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "ote_protocol.h"
 
-#define SET_ANSWER(a, r, ro)   { a.result = r; a.return_origin = ro; }
+#define SET_ANSWER(a, r, ro)   { a.result = r; a.result_origin = ro; }
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/nvsecurity.h>
@@ -293,7 +293,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
                if (!cmd_desc || (operation->list_count && !params)) {
                        SET_ANSWER(answer,
                                   OTE_ERROR_OUT_OF_MEMORY,
-                                  OTE_ERROR_ORIGIN_COMMS);
+                                  OTE_RESULT_ORIGIN_COMMS);
                        pr_err("failed to get cmd_desc/params\n");
                        goto error;
                }
@@ -322,7 +322,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
                if (!cmd_desc) {
                        SET_ANSWER(answer,
                                   OTE_ERROR_OUT_OF_MEMORY,
-                                  OTE_ERROR_ORIGIN_COMMS);
+                                  OTE_RESULT_ORIGIN_COMMS);
                        pr_err("failed to get cmd_desc\n");
                        goto error;
                }
@@ -344,7 +344,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
                if (!cmd_desc || (operation->list_count && !params)) {
                        SET_ANSWER(answer,
                                   OTE_ERROR_OUT_OF_MEMORY,
-                                  OTE_ERROR_ORIGIN_COMMS);
+                                  OTE_RESULT_ORIGIN_COMMS);
                        pr_err("failed to get cmd_desc/params\n");
                        goto error;
                }
index 531406e..b471a18 100644 (file)
@@ -167,7 +167,7 @@ struct te_request {
 struct te_answer {
        uint32_t        result;
        uint32_t        session_id;
-       uint32_t        return_origin;
+       uint32_t        result_origin;
 };
 
 void te_open_session(struct te_opensession *cmd,
index ef82d4f..593400f 100644 (file)
@@ -67,13 +67,13 @@ enum {
  */
 enum {
        /* Originated from OTE Client API */
-       OTE_ERROR_ORIGIN_API         = 1,
+       OTE_RESULT_ORIGIN_API = 1,
        /* Originated from Underlying Communication Stack */
-       OTE_ERROR_ORIGIN_COMMS       = 2,
+       OTE_RESULT_ORIGIN_COMMS = 2,
        /* Originated from Common OTE Code */
-       OTE_ERROR_ORIGIN_KERNEL      = 3,
+       OTE_RESULT_ORIGIN_KERNEL = 3,
        /* Originated from Trusted APP Code */
-       OTE_ERROR_ORIGIN_TRUSTED_APP = 4,
+       OTE_RESULT_ORIGIN_TRUSTED_APP = 4,
 };
 
 #endif