Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 131a14b3 authored by Jesper Juhl's avatar Jesper Juhl Committed by Greg Kroah-Hartman
Browse files

staging, rt2860: Remove unnecessary casts of void ptr returning alloc function return values



Hi,

The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from drivers/staging/rt2860/

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 60a1d01b
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -799,7 +799,7 @@ void BAOriSessionTearDown(struct rt_rtmp_adapter *pAd,
			/* force send specified TID DelBA */
			/* force send specified TID DelBA */
			struct rt_mlme_delba_req DelbaReq;
			struct rt_mlme_delba_req DelbaReq;
			struct rt_mlme_queue_elem *Elem =
			struct rt_mlme_queue_elem *Elem =
			    (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
				kmalloc(sizeof(struct rt_mlme_queue_elem),
					MEM_ALLOC_FLAG);
					MEM_ALLOC_FLAG);
			if (Elem != NULL) {
			if (Elem != NULL) {
				NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
				NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
@@ -839,7 +839,7 @@ void BAOriSessionTearDown(struct rt_rtmp_adapter *pAd,
	    && (pBAEntry->ORI_BA_Status == Originator_Done)) {
	    && (pBAEntry->ORI_BA_Status == Originator_Done)) {
		struct rt_mlme_delba_req DelbaReq;
		struct rt_mlme_delba_req DelbaReq;
		struct rt_mlme_queue_elem *Elem =
		struct rt_mlme_queue_elem *Elem =
		    (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
			kmalloc(sizeof(struct rt_mlme_queue_elem),
				MEM_ALLOC_FLAG);
				MEM_ALLOC_FLAG);
		if (Elem != NULL) {
		if (Elem != NULL) {
			NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
			NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
@@ -908,7 +908,7 @@ void BARecSessionTearDown(struct rt_rtmp_adapter *pAd,
		/* */
		/* */
		if (bPassive == FALSE) {
		if (bPassive == FALSE) {
			struct rt_mlme_queue_elem *Elem =
			struct rt_mlme_queue_elem *Elem =
			    (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
				kmalloc(sizeof(struct rt_mlme_queue_elem),
					MEM_ALLOC_FLAG);
					MEM_ALLOC_FLAG);
			if (Elem != NULL) {
			if (Elem != NULL) {
				NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
				NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
+4 −3
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ int MainVirtualIF_close(IN struct net_device *net_dev)
		    (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) {
		    (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) {
			struct rt_mlme_disassoc_req DisReq;
			struct rt_mlme_disassoc_req DisReq;
			struct rt_mlme_queue_elem *MsgElem =
			struct rt_mlme_queue_elem *MsgElem =
			    (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
				kmalloc(sizeof(struct rt_mlme_queue_elem),
					MEM_ALLOC_FLAG);
					MEM_ALLOC_FLAG);


			if (MsgElem) {
			if (MsgElem) {
@@ -725,7 +725,8 @@ Return Value:
int AdapterBlockAllocateMemory(void *handle, void ** ppAd)
int AdapterBlockAllocateMemory(void *handle, void ** ppAd)
{
{


	*ppAd = (void *)vmalloc(sizeof(struct rt_rtmp_adapter));	/*pci_alloc_consistent(pci_dev, sizeof(struct rt_rtmp_adapter), phy_addr); */
	*ppAd = vmalloc(sizeof(struct rt_rtmp_adapter));
	/* pci_alloc_consistent(pci_dev, sizeof(struct rt_rtmp_adapter), phy_addr); */


	if (*ppAd) {
	if (*ppAd) {
		NdisZeroMemory(*ppAd, sizeof(struct rt_rtmp_adapter));
		NdisZeroMemory(*ppAd, sizeof(struct rt_rtmp_adapter));