소스 검색

usb: dwc3: gadget: avoid memcpy()ing event buffer

We're only using the 4 byte events and memcpy()
will make us slower. We can easily avoid that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi 14 년 전
부모
커밋
d70d84423c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      drivers/usb/dwc3/gadget.c

+ 2 - 1
drivers/usb/dwc3/gadget.c

@@ -2223,7 +2223,8 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3 *dwc, u32 buf)
 	while (left > 0) {
 	while (left > 0) {
 		union dwc3_event event;
 		union dwc3_event event;
 
 
-		memcpy(&event.raw, (evt->buf + evt->lpos), sizeof(event.raw));
+		event.raw = *(u32 *) (evt->buf + evt->lpos);
+
 		dwc3_process_event_entry(dwc, &event);
 		dwc3_process_event_entry(dwc, &event);
 		/*
 		/*
 		 * XXX we wrap around correctly to the next entry as almost all
 		 * XXX we wrap around correctly to the next entry as almost all