staging: rtl8192e: Avoid multiple line dereference

Avoid multiple line dereference to make the code more readable, as
suggested by checkpatch.pl

This patch fixes the following checkpatch.pl warning:

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:189

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:195

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:204

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:209

- WARNING: Avoid multiple line dereference
    prefer 'info_element->data[info_element->len]'
  FILE: ./rtl8192e/rtllib_rx.c:2287

Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/435b60bd8874f8105b4af6e7eb9ee5bdbfe3112f.1620642396.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ojaswin Mujoo 2021-05-10 17:01:01 +05:30 committed by Greg Kroah-Hartman
parent 1cd3acd4e9
commit 1ba6d8dc50
2 changed files with 5 additions and 10 deletions

View file

@ -185,14 +185,12 @@ void rtl92e_cam_restore(struct net_device *dev)
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type,
(u8 *)dev->dev_addr, 0,
(u32 *)(&priv->rtllib->swcamtable[4].
key_buf[0]));
(u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
} else {
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type,
MacAddr, 0,
(u32 *)(&priv->rtllib->swcamtable[4].
key_buf[0]));
(u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
}
} else if (priv->rtllib->pairwise_key_type == KEY_TYPE_CCMP) {
@ -200,13 +198,11 @@ void rtl92e_cam_restore(struct net_device *dev)
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type,
(u8 *)dev->dev_addr, 0,
(u32 *)(&priv->rtllib->swcamtable[4].
key_buf[0]));
(u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
} else {
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type, MacAddr,
0, (u32 *)(&priv->rtllib->swcamtable[4].
key_buf[0]));
0, (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
}
}

View file

@ -2285,8 +2285,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
length -= sizeof(*info_element) + info_element->len;
info_element =
(struct rtllib_info_element *)&info_element->
data[info_element->len];
(struct rtllib_info_element *)&info_element->data[info_element->len];
}
if (!network->atheros_cap_exist && !network->broadcom_cap_exist &&