@@ -229,8 +229,6 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index,
desc->host_addr = cpu_to_le32(0);
} else {
skb_trim(skb, 0);
- pci_dma_sync_single_for_device(priv->pdev, dma_addr,
- priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE);
desc->len = cpu_to_le16(priv->common.rx_mtu + 32);
}
@@ -325,7 +325,7 @@ static void p54_pspoll_workaround(struct p54_common *priv, struct sk_buff *skb)
static int p54_rx_data(struct p54_common *priv, struct sk_buff *skb)
{
- struct p54_rx_data *hdr = (struct p54_rx_data *) skb->data;
+ const struct p54_rx_data *hdr = (void *)skb->data;
struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
u16 freq = le16_to_cpu(hdr->freq);
size_t header_len = sizeof(*hdr);
@@ -387,8 +387,8 @@ static int p54_rx_data(struct p54_common *priv, struct sk_buff *skb)
static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb)
{
- struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
- struct p54_frame_sent *payload = (struct p54_frame_sent *) hdr->data;
+ const struct p54_hdr *hdr = (void *)skb->data;
+ const struct p54_frame_sent *payload = (void *)hdr->data;
struct ieee80211_tx_info *info;
struct p54_hdr *entry_hdr;
struct p54_tx_data *entry_data;
@@ -481,8 +481,8 @@ static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb)
static void p54_rx_eeprom_readback(struct p54_common *priv,
struct sk_buff *skb)
{
- struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
- struct p54_eeprom_lm86 *eeprom = (struct p54_eeprom_lm86 *) hdr->data;
+ const struct p54_hdr *hdr = (void *)skb->data;
+ const struct p54_eeprom_lm86 *eeprom = (void *)hdr->data;
struct sk_buff *tmp;
if (!priv->eeprom)
@@ -504,8 +504,8 @@ static void p54_rx_eeprom_readback(struct p54_common *priv,
static void p54_rx_stats(struct p54_common *priv, struct sk_buff *skb)
{
- struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
- struct p54_statistics *stats = (struct p54_statistics *) hdr->data;
+ const struct p54_hdr *hdr = (void *)skb->data;
+ const struct p54_statistics *stats = (void *)hdr->data;
struct sk_buff *tmp;
u32 tsf32;
@@ -529,8 +529,8 @@ static void p54_rx_stats(struct p54_common *priv, struct sk_buff *skb)
static void p54_rx_trap(struct p54_common *priv, struct sk_buff *skb)
{
- struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
- struct p54_trap *trap = (struct p54_trap *) hdr->data;
+ const struct p54_hdr *hdr = (void *)skb->data;
+ const struct p54_trap *trap = (void *)hdr->data;
u16 event = le16_to_cpu(trap->event);
u16 freq = le16_to_cpu(trap->frequency);
@@ -565,7 +565,7 @@ static void p54_rx_trap(struct p54_common *priv, struct sk_buff *skb)
static int p54_rx_control(struct p54_common *priv, struct sk_buff *skb)
{
- struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
+ const struct p54_hdr *hdr = (void *)skb->data;
switch (le16_to_cpu(hdr->type)) {
case P54_CONTROL_TYPE_TXDONE:
@@ -595,7 +595,7 @@ static int p54_rx_control(struct p54_common *priv, struct sk_buff *skb)
int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct p54_common *priv = dev->priv;
- u16 type = le16_to_cpu(*((__le16 *)skb->data));
+ u16 type = le16_to_cpu(*(const __le16 *)skb->data);
if (type & P54_HDR_FLAG_CONTROL)
return p54_rx_control(priv, skb);
Also constify pointers used in frame parsers to verify assumptions. Signed-off-by: Micha? Miros?aw <mirq-linux@rere.qmqm.pl> --- drivers/net/wireless/p54/p54pci.c | 2 -- drivers/net/wireless/p54/txrx.c | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-)