Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3369365ybi; Fri, 19 Jul 2019 02:08:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd0wN3sGvmEJJ8+WhWdYVpH55h5nCKEwnjFPyEDrm4AZIx3cnShq4iSzNrfm5DgRsACqdC X-Received: by 2002:a17:90a:2567:: with SMTP id j94mr56860084pje.121.1563527309639; Fri, 19 Jul 2019 02:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563527309; cv=none; d=google.com; s=arc-20160816; b=d0y2M/Ut9Qa03pVYRtjhzcKuKvRurMkaTC1IsennOdaolgbnzeFNRGKo3vFf1ZhyGv 5vM8/i3lXrmiOVIP4pasDvhbfCH8L9Zm0sfKRokSmHolrvzfNT2UqvWEy4NmBrL7U9zU rmURhmSyRr8dr5NKEPPDz2UsGrKmNXtB5iDWPaYRHbtZZWoRYATSqrDhz05IkWcQdHft f3L+FYh7Zdg98gZnPB50vQeJvKZ2QzOOrPtW6DRJEZWo/KDBmwzassBeJgG0FmXM9d4u aZt+sf5u5P1IC9r4dJxuRDaCu2SYg/pF0cRfNW7fje2gCePQ2ECXdfCPnYZ7kn3D6uTf J9rw== 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=XVW3vUyQIGlttxB7d4coQNzCIFhrIEtf8tciYiOHfMM=; b=j1CQ/JraBX+QbbgY+ob1/SXo+kUYyqUm4ZnNUGX1MOHZGpwD6bf4mMiztbvJQoWz4X UpthGxZ5hWAHqQ0uYaAy22ccQ6FaJADZdkQBXLc7MKthznEFNJTUHEMJN55VK1a2R1Yu YvALu9r3+OxFQJ1EY1cxxydefk03IWRX2PNUQa8f5+ty2ivNDLbBOrg1laytbqEgk4Qd hh/okXavjFfTh5wo5/CPiXbDS/K8rkFSQWsJ8SEWU8/DT2c8xcwAgnD66MY//V5uQyI6 DVuRzAMyrLbfWPJ+02x2O95at5HZEKa7XmIY04PLwS7eCifiVpREucNa8Uek6Skb3xSO aWkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kSJour3P; 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 o75si1781192pje.87.2019.07.19.02.08.12; Fri, 19 Jul 2019 02:08:29 -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=kSJour3P; 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 S1727247AbfGSJHi (ORCPT + 99 others); Fri, 19 Jul 2019 05:07:38 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41071 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfGSJHh (ORCPT ); Fri, 19 Jul 2019 05:07:37 -0400 Received: by mail-pf1-f194.google.com with SMTP id m30so13907827pff.8; Fri, 19 Jul 2019 02:07:37 -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=XVW3vUyQIGlttxB7d4coQNzCIFhrIEtf8tciYiOHfMM=; b=kSJour3PB25SjVK+zTOUmCSVJJMU+pBRgmBaNXOp4U2TLYeO899DuO4rmrR0V8c8Tx 8SRLDCDqcc/z3pdAT2ITifncdNMk1q131CqOUMdUFTE3oso5CqWpEv6sXOfK4HV/l8P0 SDASWajXB4cmXRFtwZbK7Ci0Hd84CRuP7dg/3Y5mRi8R0uzWmo68dOVpKytCmrzuaKwU +DSgmOykXwmdm4MIuNlrxsY9wHAwzhE4oynOg+DKa7zSGn6mAOmfBr1Doa1J4PKZgWnn I//Tsuj40cNKYCtqC6vk4YcGO9p+Rw9mBsgEu006hQNLRn3qIEER6q9pMUk4yS8/NvNO lXZA== 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=XVW3vUyQIGlttxB7d4coQNzCIFhrIEtf8tciYiOHfMM=; b=nJMesKNyTEuXHbddf2Qf3RGjcTKZtuMUBcvbumvrQnE02JtvJhYLNvDVn1gDLmNqJr qvsmf+9c/BZ4e/gsWjJNnaNfE66apvSyGVy2RThQxWHxGLqFVtlJTPKJrI9qdy513iex V/mmKaZXt/972yIxfJYAT0whMZ+HIfEhvNytzy2+rHwW9ED9PNZZQk5HFUVd15B9jBL+ YxuCiWrMfS+7g59RMf+GGpHAtTiqP4rvWVBz9F0QSumXWc4SE8io38dUtjWbCaQk5E6h EzxYW5P1KVXRWsdMdJ5UjI5bkZ17azDPziVh+/kmaOIo5oqVtMm7b/CXWjPiNG7v4x38 JfyA== X-Gm-Message-State: APjAAAWTad4L8qV0S/fYOTbI8fuznv0fcJZbQXID4R1Sbrcenct4cJ0R GEKRkk6WLA7lCCZr7JfTAWg= X-Received: by 2002:a63:db45:: with SMTP id x5mr40825943pgi.293.1563527256835; Fri, 19 Jul 2019 02:07:36 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id d2sm27223139pjs.21.2019.07.19.02.07.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 02:07:36 -0700 (PDT) From: Chuhong Yuan Cc: "David S . Miller" , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] ax88179_178a: Merge memcpy + le32_to_cpus to get_unaligned_le32 Date: Fri, 19 Jul 2019 17:07:15 +0800 Message-Id: <20190719090714.19037-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 use of memcpy and le32_to_cpus. Use get_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/net/usb/ax88179_178a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 0bc457ba8574..72d165114b67 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1366,8 +1366,7 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) return 0; skb_trim(skb, skb->len - 4); - memcpy(&rx_hdr, skb_tail_pointer(skb), 4); - le32_to_cpus(&rx_hdr); + rx_hdr = get_unaligned_le32(skb_tail_pointer(skb)); pkt_cnt = (u16)rx_hdr; hdr_off = (u16)(rx_hdr >> 16); -- 2.20.1