mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
usb: early: xhci-dbc: Use memcpy_and_pad()
Instead of zeroing some memory and then copying data in part or all of it, use memcpy_and_pad(). This avoids writing some memory twice and should save a few cycles. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/b447a7e9778d3f9e6997eb9494f1687dc2d5d3bf.1675016180.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e662c16f82
commit
49814e2c9c
@ -499,8 +499,7 @@ static int xdbc_bulk_transfer(void *data, int size, bool read)
|
||||
addr = xdbc.in_dma;
|
||||
xdbc.flags |= XDBC_FLAGS_IN_PROCESS;
|
||||
} else {
|
||||
memset(xdbc.out_buf, 0, XDBC_MAX_PACKET);
|
||||
memcpy(xdbc.out_buf, data, size);
|
||||
memcpy_and_pad(xdbc.out_buf, XDBC_MAX_PACKET, data, size, 0);
|
||||
addr = xdbc.out_dma;
|
||||
xdbc.flags |= XDBC_FLAGS_OUT_PROCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user