Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: r8712_wlanhdr_to_ethhdr(): Change return values

Change return values of r8712_wlanhdr_to_ethhdr from _SUCCESS/_FAIL to
0/-ENOMEM. Modify the function containing a call site of
r8712_wlanhdr_to_ethhdr so that it compares the return value to
0/-ENOMEM instead of _SUCCESS/_FAIL.
Change the return type of r8712_wlanhdr_to_ethhdr from sint to int to
match its prototype in corresponding .h file.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190808064012.12661-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nishka Dasgupta and committed by
Greg Kroah-Hartman
1bdcb366 4dbadfaf

+6 -6
+2 -2
drivers/staging/rtl8712/rtl8712_recv.c
··· 638 638 } 639 639 } else { /*B/G mode*/ 640 640 retval = r8712_wlanhdr_to_ethhdr(prframe); 641 - if (retval != _SUCCESS) 642 - return retval; 641 + if (retval) 642 + return _FAIL; 643 643 if (!padapter->driver_stopped && !padapter->surprise_removed) { 644 644 /* indicate this recv_frame */ 645 645 r8712_recv_indicatepkt(padapter, prframe);
+4 -4
drivers/staging/rtl8712/rtl871x_recv.c
··· 585 585 return retval; 586 586 } 587 587 588 - sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) 588 + int r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) 589 589 { 590 590 /*remove the wlanhdr and add the eth_hdr*/ 591 591 sint rmv_len; ··· 628 628 ptr = recvframe_pull(precvframe, (rmv_len - 629 629 sizeof(struct ethhdr) + 2) - 24); 630 630 if (!ptr) 631 - return _FAIL; 631 + return -ENOMEM; 632 632 memcpy(ptr, get_rxmem(precvframe), 24); 633 633 ptr += 24; 634 634 } else { 635 635 ptr = recvframe_pull(precvframe, (rmv_len - 636 636 sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0))); 637 637 if (!ptr) 638 - return _FAIL; 638 + return -ENOMEM; 639 639 } 640 640 641 641 memcpy(ptr, pattrib->dst, ETH_ALEN); ··· 645 645 646 646 memcpy(ptr + 12, &be_tmp, 2); 647 647 } 648 - return _SUCCESS; 648 + return 0; 649 649 } 650 650 651 651 s32 r8712_recv_entry(union recv_frame *precvframe)