Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7734559rwb; Wed, 23 Nov 2022 10:03:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7yE65ea49xXef4cr52tlyrLfiy5QYgZxAqL986nBYEbMchkAg7ST8Rc5C0FOI7BDM0vtqG X-Received: by 2002:a17:903:300c:b0:188:f663:e2e7 with SMTP id o12-20020a170903300c00b00188f663e2e7mr13435884pla.121.1669226580285; Wed, 23 Nov 2022 10:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669226580; cv=none; d=google.com; s=arc-20160816; b=xS3+Qu7NxyL6WI4MvN/Yht1JTli5RKJBUQo+ZmTeOW4VFneq2E2pzaHbWk/Bs5o3SX htsYwL6hiHPkHLngiH14xK8PFd2rIoUtKqrIJ5ilWdNOwjqivPQHxm+fhqDaY9OkOE/P X30qG3oDUaBUeO5vkPlphkuBXTqvenCGU3aiWMAT5VZuaC9PN6uEbTsrJR+hJDJN8Hnb gj7TbGnmVLn3PlBCT3YWxV6+DB+e1XJc0jVeFwBc/U8PNmzgLpsbHUBYXD+8Yi2TJr1t /WoQ+kOgPv6casqr/GdKlW4EmtfRDS1CZHsQL/S6I5BVIe8OfXsT/7Rqo4fyAdML5c7r Yzbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mZGGAbQVRBkDZyExP7ffjlyLb6N0sV9F4cgg4l8gSxE=; b=LlIjYZwn9ZFfFq1zsIDI9nnCImQHIrENTF1QUJ8yTHZzQYkdKLCSClk2t0mcwewCm4 47S6RARdoR4kVsa9OHPEFSeefzw/trMk8JZy5XsKAbMo2g8SSxiVH0WZ9lHLbAVn1u7v XeOW8XAj1mry8ENmMMRU8SEpbm8Cu1IOwoaZBLCaHx0llB/Uos6eURoub3/b0L8FhbsK eHeU5hRLDScilhHk6AgOxyVUzJSgpDce4Y5nor6uv0QeM7XlF9A+gG4jTsqUq/4hNQAB OIfAaGZ8obYJNnQCdJ7TRZSoYDfgWPuOgIi6i0jmSrVbAu+xXAbAXr19ZZZa637v6cAH vvqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="My/je7B5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a1709026ac700b001890c6feff0si11610372plt.484.2022.11.23.10.02.39; Wed, 23 Nov 2022 10:03:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="My/je7B5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238688AbiKWRzs (ORCPT + 88 others); Wed, 23 Nov 2022 12:55:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237899AbiKWRzq (ORCPT ); Wed, 23 Nov 2022 12:55:46 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEBC2B972B for ; Wed, 23 Nov 2022 09:55:44 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id j6so12612969qvn.12 for ; Wed, 23 Nov 2022 09:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mZGGAbQVRBkDZyExP7ffjlyLb6N0sV9F4cgg4l8gSxE=; b=My/je7B5AkyQl5fsdxgrcU4MlCIO0r7BQ5Ticu0quoimRFyd1QFWg1CIRYo2hSlhCk gVjIJJSUMGBCSbu4UDXzbQPaiJloUApBWvaqFNa76nYHQxGNxzJWcDLEm0qltzXuuN/Z gO+uDnAR3m7NYXWzCuDuYM8LFnvN0Xu6vLCMlAClrlBYpN6lXcqxJLcrsGyjBmH/Sv12 +4Tfy+Id6dykaHW4e8It4+0URa6BTBpgvGETfgKsz3tVQND5afP3nmgNdrdjI227ASXm vr1NQmNHtxvof8mhDMYhIaXb4hON7jWdw6w75cCEJBe1LxtxXk3bYjl3v+s4zDC4Zj8c gKuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mZGGAbQVRBkDZyExP7ffjlyLb6N0sV9F4cgg4l8gSxE=; b=a3723so4/KuHwNtYaEs1hRbHYBRv5WLvTK8sDZhn/qcPPCTnff0EPBPlo9hNatsOG9 eS7nIFkRXw3YP6i4nJAyXzmKfsdLeLF+nxighq8L5ug6W5JTVgRtZ/r1/uvacvKUY+u4 bQPEuGjxe4pJKGOEV2KIIGa+teEuIezS8snChHwvNaAyS/gsnCl9ZZiencFXyrUSgxxA TiBn8aDJrORLHarOwwNckEoWm+/deaiF2j9t4oKidkYmy4VwSFPSUU0HTnC4XfhzOTKG r6Sirb5+8j/fGxN/IyK3lxo4w/YgZlcaVlrrq9r//YQkzvkFeo4ZQSYbyCH8+hX/AWS+ yJJw== X-Gm-Message-State: ANoB5pk34/dmgG628yr7cYp6gUKd8ulD+V58aTfni5RH6Zb7pzr28zNH 0RyMMySZ00M3o9vr1IXg0MscoQ== X-Received: by 2002:a05:6214:209:b0:4bb:6bbd:8c1b with SMTP id i9-20020a056214020900b004bb6bbd8c1bmr9012796qvt.111.1669226143925; Wed, 23 Nov 2022 09:55:43 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-47-55-122-23.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.122.23]) by smtp.gmail.com with ESMTPSA id o18-20020a05620a111200b006faaf6dc55asm11988986qkk.22.2022.11.23.09.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 09:55:43 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1oxtyI-00Afdu-Dk; Wed, 23 Nov 2022 13:55:42 -0400 Date: Wed, 23 Nov 2022 13:55:42 -0400 From: Jason Gunthorpe To: Matthew Wilcox Cc: Greg Kroah-Hartman , Maximilian Luz , Andy Shevchenko , linux-kernel@vger.kernel.org, Jens Axboe , "Rafael J. Wysocki" , Len Brown , Stefan Richter , Wolfram Sang , Alexandre Belloni , Dmitry Torokhov , Sean Young , Mauro Carvalho Chehab , Rob Herring , Frank Rowand , Hans de Goede , Mark Gross , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Andreas Noever , Michael Jamet , Mika Westerberg , Yehezkel Bernat , Jiri Slaby , Heikki Krogerus , "Martin K. Petersen" , Chaitanya Kulkarni , Ming Lei , Jilin Yuan , Alan Stern , Sakari Ailus , Thomas Gleixner , Ira Weiny , Dan Williams , Won Chung , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-block@vger.kernel.org, linux-i2c@vger.kernel.org, linux-i3c@lists.infradead.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux1394-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH 3/5] driver core: make struct device_type.uevent() take a const * Message-ID: References: <20221123122523.1332370-3-gregkh@linuxfoundation.org> <711d5275-7e80-c00d-0cdc-0f3d52175361@gmail.com> <97be39ed-3cea-d55a-caa6-c2652baef399@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 23, 2022 at 05:49:36PM +0000, Matthew Wilcox wrote: > On Wed, Nov 23, 2022 at 01:29:56PM -0400, Jason Gunthorpe wrote: > > #define generic_container_of(in_type, in, out_type, out_member) \ > > _Generic(in, \ > > const in_type *: ((const out_type *)container_of(in, out_type, out_member)), \ > > in_type *: ((out_type *)container_of(in, out_type, out_member)) \ > > ) > > There's a neat trick I found in seqlock.h: > > #define generic_container_of(in_t, in, out_t, m) \ > _Generic(*(in), \ > const in_t: ((const out_t *)container_of(in, out_t, m)), \ > in_t: ((out_t *)container_of(in, out_type, m)) \ > ) > > and now it fits in 80 columns ;-) Aside from less letters, is their another benifit to using *(in) ? Jason