Commit 19a2a67fa27ac5bf50808bbded5c19279c7d86e5

Authored by Jeroen Hofstee
Committed by Marek Vasut
1 parent 933611f7bb

usb:g_dnl:f_thor: remove memset before memcpy

since ALLOC_CACHE_ALIGN_BUFFER defines a pointer and not a
buffer, the memset with sizeof(rqt) likely does something else
then intended. Since there is a memcpy directly after it with
the full size, drop the memset completely.

Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>

Showing 1 changed file with 0 additions and 1 deletions Side-by-side Diff

drivers/usb/gadget/f_thor.c
... ... @@ -306,7 +306,6 @@
306 306 ALLOC_CACHE_ALIGN_BUFFER(struct rqt_box, rqt, sizeof(struct rqt_box));
307 307 int ret = -EINVAL;
308 308  
309   - memset(rqt, 0, sizeof(rqt));
310 309 memcpy(rqt, thor_rx_data_buf, sizeof(struct rqt_box));
311 310  
312 311 debug("+RQT: %d, %d\n", rqt->rqt, rqt->rqt_data);