/* This function returns %0 on success and a negative error code on failure.  */
static int check_lpt_type(const struct ubifs_info *c, uint8_t **addr, int *pos, int type)
/* This function returns %0 on success and a negative error code on failure.  */
static int check_lpt_type(const struct ubifs_info *c, uint8_t **addr, int *pos, int type)
{
	int node_type;
	node_type = ubifs_unpack_bits(addr, pos, UBIFS_LPT_TYPE_BITS);
	if (node_type != type) {
		ubifs_err(c, "invalid type (%d) in LPT node type %d",
			  node_type, type);
		dump_stack();
		return -EINVAL;
	}
	return 0;
}