[ovs-dev] [PATCH] Avoid C preprocessor trick where macro has the same name as a function.
Ben Pfaff
blp at nicira.com
Mon Jul 29 22:23:51 UTC 2013
On Mon, Jul 29, 2013 at 10:52:52AM -0700, Gurucharan Shetty wrote:
> On Mon, Jul 29, 2013 at 9:57 AM, Ben Pfaff <blp at nicira.com> wrote:
>
> > In C, one can do preprocessor tricks by making a macro expansion include
> >
> Usually we put a <area>: here. I am not sure whether you expect it on every
> patch.
For commits like this one that affect a treewide convention, I do not
normally mention an area, because the commit is not localized to one
area.
> > @@ -47,17 +47,19 @@ struct poll_waiter;
> > * (poll_fd_wait)(fd, events, where);
> >
> Shouldn't we change the above example to poll_fd_wait_at?
The comment did need an update. I changed it to:
/* Schedule events to wake up the following poll_block().
*
* The poll_loop logs the 'where' argument to each function at "debug" level
* when an event causes a wakeup. Each of these ways to schedule an event has
* a function and a macro wrapper. The macro version automatically supplies
* the source code location of the caller. The function version allows the
* caller to supply a location explicitly, which is useful if the caller's own
* caller would be more useful in log output. See timer_wait_at() for an
* example. */
Thanks for the review.
More information about the dev
mailing list