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

Re: [Xen-devel] [PATCH] xen/xmalloc Unify type handling in macros

  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 24 Feb 2020 17:15:03 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Mon, 24 Feb 2020 16:15:15 +0000
  • Ironport-sdr: 8f6OOz3jVzJCKtaJqdtkwk8reJ9UKSzcCCUM+tsGh+9A/YnX7S1TDqnUfJiKKW5oBmLvOH0PYP 07A5iIGmITDneP1y21ZELQ25ITo0x5vz3XKYp9oBk60CXt9QubydVADy8bg0eiwpBbYWyWCOXN /3XSD8Nz7CpveJTa9dIzdF6V2uH4b+AJnSsndey8UMHgONKrr0RII1T11WoYh7WO/00NNiHlNo YpM7mXlSMqRbtEAHRgsKfLR4gAgraP24FYnnIpHMOmkZSqHymQm6UpY3kDszhA798WqVhUyyw3 4uI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Feb 24, 2020 at 03:49:47PM +0000, Andrew Cooper wrote:
> On 24/02/2020 14:43, Roger Pau Monné wrote:
> > On Mon, Feb 24, 2020 at 02:22:19PM +0000, Andrew Cooper wrote:
> >> The macros in xmalloc.h are a mix of using their type parameter directly, 
> >> and
> >> using typeof().
> > The only ones I could spot in the neighborhood are
> > xrealloc_flex_struct and xmemdup, which don't have a type parameter
> > but rather a pointer parameter, and hence use typeof against the
> > passed pointer.
> >
> >> Switch uniformly to the latter so expressions can be used,
> >> rather than only type names.
> > I'm fine with this, but I don't think they are a mix, macros
> > using a type parameter clearly expect a type, while macros using ptr
> > expect a pointer, and hence use typeof to get the type.
> I'm afraid this isn't helpful.  Its not an ack/nack or any suggestion
> from a change.

Oh, sorry I wasn't clear. I'm not opposed to the change, but I would
request a reword of the commit message. Ie:

"Allow the macros in xmalloc.h to also support getting passed an
instance of a type instead of the type itself. Some macros already
expected a pointer to an instance getting passed in, because they had
to operate on it, but others only support getting passed a type."

Or something along the lines. When I read your commit message it made
me think that those macros would randomly expect a type or an instance
without any reasoning, but AFAICT there's a reason why things are the
way they are now.

Thanks, Roger.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.