Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp715944pxm; Fri, 25 Feb 2022 18:08:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1A6LjeqEZHT4L0OcFw0ZP957AjWQJPwQC7LNH17MzWtpcgcLaUP1xXTFde7oVpz+ZPAhO X-Received: by 2002:a63:da06:0:b0:372:f5c5:8f92 with SMTP id c6-20020a63da06000000b00372f5c58f92mr8499116pgh.311.1645841295380; Fri, 25 Feb 2022 18:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645841295; cv=none; d=google.com; s=arc-20160816; b=hVAY/RHG3P1A4I4kgYdL+5VYDyAJzOZ5eoPfigWZy31k97e/XH13hIWNchyNfrfdhn 9qJU0+k1gx5THZv615eus1L+ZJy34mTBtaELT02sx0KKyZmraqXotAU9PrHqjfIRuOmu /l4l7g0vFmO6ETT+n2MG2nYRYu6MhjOrrc1jMQb6G0qyz6PGprchd/NLYoMW2nVCjy+v TbxdilcDcxq66K9nY82UQOeIVz0CFwOZuxDasyFEFCW86XpU7LJmokZcGkrbG5bkZurp yGTsjGYd/PyQG10a2jY/uTXK309Zn1o5i1Xfns4c334Nun/bRNpeM4AOTFD0SOn6D/ZY rj7Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=agUsgZSfmhYZGpJjvZT5T9w5y/kR2mEN9hgC0CtabRs=; b=m6jR/f62M+voDo0gy3dYYfp7EmL55r4aFKqVXO/6cjqDjx1mAoy6TNPMDZE4eqKX6O Qf/qgMEA0Iulz7jOsrZZHbWTWtkRzicNfboDQ8TGaeVrC6OWP8UdeEmmVPreKCFvuwbh P/0G93FB38Q5CrMBAofzutYBIQ2JUSBKWFbyqx8kQ8obkK4JYSn9fI8e5C1lHQCCgzY3 4eYstVliBF5oWLZ5osFQEu0MLDHM3kGYu0PbGf4WLdypO85Jq5PYZHeHw03NRFwEsVp6 6SdMqaMonlTHzlYm6DuE/L+xy9Cx96YfIG5ICQ71gXNDyx9dE+l/Pn+2AvmfOUb+HnNJ qgcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=STw3Osbv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j7-20020a17090aeb0700b001b92319aba4si3491188pjz.58.2022.02.25.18.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:08:15 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=STw3Osbv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 412ED24F191; Fri, 25 Feb 2022 17:46:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236643AbiBYUhT (ORCPT + 99 others); Fri, 25 Feb 2022 15:37:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231500AbiBYUhS (ORCPT ); Fri, 25 Feb 2022 15:37:18 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF92D203BFE; Fri, 25 Feb 2022 12:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645821405; x=1677357405; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=Um3Ri3Z5tNczvjbg/Kqd4t82aFPTJQvoXqKHvporKMY=; b=STw3OsbvzxKtGZBf1w7CWCu1ztwIvRrQk9Qb9578FlyQzWF2Da1HA2Fl 7/1ZRyfNlopZyUQ9AnGeZfuOCHR3Q6MxaSC4wUej2pcyRj/KHCr0rgVH2 6APviUzWsRST/HGQYbR9qheijiInUq12aCm8kSyNL8IHHoaLxd7iJTZfd hH1NSnLma6+dkrG4VhIlrAHdoCtrdg5hvEbZWbqseABqxr+z7B0nLO3dt txmVPpWDBk0KZo99fXkCJZTZd3gngNEfMCDAaZ4nTpemJY9FzJAHipjfL kJA7qUEdak65tGykaeRt/SEWSvWy6DmRV5Tspr6XVWaNf0lLqnBJRW42Z w==; X-IronPort-AV: E=McAfee;i="6200,9189,10269"; a="252771373" X-IronPort-AV: E=Sophos;i="5.90,137,1643702400"; d="scan'208";a="252771373" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 12:36:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,137,1643702400"; d="scan'208";a="638353417" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.151]) by fmsmga002.fm.intel.com with SMTP; 25 Feb 2022 12:36:41 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 25 Feb 2022 22:36:41 +0200 Date: Fri, 25 Feb 2022 22:36:41 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Rob Clark Cc: dri-devel@lists.freedesktop.org, Rob Clark , Tvrtko Ursulin , David Airlie , linux-arm-msm@vger.kernel.org, open list , Thomas Zimmermann , freedreno@lists.freedesktop.org Subject: Re: [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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220225202614.225197-1-robdclark@gmail.com> X-Patchwork-Hint: comment X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 On Fri, Feb 25, 2022 at 12:26:12PM -0800, Rob Clark wrote: > From: Rob Clark > > Extend the helper macro so we don't have to throw it away if driver adds > support for optional fops, like show_fdinfo(). > > Signed-off-by: Rob Clark > --- > include/drm/drm_gem.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > 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, }; > > void drm_gem_object_release(struct drm_gem_object *obj); > -- > 2.35.1 -- Ville Syrj?l? Intel