/* The TD size is the number of bytes remaining in the TD (including this TRB), right shifted by 10. It must fit in bits 21:17, so it can't be bigger than 31.  */
static u32 xhci_td_remainder(unsigned int remainder)
/* The TD size is the number of bytes remaining in the TD (including this TRB), right shifted by 10. It must fit in bits 21:17, so it can't be bigger than 31.  */
static u32 xhci_td_remainder(unsigned int remainder)
{
	u32 max = (1 << (21 - 17 + 1)) - 1;
	if ((remainder >> 10) >= max)
		return max << 17;
	else
		return (remainder >> 10) << 17;
}