Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp720206pxm; Fri, 25 Feb 2022 18:15:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaGzguev1q7Ni6P4CtdFXQqkGIiSLsb+CVyLnH3L/ySDb3lVerdYYqL5WASb5QCf7YBNix X-Received: by 2002:a63:af02:0:b0:375:57f0:8af1 with SMTP id w2-20020a63af02000000b0037557f08af1mr8434468pge.188.1645841752461; Fri, 25 Feb 2022 18:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645841752; cv=none; d=google.com; s=arc-20160816; b=PMJHnBpp0x2+9GD10x7L7EjaSvfNYS364NrTvNlw/RuMn66skmTNOGBdRgfh8Sbncu IhvJ3cOH4KDmGpsKKmxSZWZvXkOkPQYne7y5OPfunjNV0sc4dFdRgIDr72D4ZGGYGPY3 np83v/W34BBC0LPtkTC4FXSy08iDH72Yd9hsqvnis0RkHldgx63q0fWE0ZDwHkCoEBh4 fljgydfO/9FwO28jUP/UfHs60uBOnAMXbTklj7JQ27gAMZcZg3AcBBVpC8ONj43YIFhI w5xko4V+lMcxE40ci7Q5mzTyEJ6LBoYnMWhPZviri3Np6xp4GK8aIE46WStd1xm69ls7 t5wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9VVf1+C+ic0+UHKTIlPAU7kab9O4mDJTEXrG1CAIyA0=; b=KSrof6mok+Slq9MYUAvwDtd/Zj/Jrce3cYQBtsbGDAvzDN9Xfv7S84pLkXZI64e8Bo AwfsFK28IabUDVRpCMtgj7B2VaczfH1zHqODXQjizqXXawrXmwPSJkEsnN+dRQJCoJ3Q reXHcOFGpCdqw8fL26iBaWqiWbBAtWbHnFnw61Uwo5y+4eH7Y6pU2h9dtBcLaLHUWo/1 uT9seEI1Haq2+FmIdotdEqQl8jIh8LJtyB4eAhmHUTIXBLktz+6Cp7yZrwAmNWMmy8bN seLGSCqEUXwAjLo3G5qsyiXT2y5CUZ1fSrlFWeaD6NH1ks8dY2Hfo+gT+tiz9Dh7PYQv v1Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Q7rUxqz/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j27-20020a634a5b000000b0036318702d1bsi3231000pgl.335.2022.02.25.18.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:15:52 -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=@gmail.com header.s=20210112 header.b="Q7rUxqz/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 618D42193C9; Fri, 25 Feb 2022 17:49:03 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238616AbiBYVZb (ORCPT + 99 others); Fri, 25 Feb 2022 16:25:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236420AbiBYVZZ (ORCPT ); Fri, 25 Feb 2022 16:25:25 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5EE21BE118; Fri, 25 Feb 2022 13:24:51 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id r10so6317717wrp.3; Fri, 25 Feb 2022 13:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9VVf1+C+ic0+UHKTIlPAU7kab9O4mDJTEXrG1CAIyA0=; b=Q7rUxqz/UgVude0iW3thhOW3RovvXofgrYhvLEAuApKO362jsR9iSOM+0gSLUxpagb vbOJOqqV0AgmO6twpSGsLhSjfG0uP25I041TafaBudI0rEjZfjQ5DsCDFwpPQxG3x+8S w7FAiX9G8jKynyY2u4wnmYXXe7QTPAY6yw4a0x3rE/V2ZJQ/OEi9b1gRCHL90iH/P6HU r7DG2S9+HoKPJX2rqTpJuHJV9tNz33TBOUmc2np/3q3PI6BHy/sXyt4HmuP+YREJMqHF fboAGnf7LpATIJcdhwWzD95a0ZSdhTwq4O3R5YOmYbJyOzSD5ZJ/W6i74/W9TSlkRm/b QofQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9VVf1+C+ic0+UHKTIlPAU7kab9O4mDJTEXrG1CAIyA0=; b=gHnaNfzTrvJo4ZQCei5c7/OVDMyhvDYZk/L8zCPhWOWoI6AuPqeJvgwS8WYYpZh8Vc uH2iabB0rcX8R6CGT0ZcVBgDqhBiAEfSpU+fVE6VZzNhkSNwj3HoW+zq0I+giH/QitG4 qmjC6JEdIA/lIu441eBuhC8lheCzGCRuqAqg0Ihx6ySTFN3XiXkX2DC3QGH9yFA01vyh wetk3/U7GEpMRJh/2+vHOec40HNVduMXKZx8Je/UOKiS3TXUXPfcHV10SqoMGsmjMM04 y3kR++bc/6JU2i6tb4N0FfxHoVLpAMyi1PbmRfYMmNasMT9MYZvH4OsXq+AxrLXlGM+M QTlQ== X-Gm-Message-State: AOAM531mdE3ixB4SRMAB8bNodjvtPCZuvs4jzWmSrym2+/jd76Yq11hs /3AtmtpFCwcEdjfmCMq9rppB8ctaljteWOX+HM8= X-Received: by 2002:a05:6000:46:b0:1ed:c11e:6add with SMTP id k6-20020a056000004600b001edc11e6addmr7541874wrx.328.1645824290162; Fri, 25 Feb 2022 13:24:50 -0800 (PST) MIME-Version: 1.0 References: <20220225202614.225197-1-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Fri, 25 Feb 2022 13:24:37 -0800 Message-ID: Subject: Re: [Freedreno] [PATCH 1/3] drm: Extend DEFINE_DRM_GEM_FOPS() for optional fops To: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= Cc: Rob Clark , Tvrtko Ursulin , David Airlie , linux-arm-msm , open list , dri-devel , Thomas Zimmermann , freedreno Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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:36 PM Ville Syrj=C3=A4l=C3=A4 wrote: > > 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 add= s > > 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 =3D {\ > > .owner =3D THIS_MODULE,\ > > .open =3D drm_open,\ > > @@ -338,6 +338,7 @@ struct drm_gem_object { > > .read =3D drm_read,\ > > .llseek =3D noop_llseek,\ > > .mmap =3D 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 =3D { > DRM_GEM_FOPS, > .my_stuff =3D whatever, > }; > Hmm, I like my color of the bikeshed, but I guess it is a matter of opinion= ;-) BR, -R