Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wfx: ensure that traces never modify arguments

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 <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-22-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jérôme Pouiller and committed by
Greg Kroah-Hartman
30cfffb7 eddd8585

+8 -6
+8 -6
drivers/staging/wfx/traces.h
··· 153 153 #define hif_mib_list hif_mib_list_enum { -1, NULL } 154 154 155 155 DECLARE_EVENT_CLASS(hif_data, 156 - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), 156 + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), 157 157 TP_ARGS(hif, tx_fill_level, is_recv), 158 158 TP_STRUCT__entry( 159 159 __field(int, tx_fill_level) ··· 203 203 ) 204 204 ); 205 205 DEFINE_EVENT(hif_data, hif_send, 206 - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), 206 + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), 207 207 TP_ARGS(hif, tx_fill_level, is_recv)); 208 208 #define _trace_hif_send(hif, tx_fill_level)\ 209 209 trace_hif_send(hif, tx_fill_level, false) 210 210 DEFINE_EVENT(hif_data, hif_recv, 211 - TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), 211 + TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), 212 212 TP_ARGS(hif, tx_fill_level, is_recv)); 213 213 #define _trace_hif_recv(hif, tx_fill_level)\ 214 214 trace_hif_recv(hif, tx_fill_level, true) ··· 359 359 trace_bh_stats(ind, req, cnf, busy, release) 360 360 361 361 TRACE_EVENT(tx_stats, 362 - TP_PROTO(struct hif_cnf_tx *tx_cnf, struct sk_buff *skb, int delay), 362 + TP_PROTO(const struct hif_cnf_tx *tx_cnf, const struct sk_buff *skb, 363 + int delay), 363 364 TP_ARGS(tx_cnf, skb, delay), 364 365 TP_STRUCT__entry( 365 366 __field(int, pkt_id) ··· 376 375 // Keep sync with wfx_rates definition in main.c 377 376 static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 378 377 10, 11, 12, 13 }; 379 - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 380 - struct ieee80211_tx_rate *rates = tx_info->driver_rates; 378 + const struct ieee80211_tx_info *tx_info = 379 + (const struct ieee80211_tx_info *)skb->cb; 380 + const struct ieee80211_tx_rate *rates = tx_info->driver_rates; 381 381 int i; 382 382 383 383 __entry->pkt_id = tx_cnf->packet_id;