target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
static int fit_image_get_data_and_size(const void *fit, int noffset,
				const void **data, size_t *size)
{
	bool external_data = false;
	int offset;
	int len;
	int ret;

	if (!fit_image_get_data_position(fit, noffset, &offset)) {
		external_data = true;
	} else if (!fit_image_get_data_offset(fit, noffset, &offset)) {
		external_data = true;
		/*
		 * For FIT with external data, figure out where
		 * the external images start. This is the base
		 * for the data-offset properties in each image.
		 */
		offset += ((fdt_totalsize(fit) + 3) & ~3);
	}

	if (external_data) {
		ret = fit_image_get_data_size(fit, noffset, &len);
		if (!ret) {
			*data = fit + offset;
			*size = len;
		}
	} else {
		ret = fit_image_get_data(fit, noffset, data, size);
	}

	return ret;
}
/**
 * fit_image_get_data_and_size - get data and its size including
 *				 both embedded and external data
 * @fit: pointer to the FIT format image header
 * @noffset: component image node offset
 * @data: double pointer to void, will hold data property's data address
 * @size: pointer to size_t, will hold data property's data size
 *
 * fit_image_get_data_and_size() finds data and its size including
 * both embedded and external data. If the property is found
 * its data start address and size are returned to the caller.
 *
 * returns:
 *     0, on success
 *     otherwise, on failure
 */
get data and its size including
both embedded and external data
@fit: pointer to the FIT format image header
@noffset: component image node offset
@data: double pointer to void, will hold data property's data address
@size: pointer to size_t, will hold data property's data size

fit_image_get_data_and_size() finds data and its size including
both embedded and external data. If the property is found
its data start address and size are returned to the caller.

0, on success
otherwise, on failure
get data and its size including both embedded and external data @fit : pointer to the FIT format image header @noffset : component image node offset @data : double pointer to void will hold data property ' s data address @size : pointer to size_t will hold data property ' s data size fit_image_get_data_and_size () finds data and its size including both embedded and external data . If the property is found its data start address and size are returned to the caller . 0 on success otherwise on failure
static int fit_image_get_data_and_size(const void *fit, int noffset,
				const void **data, size_t *size)
{
	bool external_data = false;
	int offset;
	int len;
	int ret;
	if (!fit_image_get_data_position(fit, noffset, &offset)) {
		external_data = true;
	} else if (!fit_image_get_data_offset(fit, noffset, &offset)) {
		external_data = true;
		offset += ((fdt_totalsize(fit) + 3) & ~3);
	}
	if (external_data) {
		ret = fit_image_get_data_size(fit, noffset, &len);
		if (!ret) {
			*data = fit + offset;
			*size = len;
		}
	} else {
		ret = fit_image_get_data(fit, noffset, data, size);
	}
	return ret;
}
static int fit_image_get_data_and_size ( const void * fit , int noffset , const void * * data , size_t * size ) { bool external_data = false ; int offset ; int len ; int ret ; if ( ! fit_image_get_data_position ( fit , noffset , & offset ) ) { external_data = true ; } else if ( ! fit_image_get_data_offset ( fit , noffset , & offset ) ) { external_data = true ; offset += ( ( fdt_totalsize ( fit ) + 3 ) & ~ 3 ) ; } if ( external_data ) { ret = fit_image_get_data_size ( fit , noffset , & len ) ; if ( ! ret ) { * data = fit + offset ; * size = len ; } } else { ret = fit_image_get_data ( fit , noffset , data , size ) ; } return ret ; }
fit_image_get_data_and_size - get data and its size including
                               both embedded and external data
 @fit: pointer to the FIT format image header
 @noffset: component image node offset
 @data: double pointer to void, will hold data property's data address
 @size: pointer to size_t, will hold data property's data size
fit_image_get_data_and_size - get data and its size including both embedded and external data @fit : pointer to the FIT format image header @noffset : component image node offset @data : double pointer to void will hold data property ' s data address @size : pointer to size_t will hold data property ' s data size
/*
		 * For FIT with external data, figure out where
		 * the external images start. This is the base
		 * for the data-offset properties in each image.
		 */