/* Description: returns 1 if valid, 0 on error.  */
static int is_pte_valid(const gpt_entry *pte, const u64 lastlba)
/* Description: returns 1 if valid, 0 on error.  */
static int is_pte_valid(const gpt_entry *pte, const u64 lastlba)
{
	if ((!efi_guidcmp(pte->partition_type_guid, NULL_GUID)) ||
	    le64_to_cpu(pte->starting_lba) > lastlba         ||
	    le64_to_cpu(pte->ending_lba)   > lastlba)
		return 0;
	return 1;
}