gpu: pvr: remove unused function args from PVRSRVSetDevicePowerStateKM
authorImre Deak <imre.deak@nokia.com>
Mon, 5 Apr 2010 21:49:06 +0000 (00:49 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:40 +0000 (21:09 +0300)
The CallerID parameter was anyway a horrible concept in terms of
understanding what the function is supposed to do when ISR_ID, KERNEL_ID
or TIMER_ID is passed. Function arguments should never have such "high
level" meaning, but rather denote much more concrete things. In this case
for example whether we should mutex_lock() or mutex_trylock() for a
certain lock. Better yet we should have separate functions for the two
cases to keep the function body as simple as possible.

Happily the CallerID and RetainMutex arguments are unused now, so they
can be removed.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
CC: Mark Underwood <mark.underwood@imgtec.com>
CC: Mark Riding <mark.riding@imgtec.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@nokia.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com>
pvr/power.c
pvr/power.h
pvr/pvr_debug.c
pvr/pvrsrv.c
pvr/sgxinit.c
pvr/sgxutils.c

index 8a0821e..a33e0de 100644 (file)
@@ -208,8 +208,7 @@ static enum PVRSRV_ERROR PVRSRVDevicePostPowerStateKM(IMG_BOOL bAllDevices,
 }
 
 enum PVRSRV_ERROR PVRSRVSetDevicePowerStateKM(u32 ui32DeviceIndex,
-                                    enum PVR_POWER_STATE eNewPowerState,
-                                    u32 ui32CallerID, IMG_BOOL bRetainMutex)
+                                    enum PVR_POWER_STATE eNewPowerState)
 {
        enum PVRSRV_ERROR eError;
        struct SYS_DATA *psSysData;
index 53dd6a3..a5d00e2 100644 (file)
@@ -61,8 +61,7 @@ enum PVRSRV_ERROR PVRSRVSetInitServerState(enum PVRSRV_INIT_SERVER_STATE
                IMG_BOOL bState);
 
 enum PVRSRV_ERROR PVRSRVSetDevicePowerStateKM(u32 ui32DeviceIndex,
-               enum PVR_POWER_STATE eNewPowerState, u32 ui32CallerID,
-               IMG_BOOL bRetainMutex);
+               enum PVR_POWER_STATE eNewPowerState);
 
 enum PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(
                enum PVR_POWER_STATE eNewPowerState);
index b3a05a2..469d522 100644 (file)
@@ -289,8 +289,7 @@ static int pvr_dbg_reset(void *data, u64 val)
        }
 
        err = PVRSRVSetDevicePowerStateKM(node->sDevId.ui32DeviceIndex,
-                                            PVRSRV_POWER_STATE_D0,
-                                            KERNEL_ID, IMG_TRUE);
+                                            PVRSRV_POWER_STATE_D0);
        if (err != PVRSRV_OK) {
                r = -EIO;
                goto exit;
index 2a11fe6..30d9c63 100644 (file)
@@ -316,10 +316,9 @@ enum PVRSRV_ERROR PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
                psDeviceNode = psSysData->psDeviceNodeList;
                while (psDeviceNode) {
                        eError =
-                           PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.
-                                               ui32DeviceIndex,
-                                               PVRSRV_POWER_Unspecified,
-                                               KERNEL_ID, IMG_FALSE);
+                           PVRSRVSetDevicePowerStateKM(
+                                       psDeviceNode->sDevId.ui32DeviceIndex,
+                                       PVRSRV_POWER_Unspecified);
                        if (eError != PVRSRV_OK)
                                PVR_DPF(PVR_DBG_ERROR, "PVRSRVFinaliseSystem: "
                                        "Failed PVRSRVSetDevicePowerStateKM "
@@ -439,8 +438,7 @@ enum PVRSRV_ERROR PVRSRVDeinitialiseDevice(u32 ui32DevIndex)
 FoundDevice:
 
        eError = PVRSRVSetDevicePowerStateKM(ui32DevIndex,
-                                            PVRSRV_POWER_STATE_D3,
-                                            KERNEL_ID, IMG_FALSE);
+                                            PVRSRV_POWER_STATE_D3);
        if (eError != PVRSRV_OK) {
                PVR_DPF(PVR_DBG_ERROR, "PVRSRVDeinitialiseDevice: "
                                "Failed PVRSRVSetDevicePowerStateKM call");
index a84c7ee..5fa2e0f 100644 (file)
@@ -911,8 +911,7 @@ static void SGX_MISRHandler(void *pvData)
         * released when returning from the function.
         */
        dev_idx = psDeviceNode->sDevId.ui32DeviceIndex;
-       err = PVRSRVSetDevicePowerStateKM(dev_idx, PVRSRV_POWER_STATE_D0,
-                                         ISR_ID, IMG_FALSE);
+       err = PVRSRVSetDevicePowerStateKM(dev_idx, PVRSRV_POWER_STATE_D0);
        BUG_ON(err != PVRSRV_OK);
 
        l1 = readl(&psSGXHostCtl->ui32InterruptFlags);
index aac6d51..beb8a57 100644 (file)
@@ -89,10 +89,9 @@ void SGXTestActivePowerEvent(struct PVRSRV_DEVICE_NODE *psDeviceNode,
 
        PDUMPSUSPEND();
 
-       eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.
-                                       ui32DeviceIndex,
-                                       PVRSRV_POWER_STATE_D3,
-                                       ui32CallerID, IMG_FALSE);
+       eError = PVRSRVSetDevicePowerStateKM(
+                                       psDeviceNode->sDevId.ui32DeviceIndex,
+                                       PVRSRV_POWER_STATE_D3);
        if (eError == PVRSRV_OK)
                SGXPostActivePowerEvent(psDeviceNode, ui32CallerID);
        if (eError == PVRSRV_ERROR_RETRY) {
@@ -269,8 +268,7 @@ enum PVRSRV_ERROR SGXScheduleCCBCommandKM(
 
        eError =
            PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex,
-                                       PVRSRV_POWER_STATE_D0, ui32CallerID,
-                                       IMG_TRUE);
+                                       PVRSRV_POWER_STATE_D0);
 
        PDUMPRESUME();