Index: trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp	(revision 62485)
+++ trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp	(revision 63378)
@@ -459,6 +459,6 @@
 
 /** Just a worker for USBProxyServiceLinux::getDevices that avoids some code duplication. */
-static int usbfsAddDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, const char *pcszUsbfsRoot,
-                                 bool testfs, int rc)
+static int usbfsAddDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, const char *pszUsbfsRoot,
+                                 bool fUnsupportedDevicesToo, int rc)
 {
     /* usbDeterminState requires the address. */
@@ -466,9 +466,9 @@
     if (pDevNew)
     {
-        RTStrAPrintf((char **)&pDevNew->pszAddress, "%s/%03d/%03d", pcszUsbfsRoot, pDevNew->bBus, pDevNew->bDevNum);
+        RTStrAPrintf((char **)&pDevNew->pszAddress, "%s/%03d/%03d", pszUsbfsRoot, pDevNew->bBus, pDevNew->bDevNum);
         if (pDevNew->pszAddress)
         {
             pDevNew->enmState = usbDeterminState(pDevNew);
-            if (pDevNew->enmState != USBDEVICESTATE_UNSUPPORTED || testfs)
+            if (pDevNew->enmState != USBDEVICESTATE_UNSUPPORTED || fUnsupportedDevicesToo)
             {
                 if (*pppNext)
@@ -497,9 +497,9 @@
 
 
-static int usbfsOpenDevicesFile(const char *pcszUsbfsRoot, FILE **ppFile)
+static int usbfsOpenDevicesFile(const char *pszUsbfsRoot, FILE **ppFile)
 {
     char *pszPath;
     FILE *pFile;
-    RTStrAPrintf(&pszPath, "%s/devices", pcszUsbfsRoot);
+    RTStrAPrintf(&pszPath, "%s/devices", pszUsbfsRoot);
     if (!pszPath)
         return VERR_NO_MEMORY;
@@ -514,15 +514,16 @@
 
 /**
- * USBProxyService::getDevices() implementation for usbfs.  The @a testfs flag
- * tells the function to return information about unsupported devices as well.
- * This is used as a sanity test to check that a devices file is really what
- * we expect.
- */
-static PUSBDEVICE usbfsGetDevices(const char *pcszUsbfsRoot, bool testfs)
+ * USBProxyService::getDevices() implementation for usbfs.
+ *
+ * The @a fUnsupportedDevicesToo flag tells the function to return information
+ * about unsupported devices as well.  This is used as a sanity test to check
+ * that a devices file is really what we expect.
+ */
+static PUSBDEVICE usbfsGetDevices(const char *pszUsbfsRoot, bool fUnsupportedDevicesToo)
 {
     PUSBDEVICE pFirst = NULL;
     FILE *pFile = NULL;
     int rc;
-    rc = usbfsOpenDevicesFile(pcszUsbfsRoot, &pFile);
+    rc = usbfsOpenDevicesFile(pszUsbfsRoot, &pFile);
     if (RT_SUCCESS(rc))
     {
@@ -535,7 +536,7 @@
 
         /* Set close on exit and hope no one is racing us. */
-        rc =   fcntl(fileno(pFile), F_SETFD, FD_CLOEXEC) >= 0
-             ? VINF_SUCCESS
-             : RTErrConvertFromErrno(errno);
+        rc = fcntl(fileno(pFile), F_SETFD, FD_CLOEXEC) >= 0
+           ? VINF_SUCCESS
+           : RTErrConvertFromErrno(errno);
         while (     RT_SUCCESS(rc)
                &&   fgets(szLine, sizeof(szLine), pFile))
@@ -584,5 +585,5 @@
                     AssertMsg(cHits >= 3 || cHits == 0, ("cHits=%d\n", cHits));
                     if (cHits >= 3)
-                        rc = usbfsAddDeviceToChain(&Dev, &pFirst, &ppNext, pcszUsbfsRoot, testfs, rc);
+                        rc = usbfsAddDeviceToChain(&Dev, &pFirst, &ppNext, pszUsbfsRoot, fUnsupportedDevicesToo, rc);
                     else
                         deviceFreeMembers(&Dev);
@@ -777,5 +778,5 @@
         AssertMsg(cHits >= 3 || cHits == 0, ("cHits=%d\n", cHits));
         if (cHits >= 3)
-            rc = usbfsAddDeviceToChain(&Dev, &pFirst, &ppNext, pcszUsbfsRoot, testfs, rc);
+            rc = usbfsAddDeviceToChain(&Dev, &pFirst, &ppNext, pszUsbfsRoot, fUnsupportedDevicesToo, rc);
 
         /*
@@ -836,13 +837,13 @@
  * @returns a bus number greater than 0 on success or 0 on failure.
  */
-static unsigned usbsysfsGetBusFromPath(const char *pcszPath)
-{
-    const char *pcszFile = strrchr(pcszPath, '/');
-    if (!pcszFile)
+static unsigned usbsysfsGetBusFromPath(const char *pszPath)
+{
+    const char *pszFile = strrchr(pszPath, '/');
+    if (!pszFile)
         return 0;
-    unsigned bus = RTStrToUInt32(pcszFile + 1);
+    unsigned bus = RTStrToUInt32(pszFile + 1);
     if (   !bus
-        && pcszFile[1] == 'u' && pcszFile[2] == 's' && pcszFile[3] == 'b')
-    bus = RTStrToUInt32(pcszFile + 4);
+        && pszFile[1] == 'u' && pszFile[2] == 's' && pszFile[3] == 'b')
+    bus = RTStrToUInt32(pszFile + 4);
     return bus;
 }
@@ -864,21 +865,21 @@
 
 /**
- * If a file @a pcszNode from /sys/bus/usb/devices is a device rather than an
+ * If a file @a pszNode from /sys/bus/usb/devices is a device rather than an
  * interface add an element for the device to @a pvecDevInfo.
  */
-static int usbsysfsAddIfDevice(const char *pcszDevicesRoot, const char *pcszNode, VECTOR_OBJ(USBDeviceInfo) *pvecDevInfo)
-{
-    const char *pcszFile = strrchr(pcszNode, '/');
-    if (!pcszFile)
+static int usbsysfsAddIfDevice(const char *pszDevicesRoot, const char *pszNode, VECTOR_OBJ(USBDeviceInfo) *pvecDevInfo)
+{
+    const char *pszFile = strrchr(pszNode, '/');
+    if (!pszFile)
         return VERR_INVALID_PARAMETER;
-    if (strchr(pcszFile, ':'))
+    if (strchr(pszFile, ':'))
         return VINF_SUCCESS;
 
-    unsigned bus = usbsysfsGetBusFromPath(pcszNode);
+    unsigned bus = usbsysfsGetBusFromPath(pszNode);
     if (!bus)
         return VINF_SUCCESS;
 
     int64_t device;
-    int rc = RTLinuxSysFsReadIntFile(10, &device, "%s/devnum", pcszNode);
+    int rc = RTLinuxSysFsReadIntFile(10, &device, "%s/devnum", pszNode);
     if (RT_FAILURE(rc))
         return VINF_SUCCESS;
@@ -892,10 +893,10 @@
                                 szDevPath, sizeof(szDevPath),
                                 "%s/%.3d/%.3d",
-                                pcszDevicesRoot, bus, device);
+                                pszDevicesRoot, bus, device);
     if (RT_FAILURE(rc))
         return VINF_SUCCESS;
 
     USBDeviceInfo info;
-    if (usbsysfsInitDevInfo(&info, szDevPath, pcszNode))
+    if (usbsysfsInitDevInfo(&info, szDevPath, pszNode))
     {
         rc = VEC_PUSH_BACK_OBJ(pvecDevInfo, USBDeviceInfo, &info);
@@ -915,28 +916,28 @@
  * as the test requires file-system interaction.
  */
-static bool usbsysfsMuiIsAnInterfaceOf(const char *pcszIface, const char *pcszDev)
-{
-    size_t cchDev = strlen(pcszDev);
-
-    AssertPtr(pcszIface);
-    AssertPtr(pcszDev);
-    Assert(pcszIface[0] == '/');
-    Assert(pcszDev[0] == '/');
-    Assert(pcszDev[cchDev - 1] != '/');
-
-    /* If this passes, pcszIface is at least cchDev long */
-    if (strncmp(pcszIface, pcszDev, cchDev))
+static bool usbsysfsMuiIsAnInterfaceOf(const char *pszIface, const char *pszDev)
+{
+    size_t cchDev = strlen(pszDev);
+
+    AssertPtr(pszIface);
+    AssertPtr(pszDev);
+    Assert(pszIface[0] == '/');
+    Assert(pszDev[0] == '/');
+    Assert(pszDev[cchDev - 1] != '/');
+
+    /* If this passes, pszIface is at least cchDev long */
+    if (strncmp(pszIface, pszDev, cchDev))
         return false;
 
-    /* If this passes, pcszIface is longer than cchDev */
-    if (pcszIface[cchDev] != '/')
+    /* If this passes, pszIface is longer than cchDev */
+    if (pszIface[cchDev] != '/')
         return false;
 
     /* In sysfs an interface is an immediate subdirectory of the device */
-    if (strchr(pcszIface + cchDev + 1, '/'))
+    if (strchr(pszIface + cchDev + 1, '/'))
         return false;
 
     /* And it always has a colon in its name */
-    if (!strchr(pcszIface + cchDev + 1, ':'))
+    if (!strchr(pszIface + cchDev + 1, ':'))
         return false;
 
@@ -971,10 +972,10 @@
  * device.
  */
-static int usbsysfsAddIfInterfaceOf(const char *pcszNode, USBDeviceInfo *pInfo)
-{
-    if (!usbsysfsMuiIsAnInterfaceOf(pcszNode, pInfo->mSysfsPath))
+static int usbsysfsAddIfInterfaceOf(const char *pszNode, USBDeviceInfo *pInfo)
+{
+    if (!usbsysfsMuiIsAnInterfaceOf(pszNode, pInfo->mSysfsPath))
         return VINF_SUCCESS;
 
-    char *pszDup = (char *)RTStrDup(pcszNode);
+    char *pszDup = (char *)RTStrDup(pszNode);
     if (pszDup)
     {
@@ -995,5 +996,5 @@
  * files on which realpath() fails.
  */
-static int usbsysfsReadFilePathsFromDir(const char *pcszPath, DIR *pDir, VECTOR_PTR(char *) *pvecpchDevs)
+static int usbsysfsReadFilePathsFromDir(const char *pszPath, DIR *pDir, VECTOR_PTR(char *) *pvecpchDevs)
 {
     struct dirent entry, *pResult;
@@ -1007,12 +1008,12 @@
         if (entry.d_name[0] == '.')
             continue;
-        if (snprintf(szPath, sizeof(szPath), "%s/%s", pcszPath, entry.d_name) < 0)
-            return RTErrConvertFromErrno(errno); /** @todo r=bird: snprintf isn't document to set errno. Also, wouldn't it be better to continue on errors? Finally, you don't need to copy pcszPath each time... */
+        if (snprintf(szPath, sizeof(szPath), "%s/%s", pszPath, entry.d_name) < 0)
+            return RTErrConvertFromErrno(errno); /** @todo r=bird: snprintf isn't document to set errno. Also, wouldn't it be better to continue on errors? Finally, you don't need to copy pszPath each time... */
         if (!realpath(szPath, szRealPath))
             return RTErrConvertFromErrno(errno);
-        char *pszPath = RTStrDup(szRealPath);
-        if (!pszPath)
+        char *pszPathCopy = RTStrDup(szRealPath);
+        if (!pszPathCopy)
             return VERR_NO_MEMORY;
-        if (RT_FAILURE(rc = VEC_PUSH_BACK_PTR(pvecpchDevs, char *, pszPath)))
+        if (RT_FAILURE(rc = VEC_PUSH_BACK_PTR(pvecpchDevs, char *, pszPathCopy)))
             return rc;
     }
@@ -1025,19 +1026,19 @@
  *
  * @returns zero on success or (positive) posix error value.
- * @param   pcszPath      the path to dump.
+ * @param   pszPath      the path to dump.
  * @param   pvecpchDevs   an empty vector of char pointers - must be cleaned up
  *                        by the caller even on failure.
  * @param   withRealPath  whether to canonicalise the filename with realpath
  */
-static int usbsysfsReadFilePaths(const char *pcszPath, VECTOR_PTR(char *) *pvecpchDevs)
+static int usbsysfsReadFilePaths(const char *pszPath, VECTOR_PTR(char *) *pvecpchDevs)
 {
     AssertPtrReturn(pvecpchDevs, EINVAL);
     AssertReturn(VEC_SIZE_PTR(pvecpchDevs) == 0, EINVAL);
-    AssertPtrReturn(pcszPath, EINVAL);
-
-    DIR *pDir = opendir(pcszPath);
+    AssertPtrReturn(pszPath, EINVAL);
+
+    DIR *pDir = opendir(pszPath);
     if (!pDir)
         return RTErrConvertFromErrno(errno);
-    int rc = usbsysfsReadFilePathsFromDir(pcszPath, pDir, pvecpchDevs);
+    int rc = usbsysfsReadFilePathsFromDir(pszPath, pDir, pvecpchDevs);
     if (closedir(pDir) < 0 && RT_SUCCESS(rc))
         rc = RTErrConvertFromErrno(errno);
@@ -1054,5 +1055,5 @@
  *                     to simplify exit logic
  */
-static int usbsysfsEnumerateHostDevicesWorker(const char *pcszDevicesRoot,
+static int usbsysfsEnumerateHostDevicesWorker(const char *pszDevicesRoot,
                                               VECTOR_OBJ(USBDeviceInfo) *pvecDevInfo,
                                               VECTOR_PTR(char *) *pvecpchDevs)
@@ -1069,5 +1070,5 @@
     VEC_FOR_EACH(pvecpchDevs, char *, ppszEntry)
     {
-        rc = usbsysfsAddIfDevice(pcszDevicesRoot, *ppszEntry, pvecDevInfo);
+        rc = usbsysfsAddIfDevice(pszDevicesRoot, *ppszEntry, pvecDevInfo);
         if (RT_FAILURE(rc))
             return rc;
@@ -1086,5 +1087,5 @@
 
 
-static int usbsysfsEnumerateHostDevices(const char *pcszDevicesRoot, VECTOR_OBJ(USBDeviceInfo) *pvecDevInfo)
+static int usbsysfsEnumerateHostDevices(const char *pszDevicesRoot, VECTOR_OBJ(USBDeviceInfo) *pvecDevInfo)
 {
     VECTOR_PTR(char *) vecpchDevs;
@@ -1093,5 +1094,5 @@
     LogFlowFunc(("entered\n"));
     VEC_INIT_PTR(&vecpchDevs, char *, RTStrFree);
-    int rc = usbsysfsEnumerateHostDevicesWorker(pcszDevicesRoot, pvecDevInfo, &vecpchDevs);
+    int rc = usbsysfsEnumerateHostDevicesWorker(pszDevicesRoot, pvecDevInfo, &vecpchDevs);
     VEC_CLEANUP_PTR(&vecpchDevs);
     LogFlowFunc(("rc=%Rrc\n", rc));
@@ -1390,5 +1391,5 @@
  * USBProxyService::getDevices() implementation for sysfs.
  */
-static PUSBDEVICE usbsysfsGetDevices(const char *pcszDevicesRoot, bool testfs)
+static PUSBDEVICE usbsysfsGetDevices(const char *pszDevicesRoot, bool fUnsupportedDevicesToo)
 {
     /* Add each of the devices found to the chain. */
@@ -1400,5 +1401,5 @@
 
     VEC_INIT_OBJ(&vecDevInfo, USBDeviceInfo, usbsysfsCleanupDevInfo);
-    rc = usbsysfsEnumerateHostDevices(pcszDevicesRoot, &vecDevInfo);
+    rc = usbsysfsEnumerateHostDevices(pszDevicesRoot, &vecDevInfo);
     if (RT_FAILURE(rc))
         return NULL;
@@ -1412,5 +1413,5 @@
         if (   RT_SUCCESS(rc)
             && (   pDev->enmState != USBDEVICESTATE_UNSUPPORTED
-                || testfs)
+                || fUnsupportedDevicesToo)
             && pDev->pszAddress != NULL
            )
@@ -1448,4 +1449,5 @@
 static void *testDLSym(void *handle, const char *symbol)
 {
+    RT_NOREF(handle, symbol);
     Assert(handle == RTLD_DEFAULT);
     Assert(!RTStrCmp(symbol, "inotify_init"));
@@ -1494,13 +1496,14 @@
 static const char **g_papszUsbfsDeviceAddresses = NULL;
 
-static PUSBDEVICE testGetUsbfsDevices(const char *pcszUsbfsRoot, bool testfs)
-{
-    const char **pcsz;
+static PUSBDEVICE testGetUsbfsDevices(const char *pszUsbfsRoot, bool fUnsupportedDevicesToo)
+{
+    RT_NOREF(pszUsbfsRoot, fUnsupportedDevicesToo);
+    const char **psz;
     PUSBDEVICE pList = NULL, pTail = NULL;
-    for (pcsz = g_papszUsbfsDeviceAddresses; pcsz && *pcsz; ++pcsz)
+    for (psz = g_papszUsbfsDeviceAddresses; psz && *psz; ++psz)
     {
         PUSBDEVICE pNext = (PUSBDEVICE)RTMemAllocZ(sizeof(USBDEVICE));
         if (pNext)
-            pNext->pszAddress = RTStrDup(*pcsz);
+            pNext->pszAddress = RTStrDup(*psz);
         if (!pNext || !pNext->pszAddress)
         {
@@ -1534,9 +1537,10 @@
 static const char **g_papszAccessibleFiles = NULL;
 
-static int testAccess(const char *pcszPath, int mode)
-{
-    const char **pcsz;
-    for (pcsz = g_papszAccessibleFiles; pcsz && *pcsz; ++pcsz)
-        if (!RTStrCmp(pcszPath, *pcsz))
+static int testAccess(const char *pszPath, int mode)
+{
+    RT_NOREF(mode);
+    const char **psz;
+    for (psz = g_papszAccessibleFiles; psz && *psz; ++psz)
+        if (!RTStrCmp(pszPath, *psz))
             return 0;
     return -1;
@@ -1559,9 +1563,9 @@
 
 /** The path we pretend the usbfs root is located at, or NULL. */
-const char *s_pcszTestUsbfsRoot;
+const char *s_pszTestUsbfsRoot;
 /** Should usbfs be accessible to the current user? */
 bool s_fTestUsbfsAccessible;
 /** The path we pretend the device node tree root is located at, or NULL. */
-const char *s_pcszTestDevicesRoot;
+const char *s_pszTestDevicesRoot;
 /** Should the device node tree be accessible to the current user? */
 bool s_fTestDevicesAccessible;
@@ -1569,7 +1573,7 @@
 int s_rcTestMethodInitResult;
 /** The value of the VBOX_USB environment variable. */
-const char *s_pcszTestEnvUsb;
+const char *s_pszTestEnvUsb;
 /** The value of the VBOX_USB_ROOT environment variable. */
-const char *s_pcszTestEnvUsbRoot;
+const char *s_pszTestEnvUsbRoot;
 
 
@@ -1577,11 +1581,11 @@
  * during unit testing, and (hack!) what return code it will see from
  * the access method-specific initialisation. */
-void TestUSBSetupInit(const char *pcszUsbfsRoot, bool fUsbfsAccessible,
-                      const char *pcszDevicesRoot, bool fDevicesAccessible,
+void TestUSBSetupInit(const char *pszUsbfsRoot, bool fUsbfsAccessible,
+                      const char *pszDevicesRoot, bool fDevicesAccessible,
                       int rcMethodInitResult)
 {
-    s_pcszTestUsbfsRoot = pcszUsbfsRoot;
+    s_pszTestUsbfsRoot = pszUsbfsRoot;
     s_fTestUsbfsAccessible = fUsbfsAccessible;
-    s_pcszTestDevicesRoot = pcszDevicesRoot;
+    s_pszTestDevicesRoot = pszDevicesRoot;
     s_fTestDevicesAccessible = fDevicesAccessible;
     s_rcTestMethodInitResult = rcMethodInitResult;
@@ -1591,8 +1595,8 @@
 /** Specify the environment that the @a init method will see during unit
  * testing. */
-void TestUSBSetEnv(const char *pcszEnvUsb, const char *pcszEnvUsbRoot)
-{
-    s_pcszTestEnvUsb = pcszEnvUsb;
-    s_pcszTestEnvUsbRoot = pcszEnvUsbRoot;
+void TestUSBSetEnv(const char *pszEnvUsb, const char *pszEnvUsbRoot)
+{
+    s_pszTestEnvUsb = pszEnvUsb;
+    s_pszTestEnvUsbRoot = pszEnvUsbRoot;
 }
 
@@ -1600,21 +1604,21 @@
  * return test values. */
 # define RTEnvGet(a) \
-    (  !RTStrCmp(a, "VBOX_USB") ? s_pcszTestEnvUsb \
-     : !RTStrCmp(a, "VBOX_USB_ROOT") ? s_pcszTestEnvUsbRoot \
+    (  !RTStrCmp(a, "VBOX_USB") ? s_pszTestEnvUsb \
+     : !RTStrCmp(a, "VBOX_USB_ROOT") ? s_pszTestEnvUsbRoot \
      : NULL)
-# define USBProxyLinuxCheckDeviceRoot(pcszPath, fUseNodes) \
+# define USBProxyLinuxCheckDeviceRoot(pszPath, fUseNodes) \
     (   ((fUseNodes) && s_fTestDevicesAccessible \
-         && !RTStrCmp(pcszPath, s_pcszTestDevicesRoot)) \
+         && !RTStrCmp(pszPath, s_pszTestDevicesRoot)) \
      || (!(fUseNodes) && s_fTestUsbfsAccessible \
-         && !RTStrCmp(pcszPath, s_pcszTestUsbfsRoot)))
-# define RTDirExists(pcszDir) \
-    (   (pcszDir) \
-     && (   !RTStrCmp(pcszDir, s_pcszTestDevicesRoot) \
-         || !RTStrCmp(pcszDir, s_pcszTestUsbfsRoot)))
-# define RTFileExists(pcszFile) \
-    (   (pcszFile) \
-     && s_pcszTestUsbfsRoot \
-     && !RTStrNCmp(pcszFile, s_pcszTestUsbfsRoot, strlen(s_pcszTestUsbfsRoot)) \
-     && !RTStrCmp(pcszFile + strlen(s_pcszTestUsbfsRoot), "/devices"))
+         && !RTStrCmp(pszPath, s_pszTestUsbfsRoot)))
+# define RTDirExists(pszDir) \
+    (   (pszDir) \
+     && (   !RTStrCmp(pszDir, s_pszTestDevicesRoot) \
+         || !RTStrCmp(pszDir, s_pszTestUsbfsRoot)))
+# define RTFileExists(pszFile) \
+    (   (pszFile) \
+     && s_pszTestUsbfsRoot \
+     && !RTStrNCmp(pszFile, s_pszTestUsbfsRoot, strlen(s_pszTestUsbfsRoot)) \
+     && !RTStrCmp(pszFile + strlen(s_pszTestUsbfsRoot), "/devices"))
 
 #endif /* UNIT_TEST */
@@ -1631,8 +1635,8 @@
  *                              the prefered access method is USBFS-like and to
  *                              false if it is sysfs/device node-like
- * @param  ppcszDevicesRoot     on success the root of the tree of USBFS-like
+ * @param  ppszDevicesRoot     on success the root of the tree of USBFS-like
  *                              device nodes will be stored here
  */
-int USBProxyLinuxChooseMethod(bool *pfUsingUsbfsDevices, const char **ppcszDevicesRoot)
+int USBProxyLinuxChooseMethod(bool *pfUsingUsbfsDevices, const char **ppszDevicesRoot)
 {
     /*
@@ -1647,17 +1651,17 @@
     bool fUsbfsChosen = false;
     bool fSysfsChosen = false;
-    const char *pcszUsbFromEnv = RTEnvGet("VBOX_USB");
-    const char *pcszUsbRoot = NULL;
-    if (pcszUsbFromEnv)
+    const char *pszUsbFromEnv = RTEnvGet("VBOX_USB");
+    const char *pszUsbRoot = NULL;
+    if (pszUsbFromEnv)
     {
         bool fValidVBoxUSB = true;
 
-        pcszUsbRoot = RTEnvGet("VBOX_USB_ROOT");
-        if (!RTStrICmp(pcszUsbFromEnv, "USBFS"))
+        pszUsbRoot = RTEnvGet("VBOX_USB_ROOT");
+        if (!RTStrICmp(pszUsbFromEnv, "USBFS"))
         {
             LogRel(("Default USB access method set to \"usbfs\" from environment\n"));
             fUsbfsChosen = true;
         }
-        else if (!RTStrICmp(pcszUsbFromEnv, "SYSFS"))
+        else if (!RTStrICmp(pszUsbFromEnv, "SYSFS"))
         {
             LogRel(("Default USB method set to \"sysfs\" from environment\n"));
@@ -1666,12 +1670,12 @@
         else
         {
-            LogRel(("Invalid VBOX_USB environment variable setting \"%s\"\n", pcszUsbFromEnv));
+            LogRel(("Invalid VBOX_USB environment variable setting \"%s\"\n", pszUsbFromEnv));
             fValidVBoxUSB = false;
-            pcszUsbFromEnv = NULL;
-        }
-        if (!fValidVBoxUSB && pcszUsbRoot)
-            pcszUsbRoot = NULL;
-    }
-    if (!pcszUsbRoot)
+            pszUsbFromEnv = NULL;
+        }
+        if (!fValidVBoxUSB && pszUsbRoot)
+            pszUsbRoot = NULL;
+    }
+    if (!pszUsbRoot)
     {
         if (   !fUsbfsChosen
@@ -1679,5 +1683,5 @@
         {
             fSysfsChosen = true;
-            pcszUsbRoot = "/dev/vboxusb";
+            pszUsbRoot = "/dev/vboxusb";
         }
         else if (   !fSysfsChosen
@@ -1685,17 +1689,17 @@
         {
             fUsbfsChosen = true;
-            pcszUsbRoot = "/proc/bus/usb";
-        }
-    }
-    else if (!USBProxyLinuxCheckDeviceRoot(pcszUsbRoot, fSysfsChosen))
-        pcszUsbRoot = NULL;
-    if (pcszUsbRoot)
+            pszUsbRoot = "/proc/bus/usb";
+        }
+    }
+    else if (!USBProxyLinuxCheckDeviceRoot(pszUsbRoot, fSysfsChosen))
+        pszUsbRoot = NULL;
+    if (pszUsbRoot)
     {
         *pfUsingUsbfsDevices = fUsbfsChosen;
-        *ppcszDevicesRoot = pcszUsbRoot;
+        *ppszDevicesRoot = pszUsbRoot;
         return VINF_SUCCESS;
     }
     /* else */
-    return pcszUsbFromEnv ? VERR_NOT_FOUND
+    return pszUsbFromEnv ? VERR_NOT_FOUND
          : RTDirExists("/dev/vboxusb") ? VERR_VUSB_USB_DEVICE_PERMISSION
          : RTFileExists("/proc/bus/usb/devices") ? VERR_VUSB_USBFS_PERMISSION
@@ -1713,9 +1717,9 @@
  * Check whether a USB device tree root is usable.
  *
- * @param pcszRoot        the path to the root of the device tree
+ * @param pszRoot        the path to the root of the device tree
  * @param fIsDeviceNodes  whether this is a device node (or usbfs) tree
  * @note  returns a pointer into a static array so it will stay valid
  */
-bool USBProxyLinuxCheckDeviceRoot(const char *pcszRoot, bool fIsDeviceNodes)
+bool USBProxyLinuxCheckDeviceRoot(const char *pszRoot, bool fIsDeviceNodes)
 {
     bool fOK = false;
@@ -1723,8 +1727,8 @@
     {
 #ifdef VBOX_USB_WITH_USBFS
-        if (!access(pcszRoot, R_OK | X_OK))
+        if (!access(pszRoot, R_OK | X_OK))
         {
             fOK = true;
-            PUSBDEVICE pDevices = usbfsGetDevices(pcszRoot, true);
+            PUSBDEVICE pDevices = usbfsGetDevices(pszRoot, true);
             if (pDevices)
             {
@@ -1740,5 +1744,5 @@
 #ifdef VBOX_USB_WITH_SYSFS
     /* device nodes */
-    else if (usbsysfsInotifyAvailable() && !access(pcszRoot, R_OK | X_OK))
+    else if (usbsysfsInotifyAvailable() && !access(pszRoot, R_OK | X_OK))
         fOK = true;
 #endif
@@ -1756,13 +1760,13 @@
  * Result should be freed using #deviceFree or something equivalent.
  *
- * @param pcszDevicesRoot  the path to the root of the device tree
+ * @param pszDevicesRoot  the path to the root of the device tree
  * @param fUseSysfs        whether to use sysfs (or usbfs) for enumeration
  */
-PUSBDEVICE USBProxyLinuxGetDevices(const char *pcszDevicesRoot, bool fUseSysfs)
+PUSBDEVICE USBProxyLinuxGetDevices(const char *pszDevicesRoot, bool fUseSysfs)
 {
     if (!fUseSysfs)
     {
 #ifdef VBOX_USB_WITH_USBFS
-        return usbfsGetDevices(pcszDevicesRoot, false);
+        return usbfsGetDevices(pszDevicesRoot, false);
 #else
         return NULL;
@@ -1771,5 +1775,5 @@
 
 #ifdef VBOX_USB_WITH_SYSFS
-    return usbsysfsGetDevices(pcszDevicesRoot, false);
+    return usbsysfsGetDevices(pszDevicesRoot, false);
 #else
     return NULL;
