From patchwork Sun Dec 7 14:37:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 5452151 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 431089F2E8 for ; Sun, 7 Dec 2014 14:37:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ADD520154 for ; Sun, 7 Dec 2014 14:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A7972013D for ; Sun, 7 Dec 2014 14:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbaLGOhf (ORCPT ); Sun, 7 Dec 2014 09:37:35 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:64321 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbaLGOhe (ORCPT ); Sun, 7 Dec 2014 09:37:34 -0500 Received: by mail-lb0-f174.google.com with SMTP id 10so1048325lbg.19 for ; Sun, 07 Dec 2014 06:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=xBhtCut5tLYVvfFV1669Vm4wc4tLuls1NhHuqZaT7Dk=; b=b87eNeOdHb/xbHq2lf0yglshFppDgmGrJSdsBbruk0oYjpU5gn9AtQ4wWqcjSr5EoL lTaP50caCaS/MRqr17clodONT+r6N1DZbkJHYmXwGnLIthOKluWDeIsqcQWbsKH0vaJg 0qnPc/ZIu51F/Zr5FWYYTz37PGaHVvb4ddAf4DzoApAlv9G6501qnvbHUN/JmBNC9pwh 6tiLbAVtFnSclAjxBo0oVXmn7txVYSR8Pjc2P5Uqe2WpelDxNdl4K7A0FojSyUT5+jjs cJfC0eAVEmV2Vsq1GGwVm9Daj7B/8FCh5CvXz3X61hyYdkHqCOoHrTZ5QF3q1ntJNsKw 3+qg== X-Received: by 10.152.205.11 with SMTP id lc11mr12006038lac.34.1417963052607; Sun, 07 Dec 2014 06:37:32 -0800 (PST) Received: from localhost.localdomain (0189600560.0.fullrate.dk. [2.110.97.143]) by mx.google.com with ESMTPSA id b4sm10006823lbp.17.2014.12.07.06.37.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Dec 2014 06:37:31 -0800 (PST) From: Emil Renner Berthing To: Larry Finger , Jes Sorensen Cc: Emil Renner Berthing , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy Date: Sun, 7 Dec 2014 15:37:20 +0100 Message-Id: <1417963040-9014-1-git-send-email-kernel@esmil.dk> X-Mailer: git-send-email 2.1.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This also fixes a sparse warning. Signed-off-by: Emil Renner Berthing --- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index 7b56411..d8c4c8b 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -124,14 +124,15 @@ int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param) int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg) { - u8 buf[5]; + struct { + __le32 mask; + u8 arg; + } __packed buf; - memset(buf, 0, 5); - mask = cpu_to_le32(mask); - memcpy(buf, &mask, 4); - buf[4] = arg; + buf.mask = cpu_to_le32(mask); + buf.arg = arg; - FillH2CCmd(padapter, MACID_CONFIG_EID, 5, buf); + FillH2CCmd(padapter, MACID_CONFIG_EID, 5, (u8 *)&buf); return _SUCCESS; }