Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3263441ybi; Fri, 19 Jul 2019 00:12:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXcTuZlb7PnvQn3AEfnbIRm/EchPfc50TU/vRXzDjA6J2MdnkwrS04rXNM+KM116GQEAaQ X-Received: by 2002:a17:902:f81:: with SMTP id 1mr54567263plz.191.1563520325612; Fri, 19 Jul 2019 00:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563520325; cv=none; d=google.com; s=arc-20160816; b=gzpS2yqQtzapSLRJlZiq0LoPCozqLMHMp7AJOHoHvM0C2z2SINska/3a6qfYeqzvQW eeK3ezV75sq3T2JZNzN/a4qmmbyQUjc+ePEQeMmwCQh+tSBS5kn7Wzvtso1zm9udDQGX VcG8rz/WmKKwhGZ0GRE5m0X97oo5kgCA4ylL8rjL58umLN8eqRYcPKCybTD3P3EDAqMo P15liA6z7zO2h6J0FvG3bCyJpnMI7X3eqp6TZrIJcEwPTMLYInQ3GF9IPQj4c3aSxvP5 HIsWBvWFj0hTk1fxrtwrVr6Lif8ywwnAN3pOmfCZMahJD8XMca4fDQVHqmQB/U++aZHw 19VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=hw2kNiLoj+LvvfY1YdobU4HU5vXnmTyj3KhgfWP8Lyc=; b=puE5SnkSgrMp9xKNMddYnhZYP+W7MGJK1PgDBdCRWi230QYCSJ+TkspbWiLOk6oLNZ aIU8ExQkBAbE5Xu7lm+aZzz7JRistn+4CTGwWZMDojS67Wwj14rlQiW/q45DRxv/yrpr ZKQVjKXS2NjKnOQPZqwiwVuU+tJ02NcJqj2v/cCxRy1pf/fx4NJOhaKvEO8cmwE3Q9Wt 6qCaUOF2jbqEVzoTwJm/9hEkzbpFvzORVW+2qFrwe6aJJds+MhWPNuMXEdDe3Rgl08dd 31JQvaSesUYF49tc01ewop2JH6FZSrzDbOhYYOrM7SqcX/0+kr5XCBRjBipppohFkexI O5Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=F30SYFLz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x13si1651691pfr.274.2019.07.19.00.11.50; Fri, 19 Jul 2019 00:12:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=F30SYFLz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727576AbfGSHJz (ORCPT + 99 others); Fri, 19 Jul 2019 03:09:55 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34464 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727535AbfGSHJx (ORCPT ); Fri, 19 Jul 2019 03:09:53 -0400 Received: by mail-pg1-f193.google.com with SMTP id n9so7819728pgc.1 for ; Fri, 19 Jul 2019 00:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hw2kNiLoj+LvvfY1YdobU4HU5vXnmTyj3KhgfWP8Lyc=; b=F30SYFLzLUaEvZZyNkrfusWAtMzfDxAGnKIlXrIl6LOCJF2OhfQDsDLT9cmynvdevK JwjuT2TZXcF7zudqpIWMz5/gKm7J0X+6DBmaiQWIZz5dAtOiAitm4MlmT3q+az3sfLrq lAjPAWrRlY/T2WWHlDSv6/2omGMuIyOvfC8PwRKM85273cve4F8Tft6YALL0ynYxhIv/ CH7yoVCrZPA0JjDcZeBNWyPX/AMfNdFDhZOFC9bgc1KRlwop6/yxHjX62T9H5Pujnjvv MhXFDeDWxctuByVAbbgvmXY4NjfDmZKaXHs65AJ1zUhplntVEUSR7kzG+yIfgk/dQlY1 7tdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hw2kNiLoj+LvvfY1YdobU4HU5vXnmTyj3KhgfWP8Lyc=; b=Qn6MjT1oO82tXotPZwnITKbaz/SoRSVap8lCBwtm2V3VJu7EJGY4zxtj0C4FhJ3Gyd nkXF9+YNcIZT9sIRqah3V9UWgToS0+w13Go2nQAxMjPxkyfxucpLoKVyqNPzE34cN5rV ihvvtdCrJv+4xYG9cB+D8tOnYzhkP3MfGhzejtLl2rKmCvHq7e583slL57BI1IBzomwD L0hz5Yw0LzBmu2NTD9wUdO1gAe/bRKl/xwKczs3lA1lkwCzkMnAFugnyK8kFTdPkAOir 6vXZy9uP8vO+DATu/3kZNdw7w3H518xxI42tpnyVBYN6BHae7QfaN/cQNJPbqoBSszCY gBxQ== X-Gm-Message-State: APjAAAUp+ibZk9Iet2VlP/8ALro/UhH09r0WoJCQPQfuNbSR6ZY6FsAE 5KQ/IgsEX5WNA7IMy31Ejk0= X-Received: by 2002:a17:90a:208d:: with SMTP id f13mr54371662pjg.68.1563520192524; Fri, 19 Jul 2019 00:09:52 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id r18sm17470274pfg.77.2019.07.19.00.09.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 00:09:51 -0700 (PDT) From: Chuhong Yuan Cc: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] staging: rtl8712: Merge memcpy + be16_to_cpus to get_unaligned_be16 Date: Fri, 19 Jul 2019 15:09:22 +0800 Message-Id: <20190719070921.27749-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Merge the combo of memcpy and be16_to_cpus. Use get_unaligned_be16 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/staging/rtl8712/rtl871x_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 5298fe603437..9969e5265a40 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -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(ðer_type, ptr, 2); - be16_to_cpus(ðer_type); + ether_type = get_unaligned_be16(ptr); if ((psta != NULL) && (psta->ieee8021x_blocked)) { /* blocked -- 2.20.1