gpu: pvr: move ioctl checking error messagess to pr_err()
authorLuc Verhaegen <libv@codethink.co.uk>
Tue, 5 Apr 2011 12:41:24 +0000 (14:41 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:05 +0000 (21:43 +0300)
This way, we get to actually see ioctls failing.

Also, a pointless check is removed: the switch statement that follows
will take care of unhandled cases for us anyway (and now complain about
them verbosely).

Fixes: NB#251136 - PVR: fix IOCTL command ID range checking

Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/bridged_pvr_bridge.c

index 4621710..980781e 100644 (file)
@@ -2576,16 +2576,14 @@ static int bridged_check_cmd(u32 cmd_id)
 {
        if (PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_RAN)) {
                if (!PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL)) {
-                       PVR_DPF(PVR_DBG_ERROR,
-                       "%s: Initialisation failed.  Driver unusable.",
-                                __func__);
+                       pr_err("PVR: ERROR: Initialisation failed. "
+                              "Driver unusable.\n");
                        return 1;
                }
        } else {
                if (PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_RUNNING)) {
-                       PVR_DPF(PVR_DBG_ERROR,
-                                "%s: Initialisation is in progress",
-                                __func__);
+                       pr_err("PVR: ERROR: Initialisation still in "
+                              "progress.\n");
                        return 1;
                } else {
                        switch (cmd_id) {
@@ -2599,9 +2597,8 @@ static int bridged_check_cmd(u32 cmd_id)
                                PVRSRV_BRIDGE_INITSRV_DISCONNECT):
                                break;
                        default:
-                               PVR_DPF(PVR_DBG_ERROR,
-                       "%s: Driver initialisation not completed yet.",
-                                        __func__);
+                               pr_err("PVR: ERROR: initialisation not "
+                                      "completed yet.\n");
                                return 1;
                        }
                }
@@ -3008,8 +3005,7 @@ static int bridged_ioctl(struct file *filp, u32 cmd, void *in, void *out,
 #endif
 
        default:
-               PVR_DPF(PVR_DBG_ERROR, "%s: cmd = %d is out if range!",
-                       __func__, cmd);
+               pr_err("PVR: Error: Unhandled IOCTL %d.\n", cmd);
        }
 
        pr_ioctl_error(cmd, per_proc->name, err, out, out_err_ofs);
@@ -3020,7 +3016,6 @@ static int bridged_ioctl(struct file *filp, u32 cmd, void *in, void *out,
 int BridgedDispatchKM(struct file *filp, struct PVRSRV_PER_PROCESS_DATA *pd,
                      struct PVRSRV_BRIDGE_PACKAGE *pkg)
 {
-
        void *in;
        void *out;
        u32 bid = pkg->ui32BridgeID;
@@ -3045,15 +3040,7 @@ int BridgedDispatchKM(struct file *filp, struct PVRSRV_PER_PROCESS_DATA *pd,
                                pkg->ui32InBufferSize) != PVRSRV_OK)
                goto return_fault;
 
-       if (bid >= (PVRSRV_BRIDGE_LAST_SGX_CMD)) {
-               PVR_DPF(PVR_DBG_ERROR,
-                        "%s: ui32BridgeID = %d is out if range!", __func__,
-                        bid);
-               goto return_fault;
-       }
-
        err = bridged_ioctl(filp, bid, in, out, pkg->ui32InBufferSize, pd);
-
        if (err < 0)
                goto return_fault;