Linux-wireless: why use macro to call functions

Greg Freemyer greg.freemyer at
Tue Dec 24 08:35:34 EST 2013

Fred Chou <fred.chou.nd at> wrote:

>On Mon, Dec 23, 2013 at 8:03 PM, Bernd Petrovitsch <
>bernd at> wrote:
>> And the macro just avoids to copy-paste identical lines/logic.
>Thank you all for the explanation. Originally I was wondering if there
>could be some other reasons. So the main (or only?) purpose of the
>macro is
>to save some typing, and in terms of functionality I could equivalently
>call each handlers.

If you do decide to inline the code, you should probably get rid of the do while(0) part.

That exists just to get rid of side effects of using macros in various syntax situations.

Sent from my Android phone with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list