diff options
-rw-r--r-- | firmware/lib20/common.c | 6 | ||||
-rw-r--r-- | futility/file_type.c | 2 | ||||
-rw-r--r-- | host/arch/x86/lib/crossystem_arch.c | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/firmware/lib20/common.c b/firmware/lib20/common.c index 9ce9d840..cee6cb42 100644 --- a/firmware/lib20/common.c +++ b/firmware/lib20/common.c @@ -28,14 +28,14 @@ int vb2_verify_member_inside(const void *parent, size_t parent_size, const ptrdiff_t data_end_offs = data_offs + member_data_size; /* Make sure parent doesn't wrap */ - if (parent_size < 0 || parent_end < (uintptr_t)parent) + if (parent_end < (uintptr_t)parent) return VB2_ERROR_INSIDE_PARENT_WRAPS; /* * Make sure the member is fully contained in the parent and doesn't * wrap. Use >, not >=, since member_size = 0 is possible. */ - if (member_size < 0 || member_end_offs < member_offs) + if (member_end_offs < member_offs) return VB2_ERROR_INSIDE_MEMBER_WRAPS; if (member_offs < 0 || member_offs > parent_size || member_end_offs > parent_size) @@ -46,7 +46,7 @@ int vb2_verify_member_inside(const void *parent, size_t parent_size, return VB2_ERROR_INSIDE_DATA_OVERLAP; /* Make sure parent fully contains member data, if any */ - if (member_data_size < 0 || data_end_offs < data_offs) + if (data_end_offs < data_offs) return VB2_ERROR_INSIDE_DATA_WRAPS; if (data_offs < 0 || data_offs > parent_size || data_end_offs > parent_size) diff --git a/futility/file_type.c b/futility/file_type.c index 08fd00e0..dff5d29d 100644 --- a/futility/file_type.c +++ b/futility/file_type.c @@ -31,7 +31,7 @@ struct futil_file_type_s { }; /* Populate a list of file types and operator functions. */ -static const struct futil_file_type_s const futil_file_types[] = { +static const struct futil_file_type_s futil_file_types[] = { {"unknown", "not something we know about", 0, 0, 0}, #define R_(x) x #define S_(x) x diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c index 15a6433e..84a49ee1 100644 --- a/host/arch/x86/lib/crossystem_arch.c +++ b/host/arch/x86/lib/crossystem_arch.c @@ -587,11 +587,9 @@ static int BayTrailFindGpioChipOffset(unsigned *gpio_num, unsigned *offset, } else if (*gpio_num >= 0x1000) { *gpio_num -= 0x1000; expected_uid = 2; - } else if (*gpio_num >= 0x0000) { + } else { *gpio_num -= 0x0000; expected_uid = 1; - } else { - return 0; } dir = opendir(GPIO_BASE_PATH); |