Commit 6cfed598 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

staging: rtl*: Remove tasklet callback casts



In order to make the entire kernel usable under Clang's Control Flow
Integrity protections, function prototype casts need to be avoided
because this will trip CFI checks at runtime (i.e. a mismatch between
the caller's expected function prototype and the destination function's
prototype). Many of these cases can be found with -Wcast-function-type,
which found that the rtl wifi drivers had a bunch of needless function
casts. Remove function casts for tasklet callbacks in the various drivers.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/201911150926.2894A4F973@keescook


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2611045e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -22,8 +22,7 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
	int	i, res = _SUCCESS;
	struct recv_buf *precvbuf;

	tasklet_init(&precvpriv->recv_tasklet,
		     (void(*)(unsigned long))rtl8188eu_recv_tasklet,
	tasklet_init(&precvpriv->recv_tasklet, rtl8188eu_recv_tasklet,
		     (unsigned long)padapter);

	/* init recv_buf */
+1 −2
Original line number Diff line number Diff line
@@ -17,8 +17,7 @@ s32 rtw_hal_init_xmit_priv(struct adapter *adapt)
{
	struct xmit_priv *pxmitpriv = &adapt->xmitpriv;

	tasklet_init(&pxmitpriv->xmit_tasklet,
		     (void(*)(unsigned long))rtl8188eu_xmit_tasklet,
	tasklet_init(&pxmitpriv->xmit_tasklet, rtl8188eu_xmit_tasklet,
		     (unsigned long)adapt);
	return _SUCCESS;
}
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ enum rx_packet_type {
};

#define INTERRUPT_MSG_FORMAT_LEN 60
void rtl8188eu_recv_tasklet(void *priv);
void rtl8188eu_recv_tasklet(unsigned long priv);
void rtl8188e_process_phy_info(struct adapter *padapter,
			       struct recv_frame *prframe);
void update_recvframe_phyinfo_88e(struct recv_frame *fra, struct phy_stat *phy);
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
s32 rtl8188eu_init_xmit_priv(struct adapter *padapter);
s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter);
#define hal_xmit_handler rtl8188eu_xmit_buf_handler
void rtl8188eu_xmit_tasklet(void *priv);
void rtl8188eu_xmit_tasklet(unsigned long priv);
bool rtl8188eu_xmitframe_complete(struct adapter *padapter,
				  struct xmit_priv *pxmitpriv);

+4 −4
Original line number Diff line number Diff line
@@ -773,10 +773,10 @@ void usb_write_port_cancel(struct adapter *padapter)
	}
}

void rtl8188eu_recv_tasklet(void *priv)
void rtl8188eu_recv_tasklet(unsigned long priv)
{
	struct sk_buff *pskb;
	struct adapter *adapt = priv;
	struct adapter *adapt = (struct adapter *)priv;
	struct recv_priv *precvpriv = &adapt->recvpriv;

	while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
@@ -792,9 +792,9 @@ void rtl8188eu_recv_tasklet(void *priv)
	}
}

void rtl8188eu_xmit_tasklet(void *priv)
void rtl8188eu_xmit_tasklet(unsigned long priv)
{
	struct adapter *adapt = priv;
	struct adapter *adapt = (struct adapter *)priv;
	struct xmit_priv *pxmitpriv = &adapt->xmitpriv;

	if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY))
Loading