mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 00:29:36 -04:00
staging: rtl8192e: Remove rtllib_get_payload()
rtllib_process_action() is only called in one place with management frames. Frame is passed over to rtllib_get_payload() which passes it to rtllib_get_hdrlen(). In rtllib_get_hdrlen() all management frames return with hdrlen = RTLLIB_3ADDR_LEN. Therefore the switch in rtllib_get_payload() is useless and dead code. The condition act == NULL cannot occur and can also be removed. Then rtllib_hdr_2addr is not used anymore and can be removed as well. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/3ef288fb819f50da3eb9291522067babaa57f532.1694546301.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6c8bc47b67
commit
58806573a7
@@ -692,14 +692,6 @@ struct rtllib_hdr_1addr {
|
||||
u8 payload[];
|
||||
} __packed;
|
||||
|
||||
struct rtllib_hdr_2addr {
|
||||
__le16 frame_ctl;
|
||||
__le16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 payload[];
|
||||
} __packed;
|
||||
|
||||
struct rtllib_hdr_3addr {
|
||||
__le16 frame_ctl;
|
||||
__le16 duration_id;
|
||||
@@ -1781,21 +1773,6 @@ static inline int rtllib_get_hdrlen(u16 fc)
|
||||
return hdrlen;
|
||||
}
|
||||
|
||||
static inline u8 *rtllib_get_payload(struct rtllib_hdr *hdr)
|
||||
{
|
||||
switch (rtllib_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
|
||||
case RTLLIB_1ADDR_LEN:
|
||||
return ((struct rtllib_hdr_1addr *)hdr)->payload;
|
||||
case RTLLIB_2ADDR_LEN:
|
||||
return ((struct rtllib_hdr_2addr *)hdr)->payload;
|
||||
case RTLLIB_3ADDR_LEN:
|
||||
return ((struct rtllib_hdr_3addr *)hdr)->payload;
|
||||
case RTLLIB_4ADDR_LEN:
|
||||
return ((struct rtllib_hdr_4addr *)hdr)->payload;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int rtllib_is_ofdm_rate(u8 rate)
|
||||
{
|
||||
switch (rate & ~RTLLIB_BASIC_RATE_MASK) {
|
||||
|
||||
@@ -1921,16 +1921,9 @@ EXPORT_SYMBOL(rtllib_ps_tx_ack);
|
||||
static void rtllib_process_action(struct rtllib_device *ieee,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct rtllib_hdr_3addr *header = (struct rtllib_hdr_3addr *)skb->data;
|
||||
u8 *act = rtllib_get_payload((struct rtllib_hdr *)header);
|
||||
u8 *act = skb->data + RTLLIB_3ADDR_LEN;
|
||||
u8 category = 0;
|
||||
|
||||
if (act == NULL) {
|
||||
netdev_warn(ieee->dev,
|
||||
"Error getting payload of action frame\n");
|
||||
return;
|
||||
}
|
||||
|
||||
category = *act;
|
||||
act++;
|
||||
switch (category) {
|
||||
|
||||
Reference in New Issue
Block a user