Linux-wireless: why use macro to call functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 

I was studying the Linux wireless subsystem code and noticed this code (in ieee80211_rx_handlers):

It first defines the macro:

#define CALL_RXH(rxh) \    
 do {                            \
             res = rxh(rx);          \
             if (res != RX_CONTINUE) \
                     goto rxh_next;  \
     } while (0);

Then the macro is used to call a series of functions:

CALL_RXH(ieee80211_rx_h_check_more_data)
CALL_RXH(ieee80211_rx_h_uapsd_and_pspoll)
CALL_RXH(ieee80211_rx_h_sta_process)
CALL_RXH(ieee80211_rx_h_decrypt)
CALL_RXH(ieee80211_rx_h_defragment)
CALL_RXH(ieee80211_rx_h_michael_mic_verify)


My question is, why not just call the functions directly like:

ieee80211_rx_h_check_more_data(rx);
ieee80211_rx_h_uapsd_and_pspoll(rx);

...

Is it just for the sake of outlining the code for easy reading? Appreciate if anyone can explain. Thanks!


Regards,
Fred
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux