OSDN Git Service

ieee80211: radiotap: fix -Wcast-qual warnings
authorJohannes Berg <johannes.berg@intel.com>
Wed, 2 Feb 2022 08:49:40 +0000 (10:49 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 4 Feb 2022 15:25:21 +0000 (16:25 +0100)
When enabling -Wcast-qual e.g. via W=3, we get a lot of
warnings from this file, whenever it's included. Since
the fixes are simple, just do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220202104617.cc733aeb1a18.I03396e1bf7a1af364cbd0916037f65d800035039@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/ieee80211_radiotap.h

index 1163035..598f53d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017          Intel Deutschland GmbH
- * Copyright (c) 2018-2019     Intel Corporation
+ * Copyright (c) 2018-2019, 2021 Intel Corporation
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -365,7 +365,7 @@ enum ieee80211_radiotap_zero_len_psdu_type {
  */
 static inline u16 ieee80211_get_radiotap_len(const char *data)
 {
-       struct ieee80211_radiotap_header *hdr = (void *)data;
+       const struct ieee80211_radiotap_header *hdr = (const void *)data;
 
        return get_unaligned_le16(&hdr->it_len);
 }