All of lore.kernel.org
 help / color / mirror / Atom feed
From: bernd@petrovitsch.priv.at (Bernd Petrovitsch)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Linux-wireless: why use macro to call functions
Date: Mon, 23 Dec 2013 13:03:00 +0100	[thread overview]
Message-ID: <1387800180.1784.65.camel@thorin> (raw)
In-Reply-To: <52b80f05.c7b60e0a.2515.5c5e@mx.google.com>

Hi!

On Mon, 2013-12-23 at 11:23 +0100, Martin Brugnara wrote:
[...]
> Why here is used a macro instead of an inline func.

Maybe you should get a book to learn "C"?
The macro uses "goto" which won't work with inline functions in that
situation.
Since the macro uses the only argument exactly once, it actually makes
no functional/semantic difference if it is a macro or would be an inline
function (and performance-wise very probably too with any somewhat
recent compiler).
And the macro just avoids to copy-paste identical lines/logic.

And you surely should learn to quote correctly and thus avoid top
posting completely.

[... fullquote deleted ...]

	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at

  reply	other threads:[~2013-12-23 12:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 10:23 Linux-wireless: why use macro to call functions Martin Brugnara
2013-12-23 12:03 ` Bernd Petrovitsch [this message]
2013-12-24 12:19   ` Fred Chou
2013-12-24 13:35     ` Greg Freemyer
2013-12-24 13:48     ` Adrian Ratnapala
2013-12-24 16:47       ` Valdis.Kletnieks at vt.edu
  -- strict thread matches above, loose matches on Subject: below --
2013-12-23  6:05 Fred Chou
2013-12-23  7:25 ` Daniel Baluta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387800180.1784.65.camel@thorin \
    --to=bernd@petrovitsch.priv.at \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.