From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 486C6C4332F for ; Mon, 11 Oct 2021 08:34:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30AD560EFE for ; Mon, 11 Oct 2021 08:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235059AbhJKIgM convert rfc822-to-8bit (ORCPT ); Mon, 11 Oct 2021 04:36:12 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:58640 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234910AbhJKIgL (ORCPT ); Mon, 11 Oct 2021 04:36:11 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-10-3xCUUb26MU6vXGQv3KSaTQ-1; Mon, 11 Oct 2021 09:34:09 +0100 X-MC-Unique: 3xCUUb26MU6vXGQv3KSaTQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 11 Oct 2021 09:34:06 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.023; Mon, 11 Oct 2021 09:34:06 +0100 From: David Laight To: 'Steven Rostedt' , Jan Engelhardt CC: Mathieu Desnoyers , Rasmus Villemoes , linux-kernel , Linus Torvalds , Paul , Josh Triplett , "Lai Jiangshan" , "Joel Fernandes, Google" , Pablo Neira Ayuso , "Jozsef Kadlecsik" , Florian Westphal , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , rcu , netfilter-devel , coreteam , netdev Subject: RE: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) * Thread-Topic: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) * Thread-Index: AQHXui9pmtYafoLH60aZNYgeQxdcxKvNgGPQ Date: Mon, 11 Oct 2021 08:34:06 +0000 Message-ID: References: <20211005094728.203ecef2@gandalf.local.home> <639278914.2878.1633457192964.JavaMail.zimbra@efficios.com> <826o327o-3r46-3oop-r430-8qr0ssp537o3@vanv.qr> <20211005144002.34008ea0@gandalf.local.home> <20211005154029.46f9c596@gandalf.local.home> <20211005163754.66552fb3@gandalf.local.home> <20211005172435.190c62d9@gandalf.local.home> In-Reply-To: <20211005172435.190c62d9@gandalf.local.home> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Steven Rostedt > Sent: 05 October 2021 22:25 > ... > > Basically (one alternative I was looking at) was simply passing around a > void pointer. Not sure how the RCU macros would handle that. But to > completely abstract it out, I was thinking of just returning void * and > accepting void *, but I didn't want to do that because now we just lost any > kind of type checking done by the compiler. The tricks I was playing was to > keep some kind of type checking. Yes, don't use 'void *'. Sun used it for all the pointers in their DDI/DKI - made it impossible to ensure you were passing in the right type of 'token'. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)