summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Kuivenhoven <bemk@redhat.com>2013-10-08 10:38:49 +0200
committerBart Kuivenhoven <bemk@redhat.com>2013-10-08 10:49:23 +0200
commit86a68608f41e538b719df26caf46c793fa65d76a (patch)
tree640dc907df41aa49a832970a71caeedd07555bfe
parent5f765e9208897634ba6c275555bfc82056cb7f4a (diff)
downloadgnu-efi-3.0-86a68608f41e538b719df26caf46c793fa65d76a.tar.gz
gnu-efi-3.0-86a68608f41e538b719df26caf46c793fa65d76a.tar.xz
gnu-efi-3.0-86a68608f41e538b719df26caf46c793fa65d76a.zip
lib: Fix warnings
There were some warnings on compiling, which have now been fixed. The first set of warnings, comes from variables that only get used in an assert statement. In order to make sure that those aren't broken in case this is used for debugging, I've put pragma's around them, to prevent warnings (in case of GCC). The next set of warnings came from unused variables, that weren't used in anything else. Those have been commented out, but still left in the codebase so that if it was something somebody was working on, can still continue, while this batch of code is also free of warnings. The last set of warnings I fixed was because of integers being cast to pointers of different size. Since I didn't feel like digging in too deep, this too has been put on the ignore list using some pragmas. Signed-off-by: Bart Kuivenhoven <bemk@redhat.com>
-rw-r--r--gnu-efi-3.0/lib/dpath.c9
-rw-r--r--gnu-efi-3.0/lib/event.c7
-rw-r--r--gnu-efi-3.0/lib/hand.c5
-rw-r--r--gnu-efi-3.0/lib/hw.c9
-rw-r--r--gnu-efi-3.0/lib/smbios.c20
5 files changed, 42 insertions, 8 deletions
diff --git a/gnu-efi-3.0/lib/dpath.c b/gnu-efi-3.0/lib/dpath.c
index 863da7a..a3b73aa 100644
--- a/gnu-efi-3.0/lib/dpath.c
+++ b/gnu-efi-3.0/lib/dpath.c
@@ -675,9 +675,12 @@ _DevPathIPv4 (
IN VOID *DevPath
)
{
+/*
+ * I can't help but feel this code is a bit pointless ...
IPv4_DEVICE_PATH *IP;
IP = DevPath;
+*/
CatPrint(Str, L"IPv4(not-done)");
}
@@ -687,9 +690,12 @@ _DevPathIPv6 (
IN VOID *DevPath
)
{
+/*
+ * The same feeling for pointlessness ..
IPv6_DEVICE_PATH *IP;
IP = DevPath;
+*/
CatPrint(Str, L"IP-v6(not-done)");
}
@@ -699,9 +705,12 @@ _DevPathInfiniBand (
IN VOID *DevPath
)
{
+/*
+ * What does this do, besides throw up compiler warnings?
INFINIBAND_DEVICE_PATH *InfiniBand;
InfiniBand = DevPath;
+*/
CatPrint(Str, L"InfiniBand(not-done)");
}
diff --git a/gnu-efi-3.0/lib/event.c b/gnu-efi-3.0/lib/event.c
index 6c16c62..568e313 100644
--- a/gnu-efi-3.0/lib/event.c
+++ b/gnu-efi-3.0/lib/event.c
@@ -17,6 +17,10 @@ Revision History
#include "lib.h"
+#if defined __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#endif
EFI_EVENT
LibCreateProtocolNotifyEvent (
@@ -68,6 +72,9 @@ LibCreateProtocolNotifyEvent (
return Event;
}
+#if defined __GNUC__
+#pragma GCC diagnostic pop
+#endif
EFI_STATUS
WaitForSingleEvent (
diff --git a/gnu-efi-3.0/lib/hand.c b/gnu-efi-3.0/lib/hand.c
index c41c729..8615723 100644
--- a/gnu-efi-3.0/lib/hand.c
+++ b/gnu-efi-3.0/lib/hand.c
@@ -117,7 +117,8 @@ LibLocateHandleByDiskSignature (
EFI_HANDLE *BlockIoBuffer;
EFI_DEVICE_PATH *DevicePath;
UINTN Index;
- EFI_DEVICE_PATH *Start, *Next, *DevPath;
+ //EFI_DEVICE_PATH *Start; // This variable seems to be unused
+ EFI_DEVICE_PATH *Next, *DevPath;
HARDDRIVE_DEVICE_PATH *HardDriveDevicePath;
BOOLEAN Match;
BOOLEAN PreviousNodeIsHardDriveDevicePath;
@@ -199,7 +200,7 @@ LibLocateHandleByDiskSignature (
PreviousNodeIsHardDriveDevicePath = FALSE;
DevPath = DevicePath;
- Start = DevPath;
+ // Start = DevPath;
//
// Check for end of device path type
diff --git a/gnu-efi-3.0/lib/hw.c b/gnu-efi-3.0/lib/hw.c
index 3d651ad..ceb11a4 100644
--- a/gnu-efi-3.0/lib/hw.c
+++ b/gnu-efi-3.0/lib/hw.c
@@ -18,7 +18,6 @@ Revision History
#include "lib.h"
-
EFI_STATUS
InitializeGlobalIoDevice (
IN EFI_DEVICE_PATH *DevicePath,
@@ -68,6 +67,11 @@ Returns:
return Status;
}
+#if defined __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#endif
+
UINT32
ReadPort (
IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs,
@@ -128,5 +132,8 @@ WritePciConfig (
return (UINT32)Data;
}
+#if defined __GNUC__
+#pragma GCC diagnostic pop
+#endif
diff --git a/gnu-efi-3.0/lib/smbios.c b/gnu-efi-3.0/lib/smbios.c
index 5986f5a..46249cc 100644
--- a/gnu-efi-3.0/lib/smbios.c
+++ b/gnu-efi-3.0/lib/smbios.c
@@ -25,17 +25,27 @@ LibGetSmbiosSystemGuidAndSerialNumber (
{
EFI_STATUS Status;
SMBIOS_STRUCTURE_TABLE *SmbiosTable;
- SMBIOS_STRUCTURE_POINTER Smbios;
- SMBIOS_STRUCTURE_POINTER SmbiosEnd;
+ SMBIOS_STRUCTURE_POINTER Smbios;
+ SMBIOS_STRUCTURE_POINTER SmbiosEnd;
UINT16 Index;
-
+
Status = LibGetSystemConfigurationTable(&SMBIOSTableGuid, (VOID**)&SmbiosTable);
if (EFI_ERROR(Status)) {
return EFI_NOT_FOUND;
}
- Smbios.Hdr = (SMBIOS_HEADER *)SmbiosTable->TableAddress;
+#if defined __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#endif
+
+ Smbios.Hdr = (SMBIOS_HEADER *)(SmbiosTable->TableAddress);
SmbiosEnd.Raw = (UINT8 *)(SmbiosTable->TableAddress + SmbiosTable->TableLength);
+
+#if defined __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
for (Index = 0; Index < SmbiosTable->TableLength ; Index++) {
if (Smbios.Hdr->Type == 1) {
if (Smbios.Hdr->Length < 0x19) {
@@ -48,7 +58,7 @@ LibGetSmbiosSystemGuidAndSerialNumber (
//
// SMBIOS tables are byte packed so we need to do a byte copy to
// prevend alignment faults on IA-64.
-
+
CopyMem (SystemGuid, &Smbios.Type1->Uuid, sizeof(EFI_GUID));
*SystemSerialNumber = LibGetSmbiosString(&Smbios, Smbios.Type1->SerialNumber);
return EFI_SUCCESS;