gpu: pvr: optimize mem clear in hash _Resize
authorImre Deak <imre.deak@nokia.com>
Wed, 30 Mar 2011 11:33:14 +0000 (14:33 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:04 +0000 (21:43 +0300)
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
pvr/hash.c

index 9cbeb9e..bfee500 100644 (file)
@@ -149,7 +149,6 @@ static IMG_BOOL _Resize(struct HASH_TABLE *pHash, u32 uNewSize)
 {
        if (uNewSize != pHash->uSize) {
                struct BUCKET **ppNewTable;
-               u32 uIndex;
                size_t table_size;
 
                PVR_DPF(PVR_DBG_MESSAGE,
@@ -161,8 +160,7 @@ static IMG_BOOL _Resize(struct HASH_TABLE *pHash, u32 uNewSize)
                           (void **) &ppNewTable, NULL) != PVRSRV_OK)
                        return IMG_FALSE;
 
-               for (uIndex = 0; uIndex < uNewSize; uIndex++)
-                       ppNewTable[uIndex] = NULL;
+               memset(ppNewTable, 0, table_size);
 
                if (_Rehash(pHash, pHash->ppBucketTable, pHash->uSize,
                            ppNewTable, uNewSize) != PVRSRV_OK) {