From patchwork Mon Apr 6 11:17:50 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: 216097 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=-9.8 required=3.0 tests=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 D4649C2BA19 for ; Mon, 6 Apr 2020 11:18:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93312206F5 for ; Mon, 6 Apr 2020 11:18:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="L56ZpJvV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727755AbgDFLSi (ORCPT ); Mon, 6 Apr 2020 07:18:38 -0400 Received: from mail-dm6nam11on2071.outbound.protection.outlook.com ([40.107.223.71]:6126 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727125AbgDFLSh (ORCPT ); Mon, 6 Apr 2020 07:18:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pnc5S1Jo2POCp1in+u8SKrm23SQeGRYtnkssCxLKy8LQYYf1LNrgonPYld9rSZ0JroWij1XmnKG1l3oCDF2uRIyNgIe3MrHGKu0am4Z/sHlMDyeLLRny7DtDI8nNViDfA7vMGQwdn2bZGysPDZ5TmA4Z+SSdlxtbK4ljodLEjtUI1CdtxyONXWIu61ew2XUc2a5EwInW2zleQpuEzgn4XzYOXapI2fBrZaKiR6hCXdYLdDufiNqQLun8Lsjr7i7QXkUPA7ASrTVOLkgbUKTUzd1SlGZQzPY0vqM0A2cK2Eqn2Wq7trzXsEmtoX/qgdgGHWiF66tkMY+NNVkFiFZakA== 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=wwVu1Wh7pYdvfMR5lOj1KWGe1RpoiyE2cttUnHmWdtY=; b=cmzpG7L4U7plaSHPEd+uGJDVCCm7tj81tlM7ojraCCqNAyMqbb5GdxbNqlRyEsMZPyFXo97YbxHY6l6IrEV5nEXaGLuTz8G9XEWzoEUSYPBzXO2bZeaFH8V1+NBmDWnFVeGl9umliPQO6t6rJxD92FuPxvWSwcCljtWVngOLVBgb1+uiewCe+z7qltzttOZQ7bPzIFWbJcZlxRzr7wf+N0A5tibL6iZ73UwYqWd8lGuUM41x4Eq1aJdZuFvvCKEQ4wYyv3UNR0DtfwowUvUdtxpO8U2qW/uK6lnS1G0Qn32vLA1vTZ/Oj3zjjedb+0le5wGbUuYEd0Q2UUk3nc/YtQ== 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=wwVu1Wh7pYdvfMR5lOj1KWGe1RpoiyE2cttUnHmWdtY=; b=L56ZpJvVm26cuq/yqMtmFxS0M4RrsnnK1boKOWDtgaXBJm3uJM9XrRKs51ySrWllEAhwdcEwSkqoPbGl3wflQjaD9B9n3eE70idosNvI2qNvG1C0eLDoT3QAXQ+nU+BE+0pzqMZDcpmjjosVtEH+W9dEBEV0+/bLpLrV/565G8I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) by BN6PR11MB3860.namprd11.prod.outlook.com (2603:10b6:405:77::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Mon, 6 Apr 2020 11:18:24 +0000 Received: from BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::e0af:e9de:ffce:7376]) by BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::e0af:e9de:ffce:7376%3]) with mapi id 15.20.2878.018; Mon, 6 Apr 2020 11:18: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 05/11] staging: wfx: remove useless defines Date: Mon, 6 Apr 2020 13:17:50 +0200 Message-Id: <20200406111756.154086-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200406111756.154086-1-Jerome.Pouiller@silabs.com> References: <20200406111756.154086-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR05CA0010.namprd05.prod.outlook.com (2603:10b6:3:d4::20) To BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by DM5PR05CA0010.namprd05.prod.outlook.com (2603:10b6:3:d4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.13 via Frontend Transport; Mon, 6 Apr 2020 11:18:22 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50b461f2-1ecd-44e1-7da1-08d7da1c38c6 X-MS-TrafficTypeDiagnostic: BN6PR11MB3860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-Forefront-PRVS: 0365C0E14B X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB4052.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(396003)(39850400004)(346002)(366004)(136003)(376002)(186003)(16526019)(7696005)(52116002)(36756003)(5660300002)(107886003)(316002)(54906003)(66946007)(66476007)(4326008)(2616005)(66556008)(1076003)(66574012)(81166006)(6666004)(6486002)(8936002)(2906002)(86362001)(81156014)(8676002)(478600001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mbk9XW+f2V13R2u0v3H3cM4SQ967I0NZc5BjgN29NflH9JO13GuXKt9WHhXf2Dxo43TwHfOJiPBb/yaNi5/XcvvBz8qCXqvq0ygzmeoChPh0P2RF0m68hnH2d6Ip1tAC1qRoIk+OJuG9pHBfNgAnhr8zFvrrgsR14Gw421oVUpVuCbCn3MC4TExAHFJb91ouZ1tI27CCyVRAKsxcGfoxsPt6oWtewLM0bdXh57PBrzfje1iS9T7YbBc9B1Kow0ZZ2YVtDiQte/DJoZPwyg9NYUDVOx07kz+JE4odJCVGxlXfS7SvEsT7tMg/tYxXp0faouoKIW/3ez+FUNiPmzOzFJGLYpIuVmBii2hbYGusCJsHJEhZIeg7uxSDkN12SGT2e8jHoQFyGcywGO6LbEekOioQXJFetKTUU26DjHwxGwjrW6az04AH9q9Wiy/wl6FC X-MS-Exchange-AntiSpam-MessageData: 42SsPDAQ/tbL1OtX+Mny6CyIEbQx4N0DphVCzyJLyTD4TEzRpdpKLlx/55evjUCl90rP1Ocqju97d9M1z1bxNVyeJGud8+4sOWtDUcM4KJflDHyoAJUmITrdx2UWvKHiDRnanWjXx2+s7YDQ8NEiiIHyA6f1YywsVN7dBPLljucOLZ1UpeAK9qPDC27V+yEJdSXr6CKxLW7bj1P7tr40Dg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50b461f2-1ecd-44e1-7da1-08d7da1c38c6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2020 11:18:24.5714 (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: 0ReLh77UxvnMvgZ+BA8OENdtllhKXdahaJBl2ylfIzTnlSn7nECBCvJ7x2qjrfEDwdRPjkTg4znx03gY6ofIBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3860 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Several values defined in hif API are only here to define length of some arrays. In most cases, they do not provide any extra information about the size of the array (ie. "API_FIRMWARE_LABEL_SIZE" is only used to define the size of member "firmware_label"). Remove these useless definitions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 27 +++++++++------------------ drivers/staging/wfx/hif_api_mib.h | 11 +++-------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index 73016135f538..c58b9a1eff3d 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -135,16 +135,11 @@ struct hif_otp_phy_info { u8 otp_phy_ver:2; } __packed; -#define API_OPN_SIZE 14 -#define API_UID_SIZE 8 -#define API_DISABLED_CHANNEL_LIST_SIZE 2 -#define API_FIRMWARE_LABEL_SIZE 128 - struct hif_ind_startup { u32 status; u16 hardware_id; - u8 opn[API_OPN_SIZE]; - u8 uid[API_UID_SIZE]; + u8 opn[14]; + u8 uid[8]; u16 num_inp_ch_bufs; u16 size_inp_ch_buf; u8 num_links_ap; @@ -157,11 +152,11 @@ struct hif_ind_startup { u8 firmware_minor; u8 firmware_major; u8 firmware_type; - u8 disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; + u8 disabled_channel_list[2]; struct hif_otp_regul_sel_mode_info regul_sel_mode_info; struct hif_otp_phy_info otp_phy_info; u32 supported_rate_mask; - u8 firmware_label[API_FIRMWARE_LABEL_SIZE]; + u8 firmware_label[128]; } __packed; struct hif_ind_wakeup { @@ -229,10 +224,8 @@ struct hif_ind_generic { } __packed; -#define HIF_EXCEPTION_DATA_SIZE 124 - struct hif_ind_exception { - u8 data[HIF_EXCEPTION_DATA_SIZE]; + u8 data[124]; } __packed; @@ -302,14 +295,14 @@ struct hif_cnf_set_sl_mac_key { u32 status; } __packed; -#define API_HOST_PUB_KEY_SIZE 32 -#define API_HOST_PUB_KEY_MAC_SIZE 64 - enum hif_sl_session_key_alg { HIF_SL_CURVE25519 = 0x01, HIF_SL_KDF = 0x02 }; +#define API_HOST_PUB_KEY_SIZE 32 +#define API_HOST_PUB_KEY_MAC_SIZE 64 + struct hif_req_sl_exchange_pub_keys { u8 algorithm:2; u8 reserved1:6; @@ -331,10 +324,8 @@ struct hif_ind_sl_exchange_pub_keys { u8 ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; } __packed; -#define API_ENCR_BMP_SIZE 32 - struct hif_req_sl_configure { - u8 encr_bmp[API_ENCR_BMP_SIZE]; + u8 encr_bmp[32]; u8 disable_session_key_protection:1; u8 reserved1:7; u8 reserved2[3]; diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index 732f82d10a19..e6d05789720c 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -149,9 +149,6 @@ struct hif_mib_rx_filter { u8 reserved4[3]; } __packed; -#define HIF_API_OUI_SIZE 3 -#define HIF_API_MATCH_DATA_SIZE 3 - struct hif_ie_table_entry { u8 ie_id; u8 has_changed:1; @@ -159,8 +156,8 @@ struct hif_ie_table_entry { u8 has_appeared:1; u8 reserved:1; u8 num_match_data:4; - u8 oui[HIF_API_OUI_SIZE]; - u8 match_data[HIF_API_MATCH_DATA_SIZE]; + u8 oui[3]; + u8 match_data[3]; } __packed; struct hif_mib_bcn_filter_table { @@ -273,14 +270,12 @@ enum hif_tmplt { HIF_TMPLT_NA = 0x7 }; -#define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700 - struct hif_mib_template_frame { u8 frame_type; u8 init_rate:7; u8 mode:1; u16 frame_length; - u8 frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE]; + u8 frame[700]; } __packed; struct hif_mib_beacon_wake_up_period {