---
name: "usb_ep_align_maybe"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_ep_align_maybe"
---

# usb\_ep\_align\_maybe(9)

returns len aligned to ep's maxpacketsize if gadget requires quirk\_ep\_out\_aligned\_size, otherwise returns len.

## NAME

usb\_ep\_align\_maybe - returns *len* aligned to ep's maxpacketsize if gadget requires quirk\_ep\_out\_aligned\_size, otherwise returns len.

## SYNOPSIS

**size\_t usb\_ep\_align\_maybe(struct usb\_gadget \*** *g***, struct usb\_ep \*** *ep***, size\_t** *len***);**

## ARGUMENTS

*g*

controller to check for quirk

*ep*

the endpoint whose maxpacketsize is used to align *len*

*len*

buffer size's length to align to *ep*'s maxpacketsize

## DESCRIPTION

This helper is used in case it's required for any reason to check and maybe align buffer's size to an ep's maxpacketsize.

## AUTHOR

**David Brownell** \<dbrownell@users.sourceforge.net\>

Author.

## COPYRIGHT
