[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/xmalloc Unify type handling in macros
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 Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |