All of lore.kernel.org
 help / color / mirror / Atom feed
* cpu_*(), #define, and &
@ 2009-09-21 16:49 George Dunlap
  2009-09-21 17:03 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: George Dunlap @ 2009-09-21 16:49 UTC (permalink / raw)
  To: xen-devel

I hope I'm not bikeshedding here
(http://catb.org/jargon/html/B/bikeshedding.html), but I'm not really
happy with the cpu_*() macros in cpumask.h adding ampersands before
the arguments.  In C (as opposed to C++), passing a non-pointer
generally means that no values are going to be changed.  Other than
Linux similarity, is there a good reason to do this in a macro, rather
than just having the caller provide the &?  Would anyone object to me
submitting a patch to change that?

(A patch to change it looks to be rather big and boring, so I want to
talk about it first before doing it...)

 -George

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cpu_*(), #define, and &
  2009-09-21 16:49 cpu_*(), #define, and & George Dunlap
@ 2009-09-21 17:03 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2009-09-21 17:03 UTC (permalink / raw)
  To: George Dunlap, xen-devel

On 21/09/2009 17:49, "George Dunlap" <dunlapg@umich.edu> wrote:

> I hope I'm not bikeshedding here
> (http://catb.org/jargon/html/B/bikeshedding.html), but I'm not really
> happy with the cpu_*() macros in cpumask.h adding ampersands before
> the arguments.  In C (as opposed to C++), passing a non-pointer
> generally means that no values are going to be changed.  Other than
> Linux similarity, is there a good reason to do this in a macro, rather
> than just having the caller provide the &?  Would anyone object to me
> submitting a patch to change that?
> 
> (A patch to change it looks to be rather big and boring, so I want to
> talk about it first before doing it...)

I somewhat agree about the pointless macro-ification in cpumask.h, but I
don't care enough about this to diverge from the original Linux definitions.
The cpumask macros which modify the given mask are named to make it pretty
obvious. We'll live with it; it's not really that annoying.

 -- Keir

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-21 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-21 16:49 cpu_*(), #define, and & George Dunlap
2009-09-21 17:03 ` Keir Fraser

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.