/* derive number of elements in scatterlist Shamlessly copy from talitos.c  */
static int get_sg_count(struct scatterlist *sg_list, int nbytes)
/* derive number of elements in scatterlist Shamlessly copy from talitos.c  */
static int get_sg_count(struct scatterlist *sg_list, int nbytes)
{
	struct scatterlist *sg = sg_list;
	int sg_nents = 0;
	while (nbytes) {
		sg_nents++;
		if (sg->length > nbytes)
			break;
		nbytes -= sg->length;
		sg = sg_next(sg);
	}
	return sg_nents;
}