Skip to contentSkip to conversation

staging: rtl8712: Merge memcpy + be16_to_cpus to get_unaligned_be16

PATCH New Chuhong Yuan 1 participant 1 message Jul 19, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8712: Merge memcpy + be16_to_cpus to get_unaligned_be16

Merge the combo of memcpy and be16_to_cpus.
Use get_unaligned_be16 instead.
This simplifies the code.

---
 drivers/staging/rtl8712/rtl871x_recv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/rtl871x_recv.c +1 -2
index 5298fe603437..9969e5265a40 100644
@@ -245,8 +245,7 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter,
 	if (auth_alg == 2) {
 		/* get ether_type */
 		ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE;
-		memcpy(&ether_type, ptr, 2);
-		be16_to_cpus(&ether_type);
+		ether_type = get_unaligned_be16(ptr);
 
 		if ((psta != NULL) && (psta->ieee8021x_blocked)) {
 			/* blocked
Signature · 1 line
2.20.1