arch, base, dev, sim: Remove now unnecessary casts from PortProxy methods.

Change-Id: Ia73b2d86a10d02fa09c924a4571477bb5f200eb7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18572
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
diff --git a/src/arch/alpha/linux/system.cc b/src/arch/alpha/linux/system.cc
index 950b773..d963d29 100644
--- a/src/arch/alpha/linux/system.cc
+++ b/src/arch/alpha/linux/system.cc
@@ -90,8 +90,8 @@
      * kernel arguments directly into the kernel's memory.
      */
     virtProxy.writeBlob(CommandLine(),
-                        (uint8_t*)params()->boot_osflags.c_str(),
-                        params()->boot_osflags.length()+1);
+                        params()->boot_osflags.c_str(),
+                        params()->boot_osflags.length() + 1);
 
     /**
      * find the address of the est_cycle_freq variable and insert it
diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc
index a7822a3..83c4c26 100644
--- a/src/arch/alpha/process.cc
+++ b/src/arch/alpha/process.cc
@@ -162,7 +162,7 @@
     else
         panic("Unknown int size");
 
-    initVirtMem.writeBlob(memState->getStackMin(), (uint8_t*)&argc, intSize);
+    initVirtMem.writeBlob(memState->getStackMin(), &argc, intSize);
 
     copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
     copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
diff --git a/src/arch/alpha/system.cc b/src/arch/alpha/system.cc
index 3029429..b72821e 100644
--- a/src/arch/alpha/system.cc
+++ b/src/arch/alpha/system.cc
@@ -119,7 +119,7 @@
      * others do.)
      */
     if (consoleSymtab->findAddress("env_booted_osflags", addr)) {
-        virtProxy.writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),
+        virtProxy.writeBlob(addr, params()->boot_osflags.c_str(),
                             strlen(params()->boot_osflags.c_str()));
     }
 
diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc
index 1bb7548..25bccb6 100644
--- a/src/arch/arm/linux/process.cc
+++ b/src/arch/arm/linux/process.cc
@@ -148,7 +148,7 @@
     uint32_t tlsPtr = process->getSyscallArg(tc, index);
 
     tc->getMemProxy().writeBlob(ArmLinuxProcess32::commPage + 0x0ff0,
-                                 (uint8_t *)&tlsPtr, sizeof(tlsPtr));
+                                &tlsPtr, sizeof(tlsPtr));
     tc->setMiscReg(MISCREG_TPIDRURO,tlsPtr);
     return 0;
 }
diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc
index baa861f..8e3cfd9 100644
--- a/src/arch/arm/process.cc
+++ b/src/arch/arm/process.cc
@@ -415,8 +415,7 @@
 
     //Write out the sentry void *
     IntType sentry_NULL = 0;
-    initVirtMem.writeBlob(sentry_base,
-            (uint8_t*)&sentry_NULL, sentry_size);
+    initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
 
     //Fix up the aux vectors which point to other data
     for (int i = auxv.size() - 1; i >= 0; i--) {
@@ -446,7 +445,7 @@
     copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
     copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
 
-    initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+    initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
 
     ThreadContext *tc = system->getThreadContext(contextIds[0]);
     //Set the stack pointer register
diff --git a/src/arch/arm/semihosting.cc b/src/arch/arm/semihosting.cc
index 2b769ef..e04f419 100644
--- a/src/arch/arm/semihosting.cc
+++ b/src/arch/arm/semihosting.cc
@@ -272,7 +272,7 @@
     std::vector<char> buf(len + 1);
 
     buf[len] = '\0';
-    physProxy(tc).readBlob(ptr, (uint8_t *)buf.data(), len);
+    physProxy(tc).readBlob(ptr, buf.data(), len);
 
     return std::string(buf.data());
 }
@@ -479,8 +479,7 @@
     if (path_len >= max_len)
         return retError(ENOSPC);
 
-    physProxy(tc).writeBlob(
-        guest_buf, (const uint8_t *)path, path_len + 1);
+    physProxy(tc).writeBlob(guest_buf, path, path_len + 1);
     return retOK(0);
 }
 
@@ -551,9 +550,7 @@
     if (cmdLine.size() + 1 < argv[2]) {
         PortProxy &proxy = physProxy(tc);
         ByteOrder endian = ArmISA::byteOrder(tc);
-        proxy.writeBlob(
-            (Addr)argv[1],
-            (const uint8_t *)cmdLine.c_str(), cmdLine.size() + 1);
+        proxy.writeBlob((Addr)argv[1], cmdLine.c_str(), cmdLine.size() + 1);
 
         if (aarch64)
             proxy.write<uint64_t>(argv[0] + 1 * 8, cmdLine.size(), endian);
diff --git a/src/arch/generic/linux/threadinfo.hh b/src/arch/generic/linux/threadinfo.hh
index 89db36a..1595da4 100644
--- a/src/arch/generic/linux/threadinfo.hh
+++ b/src/arch/generic/linux/threadinfo.hh
@@ -87,7 +87,7 @@
             addr = tc->readMiscRegNoEffect(TheISA::CurThreadInfoReg);
 
         PortProxy &p = tc->getPhysProxy();
-        p.readBlob(addr, (uint8_t *)&sp, sizeof(Addr));
+        p.readBlob(addr, &sp, sizeof(Addr));
 
         return sp & ~ULL(0x3fff);
     }
diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc
index d837872..fb78cee 100644
--- a/src/arch/mips/process.cc
+++ b/src/arch/mips/process.cc
@@ -170,7 +170,7 @@
 
     argc = htog((IntType)argc);
 
-    initVirtMem.writeBlob(memState->getStackMin(), (uint8_t*)&argc, intSize);
+    initVirtMem.writeBlob(memState->getStackMin(), &argc, intSize);
 
     copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
 
diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc
index 1d082c7..6362027 100644
--- a/src/arch/power/process.cc
+++ b/src/arch/power/process.cc
@@ -233,8 +233,7 @@
 
     //Write out the sentry void *
     uint32_t sentry_NULL = 0;
-    initVirtMem.writeBlob(sentry_base,
-            (uint8_t*)&sentry_NULL, sentry_size);
+    initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
 
     //Fix up the aux vectors which point to other data
     for (int i = auxv.size() - 1; i >= 0; i--) {
@@ -261,7 +260,7 @@
     copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
     copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
 
-    initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+    initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
 
     ThreadContext *tc = system->getThreadContext(contextIds[0]);
 
diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc
index 3419e09..3bd3ea0 100644
--- a/src/arch/sparc/process.cc
+++ b/src/arch/sparc/process.cc
@@ -364,8 +364,7 @@
 
     // Write out the sentry void *
     uint64_t sentry_NULL = 0;
-    initVirtMem.writeBlob(sentry_base,
-            (uint8_t*)&sentry_NULL, sentry_size);
+    initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
 
     // Write the file name
     initVirtMem.writeString(file_name_base, filename.c_str());
@@ -385,7 +384,7 @@
     copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
     copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
 
-    initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+    initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
 
     // Set up space for the trap handlers into the processes address space.
     // Since the stack grows down and there is reserved address space abov
@@ -417,9 +416,9 @@
 
     // Stuff the trap handlers into the process address space
     initVirtMem.writeBlob(fillStart,
-            (uint8_t*)fillHandler64, sizeof(MachInst) * numFillInsts);
+            fillHandler64, sizeof(MachInst) * numFillInsts);
     initVirtMem.writeBlob(spillStart,
-            (uint8_t*)spillHandler64, sizeof(MachInst) *  numSpillInsts);
+            spillHandler64, sizeof(MachInst) *  numSpillInsts);
 }
 
 void
@@ -429,9 +428,9 @@
 
     // Stuff the trap handlers into the process address space
     initVirtMem.writeBlob(fillStart,
-            (uint8_t*)fillHandler32, sizeof(MachInst) * numFillInsts);
+            fillHandler32, sizeof(MachInst) * numFillInsts);
     initVirtMem.writeBlob(spillStart,
-            (uint8_t*)spillHandler32, sizeof(MachInst) *  numSpillInsts);
+            spillHandler32, sizeof(MachInst) *  numSpillInsts);
 }
 
 void Sparc32Process::flushWindows(ThreadContext *tc)
diff --git a/src/arch/x86/bios/e820.cc b/src/arch/x86/bios/e820.cc
index a1daf0a..6cb16c9 100644
--- a/src/arch/x86/bios/e820.cc
+++ b/src/arch/x86/bios/e820.cc
@@ -50,7 +50,7 @@
 void writeVal(T val, PortProxy& proxy, Addr &addr)
 {
     T guestVal = htog(val);
-    proxy.writeBlob(addr, (uint8_t *)&guestVal, sizeof(T));
+    proxy.writeBlob(addr, &guestVal, sizeof(T));
     addr += sizeof(T);
 }
 
@@ -64,7 +64,7 @@
 
     uint8_t guestE820Nr = htog(e820Nr);
 
-    proxy.writeBlob(countAddr, (uint8_t *)&guestE820Nr, sizeof(guestE820Nr));
+    proxy.writeBlob(countAddr, &guestE820Nr, sizeof(guestE820Nr));
 
     for (int i = 0; i < e820Nr; i++) {
         writeVal(entries[i]->addr, proxy, addr);
diff --git a/src/arch/x86/bios/intelmp.cc b/src/arch/x86/bios/intelmp.cc
index 07d2f13..a9da25a 100644
--- a/src/arch/x86/bios/intelmp.cc
+++ b/src/arch/x86/bios/intelmp.cc
@@ -74,7 +74,7 @@
 writeOutField(PortProxy& proxy, Addr addr, T val)
 {
     uint64_t guestVal = X86ISA::htog(val);
-    proxy.writeBlob(addr, (uint8_t *)(&guestVal), sizeof(T));
+    proxy.writeBlob(addr, &guestVal, sizeof(T));
 
     uint8_t checkSum = 0;
     while (guestVal) {
@@ -98,7 +98,7 @@
         memcpy(cleanedString, str.c_str(), str.length());
         memset(cleanedString + str.length(), 0, length - str.length());
     }
-    proxy.writeBlob(addr, (uint8_t *)(&cleanedString), length);
+    proxy.writeBlob(addr, &cleanedString, length);
 
     uint8_t checkSum = 0;
     for (int i = 0; i < length; i++)
@@ -121,7 +121,7 @@
 
     uint8_t checkSum = 0;
 
-    proxy.writeBlob(addr, (uint8_t *)signature, 4);
+    proxy.writeBlob(addr, signature, 4);
     for (int i = 0; i < 4; i++)
         checkSum += signature[i];
 
@@ -194,13 +194,13 @@
 {
     uint8_t checkSum = 0;
 
-    proxy.writeBlob(addr, (uint8_t *)signature, 4);
+    proxy.writeBlob(addr, signature, 4);
     for (int i = 0; i < 4; i++)
         checkSum += signature[i];
 
     // Base table length goes here but will be calculated later.
 
-    proxy.writeBlob(addr + 6, (uint8_t *)(&specRev), 1);
+    proxy.writeBlob(addr + 6, &specRev, 1);
     checkSum += specRev;
 
     // The checksum goes here but is still being calculated.
@@ -272,8 +272,8 @@
     checkSum += writeOutField(proxy, addr + 8, featureFlags);
 
     uint32_t reserved = 0;
-    proxy.writeBlob(addr + 12, (uint8_t *)(&reserved), 4);
-    proxy.writeBlob(addr + 16, (uint8_t *)(&reserved), 4);
+    proxy.writeBlob(addr + 12, &reserved, 4);
+    proxy.writeBlob(addr + 16, &reserved, 4);
     return 20;
 }
 
@@ -414,7 +414,7 @@
     checkSum += writeOutField(proxy, addr + 4, parentBus);
 
     uint32_t reserved = 0;
-    proxy.writeBlob(addr + 5, (uint8_t *)(&reserved), 3);
+    proxy.writeBlob(addr + 5, &reserved, 3);
 
     return length;
 }
diff --git a/src/arch/x86/bios/smbios.cc b/src/arch/x86/bios/smbios.cc
index 26785f5..cd91d2d 100644
--- a/src/arch/x86/bios/smbios.cc
+++ b/src/arch/x86/bios/smbios.cc
@@ -77,13 +77,13 @@
 uint16_t
 X86ISA::SMBios::SMBiosStructure::writeOut(PortProxy& proxy, Addr addr)
 {
-    proxy.writeBlob(addr, (uint8_t *)(&type), 1);
+    proxy.writeBlob(addr, &type, 1);
 
     uint8_t length = getLength();
-    proxy.writeBlob(addr + 1, (uint8_t *)(&length), 1);
+    proxy.writeBlob(addr + 1, &length, 1);
 
     uint16_t handleGuest = X86ISA::htog(handle);
-    proxy.writeBlob(addr + 2, (uint8_t *)(&handleGuest), 2);
+    proxy.writeBlob(addr + 2, &handleGuest, 2);
 
     return length + getStringLength();
 }
@@ -104,16 +104,15 @@
     // If there are string fields but none of them are used, that's a
     // special case which is handled by this if.
     if (strings.size() == 0 && stringFields) {
-        proxy.writeBlob(addr + offset, (uint8_t *)(&nullTerminator), 1);
+        proxy.writeBlob(addr + offset, &nullTerminator, 1);
         offset++;
     } else {
         for (it = strings.begin(); it != strings.end(); it++) {
-            proxy.writeBlob(addr + offset,
-                    (uint8_t *)it->c_str(), it->length() + 1);
+            proxy.writeBlob(addr + offset, it->c_str(), it->length() + 1);
             offset += it->length() + 1;
         }
     }
-    proxy.writeBlob(addr + offset, (uint8_t *)(&nullTerminator), 1);
+    proxy.writeBlob(addr + offset, &nullTerminator, 1);
 }
 
 int
@@ -177,26 +176,26 @@
 {
     uint8_t size = SMBiosStructure::writeOut(proxy, addr);
 
-    proxy.writeBlob(addr + 0x4, (uint8_t *)(&vendor), 1);
-    proxy.writeBlob(addr + 0x5, (uint8_t *)(&version), 1);
+    proxy.writeBlob(addr + 0x4, &vendor, 1);
+    proxy.writeBlob(addr + 0x5, &version, 1);
 
     uint16_t startingAddrSegmentGuest = X86ISA::htog(startingAddrSegment);
-    proxy.writeBlob(addr + 0x6, (uint8_t *)(&startingAddrSegmentGuest), 2);
+    proxy.writeBlob(addr + 0x6, &startingAddrSegmentGuest, 2);
 
-    proxy.writeBlob(addr + 0x8, (uint8_t *)(&releaseDate), 1);
-    proxy.writeBlob(addr + 0x9, (uint8_t *)(&romSize), 1);
+    proxy.writeBlob(addr + 0x8, &releaseDate, 1);
+    proxy.writeBlob(addr + 0x9, &romSize, 1);
 
     uint64_t characteristicsGuest = X86ISA::htog(characteristics);
-    proxy.writeBlob(addr + 0xA, (uint8_t *)(&characteristicsGuest), 8);
+    proxy.writeBlob(addr + 0xA, &characteristicsGuest, 8);
 
     uint16_t characteristicExtBytesGuest =
         X86ISA::htog(characteristicExtBytes);
-    proxy.writeBlob(addr + 0x12, (uint8_t *)(&characteristicExtBytesGuest), 2);
+    proxy.writeBlob(addr + 0x12, &characteristicExtBytesGuest, 2);
 
-    proxy.writeBlob(addr + 0x14, (uint8_t *)(&majorVer), 1);
-    proxy.writeBlob(addr + 0x15, (uint8_t *)(&minorVer), 1);
-    proxy.writeBlob(addr + 0x16, (uint8_t *)(&embContFirmwareMajor), 1);
-    proxy.writeBlob(addr + 0x17, (uint8_t *)(&embContFirmwareMinor), 1);
+    proxy.writeBlob(addr + 0x14, &majorVer, 1);
+    proxy.writeBlob(addr + 0x15, &minorVer, 1);
+    proxy.writeBlob(addr + 0x16, &embContFirmwareMajor, 1);
+    proxy.writeBlob(addr + 0x17, &embContFirmwareMinor, 1);
 
     writeOutStrings(proxy, addr + getLength());
 
@@ -231,21 +230,16 @@
 
     // The checksum goes here, but we're figuring it out as we go.
 
-    proxy.writeBlob(addr + 0x5,
-            (uint8_t *)(&smbiosHeader.entryPointLength), 1);
+    proxy.writeBlob(addr + 0x5, &smbiosHeader.entryPointLength, 1);
     mainChecksum += smbiosHeader.entryPointLength;
-    proxy.writeBlob(addr + 0x6,
-            (uint8_t *)(&smbiosHeader.majorVersion), 1);
+    proxy.writeBlob(addr + 0x6, &smbiosHeader.majorVersion, 1);
     mainChecksum += smbiosHeader.majorVersion;
-    proxy.writeBlob(addr + 0x7,
-            (uint8_t *)(&smbiosHeader.minorVersion), 1);
+    proxy.writeBlob(addr + 0x7, &smbiosHeader.minorVersion, 1);
     mainChecksum += smbiosHeader.minorVersion;
     // Maximum structure size goes here, but we'll figure it out later.
-    proxy.writeBlob(addr + 0xA,
-            (uint8_t *)(&smbiosHeader.entryPointRevision), 1);
+    proxy.writeBlob(addr + 0xA, &smbiosHeader.entryPointRevision, 1);
     mainChecksum += smbiosHeader.entryPointRevision;
-    proxy.writeBlob(addr + 0xB,
-            (uint8_t *)(&smbiosHeader.formattedArea), 5);
+    proxy.writeBlob(addr + 0xB, &smbiosHeader.formattedArea, 5);
     for (int i = 0; i < 5; i++)
         mainChecksum += smbiosHeader.formattedArea[i];
 
@@ -255,7 +249,7 @@
     uint8_t intChecksum = 0;
 
     proxy.writeBlob(addr + 0x10,
-            (uint8_t *)smbiosHeader.intermediateHeader.anchorString, 5);
+            smbiosHeader.intermediateHeader.anchorString, 5);
     for (int i = 0; i < 5; i++)
         intChecksum += smbiosHeader.intermediateHeader.anchorString[i];
 
@@ -264,22 +258,21 @@
 
     uint32_t tableAddrGuest =
         X86ISA::htog(smbiosHeader.intermediateHeader.tableAddr);
-    proxy.writeBlob(addr + 0x18, (uint8_t *)(&tableAddrGuest), 4);
+    proxy.writeBlob(addr + 0x18, &tableAddrGuest, 4);
     for (int i = 0; i < 4; i++) {
         intChecksum += tableAddrGuest;
         tableAddrGuest >>= 8;
     }
 
     uint16_t numStructs = X86ISA::gtoh(structures.size());
-    proxy.writeBlob(addr + 0x1C, (uint8_t *)(&numStructs), 2);
+    proxy.writeBlob(addr + 0x1C, &numStructs, 2);
     for (int i = 0; i < 2; i++) {
         intChecksum += numStructs;
         numStructs >>= 8;
     }
 
     proxy.writeBlob(addr + 0x1E,
-            (uint8_t *)(&smbiosHeader.intermediateHeader.smbiosBCDRevision),
-            1);
+            &smbiosHeader.intermediateHeader.smbiosBCDRevision, 1);
     intChecksum += smbiosHeader.intermediateHeader.smbiosBCDRevision;
 
     /*
@@ -304,7 +297,7 @@
      */
 
     maxSize = X86ISA::htog(maxSize);
-    proxy.writeBlob(addr + 0x8, (uint8_t *)(&maxSize), 2);
+    proxy.writeBlob(addr + 0x8, &maxSize, 2);
     for (int i = 0; i < 2; i++) {
         mainChecksum += maxSize;
         maxSize >>= 8;
@@ -312,7 +305,7 @@
 
     // Set the checksum
     mainChecksum = -mainChecksum;
-    proxy.writeBlob(addr + 0x4, (uint8_t *)(&mainChecksum), 1);
+    proxy.writeBlob(addr + 0x4, &mainChecksum, 1);
 
     /*
      * Intermediate header
@@ -320,14 +313,14 @@
 
     uint16_t tableSize = offset;
     tableSize = X86ISA::htog(tableSize);
-    proxy.writeBlob(addr + 0x16, (uint8_t *)(&tableSize), 2);
+    proxy.writeBlob(addr + 0x16, &tableSize, 2);
     for (int i = 0; i < 2; i++) {
         intChecksum += tableSize;
         tableSize >>= 8;
     }
 
     intChecksum = -intChecksum;
-    proxy.writeBlob(addr + 0x15, (uint8_t *)(&intChecksum), 1);
+    proxy.writeBlob(addr + 0x15, &intChecksum, 1);
 }
 
 X86ISA::SMBios::BiosInformation *
diff --git a/src/arch/x86/linux/system.cc b/src/arch/x86/linux/system.cc
index fc5bc2d..04ab023 100644
--- a/src/arch/x86/linux/system.cc
+++ b/src/arch/x86/linux/system.cc
@@ -80,14 +80,14 @@
     if (commandLine.length() + 1 > realModeData - commandLineBuff)
         panic("Command line \"%s\" is longer than %d characters.\n",
                 commandLine, realModeData - commandLineBuff - 1);
-    physProxy.writeBlob(commandLineBuff, (uint8_t *)commandLine.c_str(),
+    physProxy.writeBlob(commandLineBuff, commandLine.c_str(),
                         commandLine.length() + 1);
 
     // Generate a pointer of the right size and endianness to put into
     // commandLinePointer.
     uint32_t guestCommandLineBuff =
         X86ISA::htog((uint32_t)commandLineBuff);
-    physProxy.writeBlob(commandLinePointer, (uint8_t *)&guestCommandLineBuff,
+    physProxy.writeBlob(commandLinePointer, &guestCommandLineBuff,
                         sizeof(guestCommandLineBuff));
 
     /*
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc
index f4469bd..0765ade 100644
--- a/src/arch/x86/process.cc
+++ b/src/arch/x86/process.cc
@@ -239,7 +239,7 @@
         uint8_t numGDTEntries = 0;
         uint64_t nullDescriptor = 0;
         physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
-                            (uint8_t *)(&nullDescriptor), 8);
+                            &nullDescriptor, 8);
         numGDTEntries++;
 
         SegDescriptor initDesc = 0;
@@ -260,7 +260,7 @@
         csLowPLDesc.dpl = 0;
         uint64_t csLowPLDescVal = csLowPLDesc;
         physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
-                            (uint8_t *)(&csLowPLDescVal), 8);
+                            &csLowPLDescVal, 8);
 
         numGDTEntries++;
 
@@ -274,7 +274,7 @@
         dsLowPLDesc.dpl = 0;
         uint64_t dsLowPLDescVal = dsLowPLDesc;
         physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
-                            (uint8_t *)(&dsLowPLDescVal), 8);
+                            &dsLowPLDescVal, 8);
 
         numGDTEntries++;
 
@@ -288,7 +288,7 @@
         dsDesc.dpl = 3;
         uint64_t dsDescVal = dsDesc;
         physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
-                            (uint8_t *)(&dsDescVal), 8);
+                            &dsDescVal, 8);
 
         numGDTEntries++;
 
@@ -302,7 +302,7 @@
         csDesc.dpl = 3;
         uint64_t csDescVal = csDesc;
         physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
-                            (uint8_t *)(&csDescVal), 8);
+                            &csDescVal, 8);
 
         numGDTEntries++;
 
@@ -335,7 +335,7 @@
         } tssDescVal = {TSSDescLow, TSSDescHigh};
 
         physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
-                            (uint8_t *)(&tssDescVal), sizeof(tssDescVal));
+                            &tssDescVal, sizeof(tssDescVal));
 
         numGDTEntries++;
 
@@ -500,7 +500,7 @@
         tss.RSP1_high = tss.IST1_high;
         tss.RSP2_low  = tss.IST1_low;
         tss.RSP2_high = tss.IST1_high;
-        physProxy.writeBlob(tssPhysAddr, (uint8_t *)(&tss), sizeof(tss));
+        physProxy.writeBlob(tssPhysAddr, &tss, sizeof(tss));
 
         /* Setting IDT gates */
         GateDescriptorLow PFGateLow = 0;
@@ -520,8 +520,7 @@
             uint64_t high;
         } PFGate = {PFGateLow, PFGateHigh};
 
-        physProxy.writeBlob(idtPhysAddr + 0xE0,
-                            (uint8_t *)(&PFGate), sizeof(PFGate));
+        physProxy.writeBlob(idtPhysAddr + 0xE0, &PFGate, sizeof(PFGate));
 
         /* System call handler */
         uint8_t syscallBlob[] = {
@@ -999,7 +998,7 @@
 
     // Write out the sentry void *
     IntType sentry_NULL = 0;
-    initVirtMem.writeBlob(sentry_base, (uint8_t*)&sentry_NULL, sentry_size);
+    initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
 
     // Write the file name
     initVirtMem.writeString(file_name_base, filename.c_str());
@@ -1029,7 +1028,7 @@
     copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
     copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
 
-    initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+    initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
 
     ThreadContext *tc = system->getThreadContext(contextIds[0]);
     // Set the stack pointer register
diff --git a/src/arch/x86/pseudo_inst.cc b/src/arch/x86/pseudo_inst.cc
index 90000b8..fc71af1 100644
--- a/src/arch/x86/pseudo_inst.cc
+++ b/src/arch/x86/pseudo_inst.cc
@@ -73,8 +73,8 @@
         int size = 6;
         uint64_t is[size];
         // reading the interrupt handler stack
-        proxy.readBlob(ISTVirtAddr + PageBytes - size*sizeof(uint64_t),
-                       (uint8_t *)&is, sizeof(is));
+        proxy.readBlob(ISTVirtAddr + PageBytes - size * sizeof(uint64_t),
+                       &is, sizeof(is));
         panic("Page fault at addr %#x\n\tInterrupt handler stack:\n"
                 "\tss: %#x\n"
                 "\trsp: %#x\n"
diff --git a/src/arch/x86/system.cc b/src/arch/x86/system.cc
index 3f44ece..2af9ff5 100644
--- a/src/arch/x86/system.cc
+++ b/src/arch/x86/system.cc
@@ -141,8 +141,7 @@
     uint8_t numGDTEntries = 0;
     // Place holder at selector 0
     uint64_t nullDescriptor = 0;
-    physProxy.writeBlob(GDTBase + numGDTEntries * 8,
-                        (uint8_t *)(&nullDescriptor), 8);
+    physProxy.writeBlob(GDTBase + numGDTEntries * 8, &nullDescriptor, 8);
     numGDTEntries++;
 
     SegDescriptor initDesc = 0;
@@ -167,8 +166,7 @@
     // it's beginning in memory and it's actual data, we'll use an
     // intermediary.
     uint64_t csDescVal = csDesc;
-    physProxy.writeBlob(GDTBase + numGDTEntries * 8,
-                        (uint8_t *)(&csDescVal), 8);
+    physProxy.writeBlob(GDTBase + numGDTEntries * 8, (&csDescVal), 8);
 
     numGDTEntries++;
 
@@ -180,8 +178,7 @@
     // 32 bit data segment
     SegDescriptor dsDesc = initDesc;
     uint64_t dsDescVal = dsDesc;
-    physProxy.writeBlob(GDTBase + numGDTEntries * 8,
-                        (uint8_t *)(&dsDescVal), 8);
+    physProxy.writeBlob(GDTBase + numGDTEntries * 8, (&dsDescVal), 8);
 
     numGDTEntries++;
 
@@ -200,8 +197,7 @@
 
     SegDescriptor tssDesc = initDesc;
     uint64_t tssDescVal = tssDesc;
-    physProxy.writeBlob(GDTBase + numGDTEntries * 8,
-                        (uint8_t *)(&tssDescVal), 8);
+    physProxy.writeBlob(GDTBase + numGDTEntries * 8, (&tssDescVal), 8);
 
     numGDTEntries++;
 
@@ -230,25 +226,22 @@
     // read/write, user, not present
     uint64_t pml4e = X86ISA::htog(0x6);
     for (int offset = 0; offset < (1 << PML4Bits) * 8; offset += 8) {
-        physProxy.writeBlob(PageMapLevel4 + offset, (uint8_t *)(&pml4e), 8);
+        physProxy.writeBlob(PageMapLevel4 + offset, (&pml4e), 8);
     }
     // Point to the only PDPT
     pml4e = X86ISA::htog(0x7 | PageDirPtrTable);
-    physProxy.writeBlob(PageMapLevel4, (uint8_t *)(&pml4e), 8);
+    physProxy.writeBlob(PageMapLevel4, (&pml4e), 8);
 
     // Page Directory Pointer Table
 
     // read/write, user, not present
     uint64_t pdpe = X86ISA::htog(0x6);
-    for (int offset = 0; offset < (1 << PDPTBits) * 8; offset += 8) {
-        physProxy.writeBlob(PageDirPtrTable + offset,
-                            (uint8_t *)(&pdpe), 8);
-    }
+    for (int offset = 0; offset < (1 << PDPTBits) * 8; offset += 8)
+        physProxy.writeBlob(PageDirPtrTable + offset, &pdpe, 8);
     // Point to the PDTs
     for (int table = 0; table < NumPDTs; table++) {
         pdpe = X86ISA::htog(0x7 | PageDirTable[table]);
-        physProxy.writeBlob(PageDirPtrTable + table * 8,
-                            (uint8_t *)(&pdpe), 8);
+        physProxy.writeBlob(PageDirPtrTable + table * 8, &pdpe, 8);
     }
 
     // Page Directory Tables
@@ -259,8 +252,7 @@
         for (int offset = 0; offset < (1 << PDTBits) * 8; offset += 8) {
             // read/write, user, present, 4MB
             uint64_t pdte = X86ISA::htog(0x87 | base);
-            physProxy.writeBlob(PageDirTable[table] + offset,
-                                (uint8_t *)(&pdte), 8);
+            physProxy.writeBlob(PageDirTable[table] + offset, &pdte, 8);
             base += pageSize;
         }
     }
diff --git a/src/base/loader/hex_file.cc b/src/base/loader/hex_file.cc
index c803439..32de905 100644
--- a/src/base/loader/hex_file.cc
+++ b/src/base/loader/hex_file.cc
@@ -74,7 +74,7 @@
         parseLine(Line, &MemAddr, &Data);
         if (MemAddr != 0) {
             // Now, write to memory
-            memProxy.writeBlob(MemAddr << 2, (uint8_t *)&Data, sizeof(Data));
+            memProxy.writeBlob(MemAddr << 2, &Data, sizeof(Data));
         }
     }
     return true;
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index d620665..c092620 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -626,10 +626,10 @@
 
     if (FullSystem) {
         FSTranslatingPortProxy &proxy = tc->getVirtProxy();
-        proxy.readBlob(vaddr, (uint8_t*)data, size);
+        proxy.readBlob(vaddr, data, size);
     } else {
         SETranslatingPortProxy &proxy = tc->getMemProxy();
-        proxy.readBlob(vaddr, (uint8_t*)data, size);
+        proxy.readBlob(vaddr, data, size);
     }
 
 #if TRACING_ON
@@ -669,10 +669,10 @@
     }
     if (FullSystem) {
         FSTranslatingPortProxy &proxy = tc->getVirtProxy();
-        proxy.writeBlob(vaddr, (uint8_t*)data, size);
+        proxy.writeBlob(vaddr, data, size);
     } else {
         SETranslatingPortProxy &proxy = tc->getMemProxy();
-        proxy.writeBlob(vaddr, (uint8_t*)data, size);
+        proxy.writeBlob(vaddr, data, size);
     }
 
     return true;
diff --git a/src/dev/alpha/tsunami_pchip.cc b/src/dev/alpha/tsunami_pchip.cc
index bf17220..260d191 100644
--- a/src/dev/alpha/tsunami_pchip.cc
+++ b/src/dev/alpha/tsunami_pchip.cc
@@ -283,14 +283,16 @@
                         to create an address for the SG page
                     */
 
-                    tbaMask = ~(((wsm[i] & (ULL(0xfff) << 20)) >> 10) | ULL(0x3ff));
+                    tbaMask = ~(((wsm[i] & (ULL(0xfff) << 20)) >> 10) |
+                                ULL(0x3ff));
                     baMask = (wsm[i] & (ULL(0xfff) << 20)) | (ULL(0x7f) << 13);
                     pteAddr = (tba[i] & tbaMask) | ((busAddr & baMask) >> 10);
 
-                    sys->physProxy.readBlob(pteAddr, (uint8_t*)&pteEntry,
+                    sys->physProxy.readBlob(pteAddr, &pteEntry,
                                             sizeof(uint64_t));
 
-                    dmaAddr = ((pteEntry & ~ULL(0x1)) << 12) | (busAddr & ULL(0x1fff));
+                    dmaAddr = ((pteEntry & ~ULL(0x1)) << 12) |
+                              (busAddr & ULL(0x1fff));
 
                 } else {
                     baMask = (wsm[i] & (ULL(0xfff) << 20)) | ULL(0xfffff);
diff --git a/src/dev/arm/gic_v3_redistributor.cc b/src/dev/arm/gic_v3_redistributor.cc
index de6bd63..37f169f 100644
--- a/src/dev/arm/gic_v3_redistributor.cc
+++ b/src/dev/arm/gic_v3_redistributor.cc
@@ -815,11 +815,11 @@
         uint8_t lpi_config_table[number_lpis];
 
         memProxy->readBlob(lpiPendingTablePtr,
-                           (uint8_t *) lpi_pending_table,
+                           lpi_pending_table,
                            sizeof(lpi_pending_table));
 
         memProxy->readBlob(lpiConfigurationTablePtr,
-                           (uint8_t*) lpi_config_table,
+                           lpi_config_table,
                            sizeof(lpi_config_table));
 
         for (int lpi_id = SMALLEST_LPI_ID; lpi_id < largest_lpi_id;
@@ -869,7 +869,7 @@
 
     uint8_t lpi_pending_entry;
     memProxy->readBlob(lpi_pending_entry_ptr,
-                       (uint8_t*) &lpi_pending_entry,
+                       &lpi_pending_entry,
                        sizeof(lpi_pending_entry));
 
     return lpi_pending_entry;
@@ -881,7 +881,7 @@
     Addr lpi_pending_entry_ptr = lpiPendingTablePtr + (lpi_id / 8);
 
     memProxy->writeBlob(lpi_pending_entry_ptr,
-                        (uint8_t*) &lpi_pending_entry,
+                        &lpi_pending_entry,
                         sizeof(lpi_pending_entry));
 }
 
diff --git a/src/dev/virtio/base.cc b/src/dev/virtio/base.cc
index 61dd306..347f508 100644
--- a/src/dev/virtio/base.cc
+++ b/src/dev/virtio/base.cc
@@ -81,7 +81,7 @@
     assert(_index < queue->getSize());
     const Addr desc_addr(vq_addr + sizeof(desc) * _index);
     vring_desc guest_desc;
-    memProxy->readBlob(desc_addr, (uint8_t *)&guest_desc, sizeof(guest_desc));
+    memProxy->readBlob(desc_addr, &guest_desc, sizeof(guest_desc));
     desc = vtoh_legacy(guest_desc);
     DPRINTF(VIO,
             "VirtDescriptor(%i): Addr: 0x%x, Len: %i, Flags: 0x%x, "
@@ -161,7 +161,7 @@
     if (!isOutgoing())
         panic("Trying to write to incoming buffer\n");
 
-    memProxy->writeBlob(desc.addr + offset, const_cast<uint8_t *>(src), size);
+    memProxy->writeBlob(desc.addr + offset, src, size);
 }
 
 void
diff --git a/src/dev/virtio/base.hh b/src/dev/virtio/base.hh
index ed3b1b4..f4c85af 100644
--- a/src/dev/virtio/base.hh
+++ b/src/dev/virtio/base.hh
@@ -492,7 +492,7 @@
         /** Update the ring buffer header with data from the guest. */
         void readHeader() {
             assert(_base != 0);
-            _proxy.readBlob(_base, (uint8_t *)&header, sizeof(header));
+            _proxy.readBlob(_base, &header, sizeof(header));
             header.flags = vtoh_legacy(header.flags);
             header.index = vtoh_legacy(header.index);
         }
@@ -502,7 +502,7 @@
             assert(_base != 0);
             out.flags = htov_legacy(header.flags);
             out.index = htov_legacy(header.index);
-            _proxy.writeBlob(_base, (uint8_t *)&out, sizeof(out));
+            _proxy.writeBlob(_base, &out, sizeof(out));
         }
 
         void read() {
@@ -511,7 +511,7 @@
             /* Read and byte-swap the elements in the ring */
             T temp[ring.size()];
             _proxy.readBlob(_base + sizeof(header),
-                            (uint8_t *)temp, sizeof(T) * ring.size());
+                            temp, sizeof(T) * ring.size());
             for (int i = 0; i < ring.size(); ++i)
                 ring[i] = vtoh_legacy(temp[i]);
         }
@@ -524,7 +524,7 @@
             for (int i = 0; i < ring.size(); ++i)
                 temp[i] = htov_legacy(ring[i]);
             _proxy.writeBlob(_base + sizeof(header),
-                             (uint8_t *)temp, sizeof(T) * ring.size());
+                             temp, sizeof(T) * ring.size());
             writeHeader();
         }
 
diff --git a/src/sim/process_impl.hh b/src/sim/process_impl.hh
index 3f3d6ae..ae2a3b5 100644
--- a/src/sim/process_impl.hh
+++ b/src/sim/process_impl.hh
@@ -47,8 +47,7 @@
     AddrType data_ptr_swap;
     for (std::vector<std::string>::size_type i = 0; i < strings.size(); ++i) {
         data_ptr_swap = TheISA::htog(data_ptr);
-        memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr_swap,
-                sizeof(AddrType));
+        memProxy.writeBlob(array_ptr, &data_ptr_swap, sizeof(AddrType));
         memProxy.writeString(data_ptr, strings[i].c_str());
         array_ptr += sizeof(AddrType);
         data_ptr += strings[i].size() + 1;
@@ -56,7 +55,7 @@
     // add NULL terminator
     data_ptr = 0;
 
-    memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType));
+    memProxy.writeBlob(array_ptr, &data_ptr, sizeof(AddrType));
 }
 
 #endif
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 2230b62..dbbdf47 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1670,7 +1670,7 @@
     struct iovec hiov[count];
     for (size_t i = 0; i < count; ++i) {
         prox.readBlob(tiov_base + (i * sizeof(typename OS::tgt_iovec)),
-                      (uint8_t*)&tiov[i], sizeof(typename OS::tgt_iovec));
+                      &tiov[i], sizeof(typename OS::tgt_iovec));
         hiov[i].iov_len = TheISA::gtoh(tiov[i].iov_len);
         hiov[i].iov_base = new char [hiov[i].iov_len];
     }
@@ -1681,7 +1681,7 @@
     for (size_t i = 0; i < count; ++i) {
         if (result != -1) {
             prox.writeBlob(TheISA::htog(tiov[i].iov_base),
-                           (uint8_t*)hiov[i].iov_base, hiov[i].iov_len);
+                           hiov[i].iov_base, hiov[i].iov_len);
         }
         delete [] (char *)hiov[i].iov_base;
     }
@@ -1711,10 +1711,10 @@
         typename OS::tgt_iovec tiov;
 
         prox.readBlob(tiov_base + i*sizeof(typename OS::tgt_iovec),
-                      (uint8_t*)&tiov, sizeof(typename OS::tgt_iovec));
+                      &tiov, sizeof(typename OS::tgt_iovec));
         hiov[i].iov_len = TheISA::gtoh(tiov.iov_len);
         hiov[i].iov_base = new char [hiov[i].iov_len];
-        prox.readBlob(TheISA::gtoh(tiov.iov_base), (uint8_t *)hiov[i].iov_base,
+        prox.readBlob(TheISA::gtoh(tiov.iov_base), hiov[i].iov_base,
                       hiov[i].iov_len);
     }
 
@@ -2302,7 +2302,7 @@
         typename OS::time_t t = sec;
         t = TheISA::htog(t);
         SETranslatingPortProxy &p = tc->getMemProxy();
-        p.writeBlob(taddr, (uint8_t*)&t, (int)sizeof(typename OS::time_t));
+        p.writeBlob(taddr, &t, (int)sizeof(typename OS::time_t));
     }
     return sec;
 }