celelibi at gmail.com
2015-Aug-26 02:28 UTC
[syslinux] [PATCH 0/3] efi: A few warning fixes
From: Sylvain Gault <sylvain.gault at gmail.com> I don't know if I should merge those trivial warning fix into one commit. I can reformat it as requested. Those are a few warning fixes for the efi part. The code involved has mainly been introduced in recent commits. Sylvain Gault (3): efi: fix warnings about argument types efi: fix pointer-type mismatch assigment warning efi: fix warning about unused variable efi/main.c | 6 +++--- efi/pxe.c | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) -- 2.5.0
celelibi at gmail.com
2015-Aug-26 02:28 UTC
[syslinux] [PATCH 1/3] efi: fix warnings about argument types
From: Sylvain Gault <sylvain.gault at gmail.com> The function efi_get_MAC was given a pointer to array instead of a simple pointer, generating a warning with gcc. Signed-off-by: Sylvain Gault <sylvain.gault at gmail.com> --- efi/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/efi/main.c b/efi/main.c index 6dbc259..8e08d4f 100644 --- a/efi/main.c +++ b/efi/main.c @@ -105,13 +105,13 @@ struct efi_binding *efi_create_binding(EFI_GUID *bguid, EFI_GUID *pguid) status = EFI_UNSUPPORTED; goto free_binding; } - efi_get_MAC(DevicePath, &mac_1, PXE_MAC_LENGTH); + efi_get_MAC(DevicePath, mac_1, PXE_MAC_LENGTH); status = LibLocateHandle(ByProtocol, bguid, NULL, &nr_handles, &handles); if (status != EFI_SUCCESS) goto free_binding; for (i = 0; i < nr_handles; i++) { DevicePath = DevicePathFromHandle(handles[i]); - if (efi_get_MAC(DevicePath, &mac_2, PXE_MAC_LENGTH) + if (efi_get_MAC(DevicePath, mac_2, PXE_MAC_LENGTH) && memcmp(mac_1, mac_2, PXE_MAC_LENGTH) == 0) { sb_handle = handles[i]; status = uefi_call_wrapper(BS->OpenProtocol, 6, sb_handle, -- 2.5.0
celelibi at gmail.com
2015-Aug-26 02:28 UTC
[syslinux] [PATCH 2/3] efi: fix pointer-type mismatch assigment warning
From: Sylvain Gault <sylvain.gault at gmail.com> The assignment looks suspicious but is actually legit since it is protected by the type check. Signed-off-by: Sylvain Gault <sylvain.gault at gmail.com> --- efi/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/efi/main.c b/efi/main.c index 8e08d4f..7d9d515 100644 --- a/efi/main.c +++ b/efi/main.c @@ -63,7 +63,7 @@ bool efi_get_MAC( EFI_DEVICE_PATH * pDevPath, uint8_t * mac, uint16_t mac_size) /* Find the handler to dump this device path node */ if (DevicePathType(DevPathNode) == MESSAGING_DEVICE_PATH && DevicePathSubType(DevPathNode) == MSG_MAC_ADDR_DP) { - MAC = DevPathNode; + MAC = (MAC_ADDR_DEVICE_PATH *)DevPathNode; CopyMem(mac, MAC->MacAddress.Addr, PXE_MAC_LENGTH); FreePool(pDevPath); return TRUE; -- 2.5.0
celelibi at gmail.com
2015-Aug-26 02:28 UTC
[syslinux] [PATCH 3/3] efi: fix warning about unused variable
From: Sylvain Gault <sylvain.gault at gmail.com> Signed-off-by: Sylvain Gault <sylvain.gault at gmail.com> --- efi/pxe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/efi/pxe.c b/efi/pxe.c index 4300947..1b3a460 100644 --- a/efi/pxe.c +++ b/efi/pxe.c @@ -96,7 +96,6 @@ void net_parse_dhcp(void) uint8_t hardlen; uint32_t ip; char dst[256]; - UINTN i = 0; status = uefi_call_wrapper(BS->HandleProtocol, 3, image_device_handle, &PxeBaseCodeProtocol, (void **)&bc); -- 2.5.0
On Tue, Aug 25, 2015 at 10:28 PM, celelibi--- via Syslinux <syslinux at zytor.com> wrote:> From: Sylvain Gault <sylvain.gault at gmail.com> > > I don't know if I should merge those trivial warning fix into one commit. I > can reformat it as requested. Those are a few warning fixes for the efi part. > The code involved has mainly been introduced in recent commits. > > Sylvain Gault (3): > efi: fix warnings about argument types > efi: fix pointer-type mismatch assigment warning > efi: fix warning about unused variable > > efi/main.c | 6 +++--- > efi/pxe.c | 1 - > 2 files changed, 3 insertions(+), 4 deletions(-)In my opinion, if there's a question about splitting commits and you can build at each stage, it's probably worth splitting. Micro-commits help if there's a need for bisection, especially if you're touching different code blocks each time. It means fewer lines of code to examine after the bisection is complete. That said, these are so small it's almost trivial to examine, especially when only 1 file is changed per commit so they could have been combined but I'm fine either way. These have been merged. -- -Gene