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

Re: [PATCH v3 2/4] tools: add container_of() macro to xen-tools/common-macros.h


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 23 Mar 2023 12:01:30 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jKv5w8g5/kTOEI/helHq5LiOVSvHw9iXU++S4LZ+QRE=; b=demp7rCB522/CGYVjT4jDrttsgXL5MyAsraV4/qge+r4xN6JZIpSqAN4Quz4KUHJYb6VsUXNZuxhNknqGTBlQD3Hp3pNDRLyIxSWch9DwbsJcqa36xO+xn081eH50WsHltR2SQtdIns7g5UYgPCWjA6Va5fyhFfzj/UoJq57LNZ0aYOoDWK0iMIvXnGNYoK+8hKT6alVSeiH73/WHHKm5+/CkKFUWn+MFSUgmxUFNr98SrT1NoeiRk5KCPATP91C80XJf0u5rC7ai48xQU4hM4yRAS3HPpGLeU5MCc+xvWcWxVXPKEolK3LEbhSfGjXlMeQXSld3GEo0SavNiyrObg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eYmLGS5ShK77cfOmxzVvaK+g70V3IBNEe1s6LF0YjdpOpumdoqPi6NBY/qIaD5c1r78fIdnhn5Az+a3gt1pBoNNzOsAuhHmUvuaM6JJi4cPnzBCuq97apx68Lre49nz1ini8+ZLpMotYLu0OynzX+qN8+XHbe+rXPM6xHwP9Mt9Id4f7pIX7xz99GmA35NgMYwwO9gotGIKVSL1JaH01snHtXfJ0XrqXaUt+h1o8NWRkbTrJ7FOPwDc/6yED67uhjBuOQ4I8loWiInTvISlU/tTEBxR45nkwGlLEYm4l7LwX0vvIaksHmsl0aCLXZSpq0V7RfRykfdzHgu/l40bEqw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 23 Mar 2023 11:01:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.03.2023 11:44, Anthony PERARD wrote:
> On Mon, Mar 06, 2023 at 08:21:38AM +0100, Juergen Gross wrote:
>> --- a/tools/include/xen-tools/common-macros.h
>> +++ b/tools/include/xen-tools/common-macros.h
>> @@ -76,4 +76,8 @@
>>  #define __must_check __attribute__((__warn_unused_result__))
>>  #endif
>>  
>> +#define container_of(ptr, type, member) ({                \
>> +    typeof( ((type *)0)->member ) *__mptr = (ptr);        \
> 
> I think identifier starting with two '_' are supposed to be reserved.
> Would you be ok to have just one? (So "_mptr")

Except that single-underscore prefixed names are also kind of reserved
(for file-scope symbols). Hence why I'm generally suggesting / asking
for trailing underscores to be used.

Jan



 


Rackspace

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