Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grub: Changes towards building bits on a newer compiler #1

Open
wants to merge 21 commits into
base: bits
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fb99f17
util: add a missing header
ani-sinha Jun 1, 2022
dee9f23
build: Fix GRUB i386-pc build with Ubuntu gcc
ani-sinha Jun 1, 2022
36cde12
x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
ani-sinha Jun 1, 2022
f377008
abort: fix gcc complaint with applying 'noreturn' attribute
ani-sinha Jun 1, 2022
fe23c1a
lex: ignore unused value
ani-sinha Jun 2, 2022
a4ffa70
disable address-of-packed-member warning/failure
ani-sinha Jun 2, 2022
d7adac3
fix build failure due to undefined _GLOBAL_OFFSET_TABLE_ symbol
ani-sinha Jun 2, 2022
f20a2dc
Introduce grub_efi_packed_guid and use it where alignment is not gura…
ani-sinha Jun 2, 2022
7fb057b
Fix couple of linker complaints when built with the 2.34 version of l…
ani-sinha Jun 2, 2022
977cb1e
btrfs: fix glibc complaint about uninitialzied data structure
ani-sinha Jun 2, 2022
59ef15e
Fix alignment of some data structures
ani-sinha Jun 2, 2022
4602bad
fix implicit fallthrough gcc warnings
ani-sinha Jun 1, 2022
5d2f8bc
mdraid1x_linux: Fix gcc10 error -Werror=array-bounds
WenhuaChang Mar 26, 2020
0592676
Add GRUB_PACKED definition
ani-sinha Jul 2, 2022
e96575a
zfs: Fix gcc10 error -Werror=zero-length-bounds
WenhuaChang Mar 26, 2020
53d189d
* grub-core/fs/reiserfs.c (grub_reiserfs_iterate_dir): Fix type of en…
phcoder Nov 6, 2013
91650b5
* grub-core/disk/geli.c (geli_rekey): Fix error return type.
phcoder Nov 6, 2013
ca6da85
* grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Return right error …
ani-sinha Jul 3, 2022
58488d1
* grub-core/bus/usb/ehci.c (grub_ehci_restore_hw): Return right enum …
phcoder Nov 6, 2013
2d6c164
* grub-core/disk/usbms.c (grub_usbms_cbi_cmd): Fix error type. (grub_…
phcoder Nov 6, 2013
7f69537
grub-mkimage: make it link statically so that it can be used on any host
ani-sinha Jul 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.util.def
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ program = {
ldadd = '$(LIBLZMA)';
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
cppflags = '-DGRUB_PKGLIBDIR=\"$(pkglibdir)\"';
cflags = '-static';
};

program = {
Expand Down
2 changes: 1 addition & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else
fi
grub_cv_prog_objcopy_absolute=yes
for link_addr in 0x2000 0x8000 0x7C00; do
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},$link_addr conftest.o -o conftest.exec]); then :
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -static ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},$link_addr conftest.o -o conftest.exec]); then :
else
AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
fi
Expand Down
2 changes: 1 addition & 1 deletion conf/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .note.gnu.go
endif

CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -r -Wl,-d
CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ LDFLAGS="$TARGET_LDFLAGS"
LIBS=""

# debug flags.
WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
WARN_FLAGS="-Wall -Wno-address-of-packed-member -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
Expand Down Expand Up @@ -542,7 +542,7 @@ if test "x$target_m32" = x1; then
# Force 32-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m32"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32 -fno-pic"
TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
TARGET_MODULE_FORMAT="elf32"
fi
Expand Down
2 changes: 1 addition & 1 deletion gentpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def image(platform):
if test x$(USE_APPLE_CC_FIXES) = xyes; then \
$(MACHO2IMG) $< $@; \
else \
$(OBJCOPY) $(""" + cname() + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \
$(OBJCOPY) $(""" + cname() + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .note.gnu.property $< $@; \
fi
""")
return r
Expand Down
20 changes: 10 additions & 10 deletions grub-core/Makefile.core.def
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ kernel = {
nostrip = emu;

emu_ldflags = '-Wl,-r,-d';
i386_efi_ldflags = '-Wl,-r,-d';
i386_efi_ldflags = '-r -Wl,-d';
i386_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
x86_64_efi_ldflags = '-Wl,-r,-d';
x86_64_efi_ldflags = '-r -Wl,-d';
x86_64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';

ia64_efi_cflags = '-fno-builtin -fpic -minline-int-divide-max-throughput';
ia64_efi_ldflags = '-Wl,-r,-d';
ia64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';

i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x9000';

i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8200';
Expand Down Expand Up @@ -271,7 +271,7 @@ image = {
sparc64_ieee1275 = boot/sparc64/ieee1275/boot.S;

i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x7C00';

i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_BOOT_MACHINE_LINK_ADDR)';
Expand All @@ -293,7 +293,7 @@ image = {
cppflags = '-DHYBRID_BOOT=1';

i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x7C00';

objcopyflags = '-O binary';
enable = i386_pc;
Expand All @@ -304,7 +304,7 @@ image = {

i386_pc = boot/i386/pc/cdboot.S;
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x7C00';
objcopyflags = '-O binary';
enable = i386_pc;
};
Expand All @@ -314,7 +314,7 @@ image = {
i386_pc = boot/i386/pc/pxeboot.S;

i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x7C00';

objcopyflags = '-O binary';
enable = i386_pc;
Expand All @@ -325,7 +325,7 @@ image = {
i386_pc = boot/i386/pc/diskboot.S;

i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8000';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x8000';

sparc64_ieee1275 = boot/sparc64/ieee1275/diskboot.S;
sparc64_ieee1275_ldflags = '-Wl,-Ttext=0x4200';
Expand All @@ -341,7 +341,7 @@ image = {
i386_pc = boot/i386/pc/lnxboot.S;

i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x6000';
i386_pc_ldflags = '-static $(TARGET_IMG_BASE_LDOPT),0x6000';

objcopyflags = '-O binary';
enable = i386_pc;
Expand Down Expand Up @@ -388,7 +388,7 @@ image = {
i386_pc = boot/i386/pc/startup_raw.S;

objcopyflags = '-O binary';
ldflags = '$(TARGET_IMG_LDFLAGS) $(TARGET_IMG_BASE_LDOPT),0x8200';
ldflags = '-static $(TARGET_IMG_LDFLAGS) $(TARGET_IMG_BASE_LDOPT),0x8200';
enable = i386_pc;
};

Expand Down
9 changes: 5 additions & 4 deletions grub-core/bus/usb/ehci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <grub/time.h>
#include <grub/loader.h>
#include <grub/cs5536.h>
#include <grub/err.h>

GRUB_MOD_LICENSE ("GPLv3+");

Expand Down Expand Up @@ -1259,7 +1260,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev,
if ((transfer->dev->speed != GRUB_USB_SPEED_HIGH)
&& !transfer->dev->hubaddr)
{
grub_error (GRUB_USB_ERR_BADDEVICE,
grub_error (GRUB_ERR_BAD_DEVICE,
"FULL/LOW speed device on EHCI port!?!");
return GRUB_USB_ERR_BADDEVICE;
}
Expand Down Expand Up @@ -1719,7 +1720,7 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
/* FULL speed device connected - change port ownership.
* It results in disconnected state of this EHCI port. */
grub_ehci_port_setbits (e, port, GRUB_EHCI_PORT_OWNER);
return GRUB_USB_ERR_BADDEVICE;
return GRUB_ERR_BAD_DEVICE;
}

/* XXX: Fix it! There is possible problem - we can say to calling
Expand Down Expand Up @@ -1866,7 +1867,7 @@ grub_ehci_restore_hw (void)
}
}

return GRUB_USB_ERR_NONE;
return GRUB_ERR_NONE;
}

static grub_err_t
Expand All @@ -1886,7 +1887,7 @@ grub_ehci_fini_hw (int noreturn __attribute__ ((unused)))
grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI reset timeout");
}

return GRUB_USB_ERR_NONE;
return GRUB_ERR_NONE;
}

static struct grub_usb_controller_dev usb_controller = {
Expand Down
2 changes: 1 addition & 1 deletion grub-core/bus/usb/usbhub.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ grub_usb_add_hub (grub_usb_device_t dev)

rescan = 1;

return GRUB_ERR_NONE;
return GRUB_USB_ERR_NONE;
}

static void
Expand Down
8 changes: 4 additions & 4 deletions grub-core/commands/efi/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ struct grub_acpi_rsdp_v10 *
grub_machine_acpi_get_rsdpv1 (void)
{
unsigned i;
static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
static grub_efi_packed_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;

for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
{
grub_efi_guid_t *guid =
grub_efi_packed_guid_t *guid =
&grub_efi_system_table->configuration_table[i].vendor_guid;

if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t)))
Expand All @@ -44,11 +44,11 @@ struct grub_acpi_rsdp_v20 *
grub_machine_acpi_get_rsdpv2 (void)
{
unsigned i;
static grub_efi_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
static grub_efi_packed_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;

for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
{
grub_efi_guid_t *guid =
grub_efi_packed_guid_t *guid =
&grub_efi_system_table->configuration_table[i].vendor_guid;

if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_guid_t)))
Expand Down
2 changes: 1 addition & 1 deletion grub-core/commands/efi/loadbios.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fake_bios_data (int use_rom)
smbios = 0;
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
{
grub_efi_guid_t *guid =
grub_efi_packed_guid_t *guid =
&grub_efi_system_table->configuration_table[i].vendor_guid;

if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t)))
Expand Down
1 change: 1 addition & 0 deletions grub-core/commands/hdparm.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args)
ata = ((struct grub_scsi *) disk->data)->data;
break;
}
// fall through
default:
return grub_error (GRUB_ERR_IO, "not an ATA device");
}
Expand Down
1 change: 1 addition & 0 deletions grub-core/disk/cryptodisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev,
break;
case GRUB_CRYPTODISK_MODE_IV_PLAIN64:
iv[1] = grub_cpu_to_le32 (sector >> 32);
// fall through
case GRUB_CRYPTODISK_MODE_IV_PLAIN:
iv[0] = grub_cpu_to_le32 (sector & 0xFFFFFFFF);
break;
Expand Down
2 changes: 2 additions & 0 deletions grub-core/disk/diskfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ is_lv_readable (struct grub_diskfilter_lv *lv, int easily)
case GRUB_DISKFILTER_RAID6:
if (!easily)
need--;
// fall through
case GRUB_DISKFILTER_RAID4:
case GRUB_DISKFILTER_RAID5:
if (!easily)
Expand Down Expand Up @@ -507,6 +508,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector,
if (seg->node_count == 1)
return grub_diskfilter_read_node (&seg->nodes[0],
sector, size, buf);
// fall through
case GRUB_DISKFILTER_MIRROR:
case GRUB_DISKFILTER_RAID10:
{
Expand Down
3 changes: 3 additions & 0 deletions grub-core/disk/efi/efidisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ name_devices (struct grub_efidisk_data *devices)
{
case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
is_hard_drive = 1;
#if defined(__GNUC__) && __GNUC__ >= 7
__attribute__ ((fallthrough));
#endif
/* Fall through by intention. */
case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
{
Expand Down
2 changes: 1 addition & 1 deletion grub-core/disk/geli.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ geli_rekey (struct grub_cryptodisk *dev, grub_uint64_t zoneno)
gcry_err = grub_crypto_hmac_buffer (dev->hash, dev->rekey_key, 64,
&tohash, sizeof (tohash), key);
if (gcry_err)
return grub_crypto_gcry_error (gcry_err);
return gcry_err;

return grub_cryptodisk_setkey (dev, (grub_uint8_t *) key,
dev->rekey_derived_size);
Expand Down
2 changes: 1 addition & 1 deletion grub-core/disk/mdraid1x_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ grub_mdraid_detect (grub_disk_t disk,
return NULL;

if (grub_disk_read (disk, sector,
(char *) &sb.dev_roles[grub_le_to_cpu32 (sb.dev_number)]
(char *) (sb.dev_roles + grub_le_to_cpu32 (sb.dev_number))
- (char *) &sb,
sizeof (role), &role))
return NULL;
Expand Down
20 changes: 12 additions & 8 deletions grub-core/disk/usbms.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct grub_usbms_dev *grub_usbms_dev_t;
static grub_usbms_dev_t grub_usbms_devices[MAX_USBMS_DEVICES];
static int first_available_slot = 0;

static grub_err_t
static grub_usb_err_t
grub_usbms_cbi_cmd (grub_usb_device_t dev, int interface,
grub_uint8_t *cbicb)
{
Expand All @@ -86,7 +86,7 @@ grub_usbms_cbi_cmd (grub_usb_device_t dev, int interface,
GRUB_USBMS_CBI_CMD_SIZE, (char*)cbicb);
}

static grub_err_t
static grub_usb_err_t
grub_usbms_cbi_reset (grub_usb_device_t dev, int interface)
{
/* Prepare array with Command Block Reset (=CBR) */
Expand All @@ -108,17 +108,17 @@ grub_usbms_cbi_reset (grub_usb_device_t dev, int interface)
return grub_usbms_cbi_cmd (dev, interface, (grub_uint8_t *)&cbicb);
}

static grub_err_t
static grub_usb_err_t
grub_usbms_bo_reset (grub_usb_device_t dev, int interface)
{
grub_usb_err_t u;
u = grub_usb_control_msg (dev, 0x21, 255, 0, interface, 0, 0);
if (u)
return grub_error (GRUB_ERR_IO, "USB error %d", u);
return GRUB_ERR_NONE;
return u;
return GRUB_USB_ERR_NONE;
}

static grub_err_t
static grub_usb_err_t
grub_usbms_reset (grub_usbms_dev_t dev)
{
if (dev->protocol == GRUB_USBMS_PROTOCOL_BULK)
Expand Down Expand Up @@ -149,7 +149,7 @@ grub_usbms_attach (grub_usb_device_t usbdev, int configno, int interfno)
int j;
grub_uint8_t luns = 0;
unsigned curnum;
grub_usb_err_t err = GRUB_ERR_NONE;
grub_usb_err_t err = GRUB_USB_ERR_NONE;

if (first_available_slot == ARRAY_SIZE (grub_usbms_devices))
return 0;
Expand Down Expand Up @@ -567,7 +567,11 @@ grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
}
}

return err;

if (err)
return grub_error (GRUB_ERR_IO, "USB error %d", err);

return GRUB_ERR_NONE;
}


Expand Down
1 change: 1 addition & 0 deletions grub-core/efiemu/mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ grub_efiemu_mmap_fill (void)
default:
grub_dprintf ("efiemu",
"Unknown memory type %d. Assuming unusable\n", type);
// fall through
case GRUB_MEMORY_RESERVED:
return grub_efiemu_add_to_mmap (addr, size,
GRUB_EFI_UNUSABLE_MEMORY);
Expand Down
2 changes: 2 additions & 0 deletions grub-core/font/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
- grub_font_get_xheight (combining_glyphs[i]->font) - 1;
if (space <= 0)
space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
// fall through

case GRUB_UNICODE_STACK_ATTACHED_ABOVE:
do_blit (combining_glyphs[i], targetx,
Expand Down Expand Up @@ -1338,6 +1339,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
+ combining_glyphs[i]->height);
if (space <= 0)
space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
// fall through

case GRUB_UNICODE_STACK_ATTACHED_BELOW:
do_blit (combining_glyphs[i], targetx, -(bounds.y - space));
Expand Down