]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: UefiHandleParsingLib: remove tautological comparison
authorLaszlo Ersek <lersek@redhat.com>
Thu, 30 Jun 2016 20:39:00 +0000 (22:39 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 30 Jun 2016 21:14:29 +0000 (23:14 +0200)
The code being removed in this patch dates back to git commit a405b86d274d
(Sep 14, 2010; "udk2010.up2.shell initial release."). The condition always
evaluates to true, and it breaks DEBUG builds of ArmVirtPkg with gcc-6.1:

  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c:
    In function 'ParseHandleDatabaseByRelationshipWithType':
  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c:2465:76:
    error: self-comparison always evaluates to true
    [-Werror=tautological-compare]
         ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]);

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Michael Zimmermann <sigmaepsilon92@gmail.com>
Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Reported-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Suggested-by: Jaben Carsey <jaben.carsey@intel.com>
Ref: http://thread.gmane.org/gmane.comp.bios.edk2.devel/13794/focus=13939
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c

index b82f925c9218293a09d8ed45b936dba7668f304f..63710865251d85a137f60ac27ec098f748e76a77 100644 (file)
@@ -2460,10 +2460,6 @@ ParseHandleDatabaseByRelationshipWithType (
         (*HandleType)[HandleIndex] |= (UINTN)HR_COMPONENT_NAME_HANDLE;\r
       } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid)          ) {\r
         (*HandleType)[HandleIndex] |= (UINTN)HR_DEVICE_HANDLE;\r
-      } else {\r
-        DEBUG_CODE_BEGIN();\r
-        ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]);\r
-        DEBUG_CODE_END();\r
       }\r
       //\r
       // Retrieve the list of agents that have opened each protocol\r