[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 15:43:57 +0100
  • Authentication-results: esa1.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 14:44:14 +0000
  • Ironport-sdr: LbKkooiHgsinLnG5IiW6HXpXAiwT4z5sEHMNspxI3iHTdDYWmMGbdjGhqcEyIwRHz7uQxdeZkm 7Zq61HTfQf/MQvb12M+/RC/fyGFqSQ3wekInF5OCDSZloYJhYxZ8y3+TcUWLKpkg+gLjU9gers wwHDxJpoWeA9/cxuNJGDOCz7un1Lg2HTt/FjUR15b+XEGz2b/cExNpC4tdUAqfAeSWRQavtK0b AnyctC2kHGBSvJwqLWmNDLIFgGaMFnkQ7MnDJypn0ke9SW6CGQKRqNMMJAzMraaUiMnXJC8mse fas=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Thanks, Roger.

Xen-devel mailing list



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