/* Read the initial_length field of the entry and store the size of the entry in @len. We return the number of bytes read. Return a count of 0 on error.  */
static int dwarf_entry_len(char *addr, unsigned long *len)
/* Read the initial_length field of the entry and store the size of the entry in @len. We return the number of bytes read. Return a count of 0 on error.  */
static int dwarf_entry_len(char *addr, unsigned long *len)
{
	u32 initial_len;
	int count;
	initial_len = get_unaligned((u32 *)addr);
	count = 4;
	if (initial_len >= DW_EXT_LO && initial_len <= DW_EXT_HI) {
		if (initial_len == DW_EXT_DWARF64) {
			*len = get_unaligned((u64 *)addr + 4);
			count = 12;
		} else {
			printk(KERN_WARNING "Unknown DWARF extension\n");
			count = 0;
		}
	} else
		*len = initial_len;
	return count;
}