Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3317861ybi; Fri, 19 Jul 2019 01:11:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/ZOT3N5X8qXmFL9PD9BJYIyU8YPmRH1YZPukGfxCS/EflfP0phKvzHg9IevF8XmSnmgL2 X-Received: by 2002:a63:460c:: with SMTP id t12mr52407665pga.69.1563523901102; Fri, 19 Jul 2019 01:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563523901; cv=none; d=google.com; s=arc-20160816; b=Zqf9ahwgEZAxDBIj2FnAK3XIajdpOLhwvJIrMpZjPZdOjJkoTRy46X8GuEMUQG86YL T31QKRMRyONCKwZj6JAEAM0FKQzHw7XNpn8eE8yVk6T3WyMY2Mj0ze1X3iKl0VE8rDqD aBd418+Ke6IMTh3FBUCDm2tVPiNGY8O1Hgd4klRaXgvNnNrEjel4Z7/5LLce0p4M7vax 62ig2n1gvGWviCrGfAAs/1lnx3kEPcHpO+MZjVGWBSE6eUcWx4/XzltwJYG1wdDruX6D 9mT2PllT5k5YFxnOmIIsHWcUaX84KQZ+3RF6sO04AU1NHa4nKrnUQhiL5XqiD3C0Xc0N qOrA== 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=ldCcok439XiSVa6AGYJGqO7cyqiS7oTbReHSOBCfvnE=; b=GXz/n0YzoY7yu01PbS9sbCojeZpyirIbPxX+5lbd6JwmyJ9g0KQEiYPOCvzgPTjV4e XmxfUBo/rH4Tya/gPK25jo90UTbnQxNkeLvRS1J3b/7LjBSDbfAVmNmgnE3Sw29/FwPl Z8DN3E8Z8emOHoZoA2k0Y2ONtYrTVwLE54UaSuoh80POHmE6NNmicJJwy0UnSXt65L5u gXvI8DxIUV4CsnaJ2TzIZMCXLH6FstknitSGaSHa1ODFPBw9cHH2zXmAN9JE40SHf5i2 k8WqtnHdJRq5DPWi9dcTRmyR7YII2t9kTS0BKDmCwJ5Be/ZzIIKw91fVPEYpp6Ti/YHM tvIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pKmSqnll; 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 m5si363700pls.358.2019.07.19.01.11.25; Fri, 19 Jul 2019 01:11:41 -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=pKmSqnll; 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 S1726396AbfGSIKZ (ORCPT + 99 others); Fri, 19 Jul 2019 04:10:25 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34827 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfGSIKY (ORCPT ); Fri, 19 Jul 2019 04:10:24 -0400 Received: by mail-pl1-f194.google.com with SMTP id w24so15247854plp.2; Fri, 19 Jul 2019 01:10:24 -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=ldCcok439XiSVa6AGYJGqO7cyqiS7oTbReHSOBCfvnE=; b=pKmSqnllu7Ylmp71SktjrAuLTPt/Aj9dQ3RdkOi6HrILRYK5FQEWnUxEwsal7uiuUt sdeihZFIaKfmiQowAovtE4yy2/iZD1YIHo653AcbDHg+tMPdGzmV9F/EtKKcOkWWVQvp ukuAov9z65TUw09OjxmfLyvKohabXmOwHHFlodDD1E7TZg/GmSVV54jEpYkI2gQpznWo 9pkAtGAOVQbE8hxBQIXDgCetd2BYeNyMVKcXjd5xQ5U66hIh46Kb4fUWF3hi5MaPzEz4 YbxtvbfRN7eoitHB7VCbl5lgLw5Lqy2n9dRxq970Mt5Mx6zlrUjhmtpCsUDaWztIIbX6 8/wA== 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=ldCcok439XiSVa6AGYJGqO7cyqiS7oTbReHSOBCfvnE=; b=tYrv6lP7cElXKttdeQl+1nEwtOmMwEu+hA4Nv7dwUSoRaJ0TkHLXvJ0/Q6O2l6wDAx 29LcVP7TB9UNEnscA4W5LLo9nKMppDioIpEPfD/MR3ezlUY9huVUTxNGKn/tW+3KZoz1 U2WR2fepccmPqzO0n5lnm2PzUcDyoTiS5wpso9VAIoMKwQTDYuUvWAcgfsdVgy5PxZNy lUCtKs9iejRL2X6wDdaIxAWvLPea9ZAEQRoQ1xOI+Lz+MHRG/3lG0VnhLTr+FfPK6HmG V8oU2YzNhlVR6KqiTnOuOvOEZtGq6fE2YQID9sEoe3xO+KkQ0OM2+u2u0IcKDviv765s rNpw== X-Gm-Message-State: APjAAAVXyVFOSqOfEXG27kaqkMfjFZkmFGbbIqqDEqtbDkb8RVk6ujVN Uznk2psJVvr9VGLgjBxkS84= X-Received: by 2002:a17:902:20ec:: with SMTP id v41mr52314648plg.142.1563523823694; Fri, 19 Jul 2019 01:10:23 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id 33sm35849261pgy.22.2019.07.19.01.10.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 01:10:23 -0700 (PDT) From: Chuhong Yuan Cc: Adham Abozaeid , Ajay Singh , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32 Date: Fri, 19 Jul 2019 16:10:06 +0800 Message-Id: <20190719081005.4598-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/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index d72fdd333050..12fb4add05ec 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1038,8 +1038,7 @@ void wilc_wfi_p2p_rx(struct wilc_vif *vif, u8 *buff, u32 size) s32 freq; __le16 fc; - memcpy(&header, (buff - HOST_HDR_OFFSET), HOST_HDR_OFFSET); - le32_to_cpus(&header); + header = get_unaligned_le32(buff - HOST_HDR_OFFSET); pkt_offset = GET_PKT_OFFSET(header); if (pkt_offset & IS_MANAGMEMENT_CALLBACK) { -- 2.20.1