Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp728074pxm; Fri, 25 Feb 2022 18:29:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwykCD3DtL/Yw9f3zFWv1wpMdyT+L5+Hbxufvh47YrwFoVskQoGHLF7Ab1yLe0nhylhCqwr X-Received: by 2002:a17:90a:6a8a:b0:1bc:2953:75ed with SMTP id u10-20020a17090a6a8a00b001bc295375edmr6029270pjj.130.1645842586906; Fri, 25 Feb 2022 18:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645842586; cv=none; d=google.com; s=arc-20160816; b=IvA7jRdflBv9g4T6O4OHnA7enHptPQwxG8Rb99WXQ4u+JnmoZaRXm35b7KyrINHQFF ptwfvHGH+rY7vejA6F6MQiD8jA1RRFqLNoEPtskpDZQ3fqSKOwzoG10z3HbE5hdlFVH0 7Fg9FfI7BN+JMMB2+0lx14EBPQdzxbJJ+eZX1BpHQd8xyBgE9A5DEAG3ZqMZe0UNFEvF 8C5nDALzspxfdY2va62NVsCIrQFNrJfH8aEDlbUrYnubQVhmPsnKNc98SWwpPnf+NbCk bw9mEZO11QT6yNMug/usDZrYFDphdxsDh0QjzRs0sAPqm6J+iRgpmKJY5fCUweyWdLbj RZPQ== 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; bh=yb5kUwSqbShplqHpAvVZi6NDljwSk1ZgkzPyWboSZH4=; b=jWBcrvJ8iDcYCQjsJXKsYI34tHq48oqbp0taPT0KI7ySdF0k0qJyAWnMlQjD7Jeen9 TNg2ccS5BRUzJgU2OSwr5ADbcbk/QopAFbb3+bTzFojd7F0R3ABhNsXdJnsApOu+sPpe DU9qACi6H105GxF4by2ySRafvonox4XXnCKX4FLwx0esRUB15uzjcQB+454/HkcIYxL3 27tcBRJItQh4BADO4nRIXvz42zlTgZGX3JQWtMW8lAKSjKCoXIjShNydz8/40gz0qRrr zqytK4+oXiOlhpjDUGOBE3kAhs2/GqpujO1e+OTitqBYHDcQ10md558r6QFQflz3j2nH s5WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 19-20020a621813000000b004c3142007f9si3378649pfy.89.2022.02.25.18.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:29:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0DD7F2E0E1C; Fri, 25 Feb 2022 17:57:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232674AbiBYVgY (ORCPT + 99 others); Fri, 25 Feb 2022 16:36:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbiBYVgX (ORCPT ); Fri, 25 Feb 2022 16:36:23 -0500 Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC9C81BE0C5 for ; Fri, 25 Feb 2022 13:35:49 -0800 (PST) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id e5c00027-9682-11ec-9faa-0050568c148b; Fri, 25 Feb 2022 21:35:48 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 90DCF194B1C; Fri, 25 Feb 2022 22:35:50 +0100 (CET) Date: Fri, 25 Feb 2022 22:35:42 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Rob Clark Cc: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Rob Clark , Tvrtko Ursulin , David Airlie , linux-arm-msm , open list , dri-devel , Thomas Zimmermann , freedreno Subject: Re: [Freedreno] [PATCH 1/3] drm: Extend DEFINE_DRM_GEM_FOPS() for optional fops Message-ID: References: <20220225202614.225197-1-robdclark@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Rob, > > > diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h > > > index 35e7f44c2a75..987e78b18244 100644 > > > --- a/include/drm/drm_gem.h > > > +++ b/include/drm/drm_gem.h > > > @@ -327,7 +327,7 @@ struct drm_gem_object { > > > * non-static version of this you're probably doing it wrong and will break the > > > * THIS_MODULE reference by accident. > > > */ > > > -#define DEFINE_DRM_GEM_FOPS(name) \ > > > +#define DEFINE_DRM_GEM_FOPS(name, ...) \ > > > static const struct file_operations name = {\ > > > .owner = THIS_MODULE,\ > > > .open = drm_open,\ > > > @@ -338,6 +338,7 @@ struct drm_gem_object { > > > .read = drm_read,\ > > > .llseek = noop_llseek,\ > > > .mmap = drm_gem_mmap,\ > > > + ##__VA_ARGS__\ > > > } > > > > Would it not be less convoluted to make the macro only provide > > the initializers? So you'd get something like: > > > > static const struct file_operations foo = { > > DRM_GEM_FOPS, > > .my_stuff = whatever, > > }; > > > > Hmm, I like my color of the bikeshed, but I guess it is a matter of opinion ;-) Or less surprise. Most similar macros provides initializers only. Try "git grep DRM_.*OPS | grep define" in include/drm and take a look at the hits. Sam