From patchwork Mon Dec 16 17:03:44 2019 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: 11294697 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2729930 for ; Mon, 16 Dec 2019 17:04:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A663820717 for ; Mon, 16 Dec 2019 17:04:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="JKzi5YMK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbfLPREk (ORCPT ); Mon, 16 Dec 2019 12:04:40 -0500 Received: from mail-eopbgr700081.outbound.protection.outlook.com ([40.107.70.81]:14720 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727121AbfLPREA (ORCPT ); Mon, 16 Dec 2019 12:04:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aZRDCFr0mmT3lpZL8ONOR7ONGAjB/F3fOkbh6gbva1PyXh0hvuzK36YClex0tztT7ovkg+ChvVdZw29rUPkLPIt5/nyehdpRN8XhAQ+KKmSrZ3gcFkVe8yE4h2b3iCwg9fldi/8gozOcIrkq6TirzQXWg1WmjFbdgIuTXpWVBVAOOvKYBllvvW1+i2Gn2+b26nVHB6bi+nO1D/7ZbbZhQSTGUFepN3SHygF+0YGuI1cw2J8EUVt5vwdQOgjKSq7Dt5GVr1T3XdcDTPzfSToswMe4GXKIezxcN2Zh82Svr6kAcwx8BCJZusyIsyhUDoltJa19pvCPsKlKOlAbnaovkA== 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=M5s57VCF+uOi4jlkrrQQm+biyaNEI2GnE+tCssPOeVU=; b=HA0QAycrUawS7vcojssKBGxQ+YJ99PX9Fxo0NK/3iYEZDtn26DFhF9+m3z6FimfuTezcK2+vRFUwkJE9K1RYGFXlnsn7cgsyeXp1ojwO2lhh4q1USA/J00L3tOK/EjdtmpYLHX1Qz+L736L3nqM+Yn7zuYUFUIQT/uPMGlTEOZWQw5pm5rBmp42y6KefpSM4nfiUasaREW09i9UrS+5Abb5NHioMuxuWlHGA7nBerYysQTYto8BvIdts61wGGeocpY62jJDpBMFLnd/9zWruVDhRykDolWlPUpxceNqH/Cnlkm5fP4GoQ0nob4zqGtJ88Dbd3ODzyfQjk2pMPTUikQ== 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=M5s57VCF+uOi4jlkrrQQm+biyaNEI2GnE+tCssPOeVU=; b=JKzi5YMKJChOh8rPp4p7DJrJeqT/vRPb2cjyypwrIyMAS0nQRPKUJY5KTuacUUAxoRSPy6I192NifBtHgETuzdILqHY9JvI0FD5+/wpjs/GRzO1komTRbf/x6ywuDmTKnRIj9KbZOFQ9P7EFQoA3FGv3S9cNpSIlnDLn0RUR3Qc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4351.namprd11.prod.outlook.com (52.135.39.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.19; Mon, 16 Dec 2019 17:03:52 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Mon, 16 Dec 2019 17:03:52 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= 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 21/55] staging: wfx: ensure that traces never modify arguments Thread-Topic: [PATCH 21/55] staging: wfx: ensure that traces never modify arguments Thread-Index: AQHVtDLGXmTa6susIkOhtozAcdaGFQ== Date: Mon, 16 Dec 2019 17:03:44 +0000 Message-ID: <20191216170302.29543-22-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3831f18e-4cc6-498e-6dc3-08d78249ed48 x-ms-traffictypediagnostic: MN2PR11MB4351: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(376002)(346002)(396003)(39860400002)(199004)(189003)(66556008)(66446008)(64756008)(66476007)(76116006)(85202003)(91956017)(66946007)(54906003)(107886003)(4326008)(478600001)(110136005)(71200400001)(6512007)(81156014)(8676002)(81166006)(186003)(36756003)(2906002)(85182001)(6666004)(1076003)(316002)(6506007)(5660300002)(86362001)(26005)(2616005)(6486002)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4351;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; 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: ujHkyviufRPMN69d1+0ITOg3EPa+0HY6RtGpD1dIDc/PJjKJKc9fHMqQKV8MPr9WaqXWmzLi8AylWDo6PfhAyHGkfM9F40n5XH10WfRbqXIZnUFDAncjGOcDDGO+FGmDqFXL4OGFgA3p5PPOksNQsqXxT4G21UQX7xYqGMsNgAlKtKJks5WNcif0U5hXSXvwSZSRf2WYQDOohf3SzzScLVivVRXDx1N8u4qOIhA+B5vGy8xwpjziAiv2xNtkuShtPrsf92sY4BFGJV6SKlcbb26DG9xM8DHJV1BooYfJHdNWCn83DVRSXSRaznETFbVckNInr5dLV9+ZIr9yW2IxtUAfv0ryd4ARUwpUNHOK0UwfzsoJs5cHMaU49f7uZ9o3lOF3rJbtAhst9/IHLTgKStmJYj9XXXzPw5KFJFZafi8a/XQHln3cacAVOYDSQQrc Content-ID: <7D4922AB94FA09419E9BCBF1DBA6FC93@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3831f18e-4cc6-498e-6dc3-08d78249ed48 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:44.3149 (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: AN1/ne4Sqg+51dmFL8tHFOyoSXepKjYtHstS/Px/P+K2hRRkezDUQtYzem9Qk9F2HVj7lnNg6Xpp+rgYlLK1Xw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4351 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller There is no reason for a trace to change any bit of the argument. So, let's make sure that is the case by declaring the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/traces.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h index 3f6198ab2235..30c6a13f0e22 100644 --- a/drivers/staging/wfx/traces.h +++ b/drivers/staging/wfx/traces.h @@ -153,7 +153,7 @@ hif_mib_list_enum #define hif_mib_list hif_mib_list_enum { -1, NULL } DECLARE_EVENT_CLASS(hif_data, - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv), TP_STRUCT__entry( __field(int, tx_fill_level) @@ -203,12 +203,12 @@ DECLARE_EVENT_CLASS(hif_data, ) ); DEFINE_EVENT(hif_data, hif_send, - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv)); #define _trace_hif_send(hif, tx_fill_level)\ trace_hif_send(hif, tx_fill_level, false) DEFINE_EVENT(hif_data, hif_recv, - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv)); #define _trace_hif_recv(hif, tx_fill_level)\ trace_hif_recv(hif, tx_fill_level, true) @@ -359,7 +359,8 @@ TRACE_EVENT(bh_stats, trace_bh_stats(ind, req, cnf, busy, release) TRACE_EVENT(tx_stats, - TP_PROTO(struct hif_cnf_tx *tx_cnf, struct sk_buff *skb, int delay), + TP_PROTO(const struct hif_cnf_tx *tx_cnf, const struct sk_buff *skb, + int delay), TP_ARGS(tx_cnf, skb, delay), TP_STRUCT__entry( __field(int, pkt_id) @@ -375,8 +376,9 @@ TRACE_EVENT(tx_stats, // Keep sync with wfx_rates definition in main.c static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13 }; - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); - struct ieee80211_tx_rate *rates = tx_info->driver_rates; + const struct ieee80211_tx_info *tx_info = + (const struct ieee80211_tx_info *)skb->cb; + const struct ieee80211_tx_rate *rates = tx_info->driver_rates; int i; __entry->pkt_id = tx_cnf->packet_id;