From patchwork Mon Sep 7 10:15:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 259377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C429CC433E2 for ; Mon, 7 Sep 2020 10:21:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 897D821531 for ; Mon, 7 Sep 2020 10:21:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ak96eV1d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728732AbgIGKUJ (ORCPT ); Mon, 7 Sep 2020 06:20:09 -0400 Received: from mail-mw2nam10on2078.outbound.protection.outlook.com ([40.107.94.78]:7488 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728550AbgIGKRT (ORCPT ); Mon, 7 Sep 2020 06:17:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NXYBech5Xs6XFc62nwXjYRD5beZ2XWVn13OFhFcQ1RWCHyP5aIcOWfl3do3qZozWsphcxejeEEN+DYulP42CyF+KOjBsbnoMf6ZNaPZ6oT/+S5dsmASRJLcrd1wTKbf0KwDOS+OgCY5ybgyrDsD8fI2aBDLR/sl2vqptzibB/o/LUcVBN90rsBtAw6Bi+xh6tnX+d+G3Dd6rxMpY/b5aYYMNKlPTM7lSoS4xxoxUpVe0X5GrgO9Hqap8uXi/TgvBwLzmJvTphYfhud0FVLsvirZrcXGTfR59FSSu/hoNQMSqUy8CBbGu0kgeVfrUcW79/cTUE1trg7WTSj3N/LEMkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TzLeOEwzJocxUt4EbhtFEkvS1ODweV/cY4EpplLa4pI=; b=WLQEqyklU8VSPRuMogB6Ne5CnVLbKQwJMAFtjPP9DYpPOfpHLaRmJH9EmwJPCtYebdUfGnRPdhrkBbA/rXQCsKGB1nZUc80Sv/1Fc3jGJ8dCXV87p6cxLkCQQN/GowubdkXDgxarp0q/w0c92xno3XJsC8HsWhxI5/Z8RZabOMvYmGF6CnMDze1ofHyOBuNZU4eRn0tsQW2UqmRWMufOuAJUCBJQfAcyJcZFPpm3cqp8RKWSn0c9j71VM1bGHYsWyMzoGxBIUDO8GDL6hy16sAVG0Ex2laGpCsAk0SjRYs9q5WA8QPlAHuKvLc0syd1+aiHMGaaWTxgXFY304FEw5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TzLeOEwzJocxUt4EbhtFEkvS1ODweV/cY4EpplLa4pI=; b=ak96eV1ddwqp+hptPTavtcrDvF7a4uZDvCHTfQYI+BWgwUjEV/HHL4rOut9Yh43NtMSyxzd7PP66X/8g9HBkWMa3LDE6zkC0TikE9xZ60d/tlVzusbePveH3LcKG1CYZMPWT4HsMA9Bbd2UO6y4uY0Cvt/3ovRBmUO1ipTM2QsI= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2720.namprd11.prod.outlook.com (2603:10b6:805:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Mon, 7 Sep 2020 10:16:24 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::85c9:1aa9:aeab:3fa6%4]) with mapi id 15.20.3348.019; Mon, 7 Sep 2020 10:16:24 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 24/31] staging: wfx: drop useless union hif_indication_data Date: Mon, 7 Sep 2020 12:15:14 +0200 Message-Id: <20200907101521.66082-25-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200907101521.66082-1-Jerome.Pouiller@silabs.com> References: <20200907101521.66082-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0109.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::25) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (37.71.187.125) by PR0P264CA0109.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16 via Frontend Transport; Mon, 7 Sep 2020 10:16:22 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [37.71.187.125] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b451f160-d4fb-4625-c320-08d8531712ec X-MS-TrafficTypeDiagnostic: SN6PR11MB2720: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nqOEpwU2bj+txpVj5+vjTE+UgyjoZFEdj2irJJiPEsr4bHIPKGDp4Mm8SDEnl6HTsdCqVjGLPRPOaaHx2fWdjLytRvXrnxZ21/EkLcwWCCxFkgqE6Ft4hzdmPlDXEV3IwF07EOJLkNe8RNL/biwQgWxAuWJbs5SlG4uhObnyarqCAKd1oqyieEJ6sdKc1hFmIGrjDqpyBKozBX4D49d7KkQDh1qZf32msZk+fXbPf4JcnvtfIlTTy+XJ2LB1t/vhVdjXh7+qe2v1PQGR/Ys8QISXB6jgzYgtcMZ84yiad/BeAkZRzGVDK4bF/aKsLy+I X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(366004)(39850400004)(136003)(346002)(396003)(66946007)(66556008)(66476007)(54906003)(26005)(186003)(16526019)(66574015)(83380400001)(107886003)(6486002)(8676002)(956004)(2616005)(2906002)(316002)(86362001)(8936002)(478600001)(4326008)(7696005)(36756003)(52116002)(6666004)(1076003)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Y+ba5gDUJfkR/RKa2pywr8TxMJsHP5sOkIhnrzFvxOuYAs1oBquyYNQWNM7qXa6cPf3nYKISqvbIFQZctD6nK83x98EUhb5Vp0RCXjad2wGg+JDJSv+xtxOJ1IzauOgU8g1Gs+zY1zuvqlRKuyc//Lxahg/kn+yCunuKEKpsMuLQKVo+tOrZVyvWPwRijYo4xgCda10UwWxiiOGVyv0akrqVC7xsGhG5CRo4MXvBbzfubpfg1WWKetRXj/IEHXoQtpELt2sPsvgi1zp93Ii6+cFyLnLBUu8uOT18x7I3VKj0RVzgTcgM2e5fkrHdr29EWJGqNjg3y8w2qCmtOAYk11wpUXfX/GvCRggUK8iumWDCRw575XEb2n3VhSIILO5kvHS5in/A7il0RyjfhJZ2mKZZvGwxaBr1kuISWrKVbF02fbhPeQrn4HSmApYXFZq/R8ya924bx2aEAVXiYxyQHHdl2q3zQ4SRGAPeosExiXBYmxsCZx8hnqjH5lfNkgXogiDVbwTn9IpJv3Ra98aiLDu8oR7sVt2f6HvFX8Cicn7MUGMBD0sysDi3mHMAP0pDqZewqephVAutg2nb9H2xn79P/2FM6AgpDA2arpsvvEIF4N6ffipcMCWEQzeMoZ617Fj/vpjlxtYWDUYUCCJ2FQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b451f160-d4fb-4625-c320-08d8531712ec X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2020 10:16:24.1633 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vv0J4JwdTSx7d9mC6cbF49XXrcLx6NyP3y0rCJpCZrZacwx5GlOTkQ7prF43wyeOd3toiD67XTu4SJMjKnYoOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2720 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The union hif_indication_data is never used in the driver. So, it is not necessary to declare it separately from hif_ind_generic. In add, drop prefix 'indication_' from the names 'indication_type' and 'indication_data' since it is redundant with the name of the struct. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 13 +++++-------- drivers/staging/wfx/hif_rx.c | 11 +++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index 4058016ec664..da63ba6f5148 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -221,15 +221,12 @@ struct hif_tx_power_loop_info { u8 reserved; } __packed; -union hif_indication_data { - struct hif_rx_stats rx_stats; - struct hif_tx_power_loop_info tx_power_loop_info; - u8 raw_data[1]; -}; - struct hif_ind_generic { - __le32 indication_type; - union hif_indication_data indication_data; + __le32 type; + union { + struct hif_rx_stats rx_stats; + struct hif_tx_power_loop_info tx_power_loop_info; + } data; } __packed; enum hif_error { diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 798167aa4c7f..6950b3e9d7cf 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -225,29 +225,28 @@ static int hif_generic_indication(struct wfx_dev *wdev, const struct hif_msg *hif, const void *buf) { const struct hif_ind_generic *body = buf; - int type = le32_to_cpu(body->indication_type); + int type = le32_to_cpu(body->type); switch (type) { case HIF_GENERIC_INDICATION_TYPE_RAW: return 0; case HIF_GENERIC_INDICATION_TYPE_STRING: - dev_info(wdev->dev, "firmware says: %s\n", - (char *)body->indication_data.raw_data); + dev_info(wdev->dev, "firmware says: %s\n", (char *)&body->data); return 0; case HIF_GENERIC_INDICATION_TYPE_RX_STATS: mutex_lock(&wdev->rx_stats_lock); // Older firmware send a generic indication beside RxStats if (!wfx_api_older_than(wdev, 1, 4)) dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", - body->indication_data.rx_stats.current_temp); - memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, + body->data.rx_stats.current_temp); + memcpy(&wdev->rx_stats, &body->data.rx_stats, sizeof(wdev->rx_stats)); mutex_unlock(&wdev->rx_stats_lock); return 0; case HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO: mutex_lock(&wdev->tx_power_loop_info_lock); memcpy(&wdev->tx_power_loop_info, - &body->indication_data.tx_power_loop_info, + &body->data.tx_power_loop_info, sizeof(wdev->tx_power_loop_info)); mutex_unlock(&wdev->tx_power_loop_info_lock); return 0;