Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2357957rdb; Thu, 21 Sep 2023 16:56:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+k2guzKDQZzBkOdfNo7y199BhrFkUYUTBkGCPrq2V/lYxz+CblED4TLkjEAQibn6ii/iL X-Received: by 2002:a05:6a00:1c91:b0:691:21:d9b7 with SMTP id y17-20020a056a001c9100b006910021d9b7mr3965599pfw.27.1695340600819; Thu, 21 Sep 2023 16:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695340600; cv=none; d=google.com; s=arc-20160816; b=gzH3bDpluRVSEKxXS/Wtvf8S/k1mJYw6dd/AO7KVv6S91+R29CFCaPCJEcxXa9nZ2w IZDU17+S+4iJee5GsnFaaA54v6EjlEqvfF1nouaUGcIEjtTRA25EtFQx1F8yke5KRRwn bXEJub9IWNQIu7T8En0a1I8By1o5OHZuwBHgwwIbWjw4vtCuJHGXKFF0vilfusWS0ZPW zY5wfrtkSFYO1+F6cSumxn5yQ+hY78JVwCMMEHBVJehVpSneQTDTwnqVWgdVa7SiGP5K OeOMBkHUiGqKaMkxXlVXSAxH8KJQw1Fm/zfoYsEBA+JxRWDV3kClG9NtlVdbRWQCk3+m IERw== 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=d1dkp/RWZ/a2I7bo3Xe5PgcGKGeD4WwTxF3dP+U03uM=; fh=imUN2S227kXgsP+LoWtV3Urq5eXMDFAvxlbrkqI36eg=; b=Mm0gB83y2Ph/wY1WuI0s6ti2sJ4j3Qk8j0jBTPRlXqtLO9bJ0Jw3YnuvjSleEsvTwa 82Cj/UdehkqNzcx8Vthcw/8N0I/DjoBg9+Cz+MJj5SgKvNaAfX7tTfD7XraJ8fbvKmeU 2v4DL8PvlAXlI4k13I731H3OH2si6KB+PnSftF7Lz1V8TMbbuRIfu7D/jetEuScIMTmK IU7QY8Th2yGjg9OLwh2yplmykuMvOzflJU5JlH0Mnd8+iQRiU/8CxeqxfoifD2FQK/ov ntzn+oBkDOTbCiaafiwPMIqsJI2UP1co1nmSwnRgmWvbAMrUQ20GN2xNL6aun221RN6N +bqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ku9ihcIr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s20-20020a656454000000b005783367f97fsi2486846pgv.342.2023.09.21.16.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 16:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ku9ihcIr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A968C81049A9; Thu, 21 Sep 2023 16:20:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjIUXU2 (ORCPT + 99 others); Thu, 21 Sep 2023 19:20:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjIUXUU (ORCPT ); Thu, 21 Sep 2023 19:20:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7027DA9F2 for ; Thu, 21 Sep 2023 10:07:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0D01C116D5; Thu, 21 Sep 2023 08:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695286301; bh=2+pljEhHPpECFX9HUqc8WA+cUF3GqSlRSTmRXo3wy7s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ku9ihcIro8BAf5sXD67a08F3/JbSI7c2WN3oWjCrlKwlyQrIrN7X+0mQowomnJK77 y+ORdVvSdyiF/rZdGqptp5h3GctvB2DbzyrxUKH6e7ViW/k5UfWmic95Sbpfnl7ti7 h+HTvRoE7eqFVT/RNtQZyaRdDbp4od+13Oh2sn2cVRMKkkxwqaosK7BIskQr6+LXf5 OI+AdhhQzO6TqxRqMD6P1WPU3+YkoSGiwUByCp1ASV+rpaxtccu5hqdMQnqongCEf/ Kh1x0YQMZkbeWAM4u06UwiknxqEvlcF5OipzQZeI+y93rNmih4zPl0NfO1d1SaJl+8 kCpaAQk+RC3MA== Date: Thu, 21 Sep 2023 10:51:38 +0200 From: Maxime Ripard To: Geert Uytterhoeven Cc: Javier Martinez Canillas , Thomas Zimmermann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/ssd130x: Drop _helper prefix from struct drm_*_helper_funcs callbacks Message-ID: References: <20230914195138.1518065-1-javierm@redhat.com> <87wmwo3q50.fsf@minerva.mail-host-address-is-not-set> <552hpgr7qzbjxuyei3n5m7rsn7ekwbdgzv25oe5vy6qb35gf23@q4etussk5jwl> <2p53aei56tlr7k6w5oawlwpmv2k7agpbb6wfwpxcg3rqyueyrx@2as7tijrgnh4> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xausph7vkn4i5qzv" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 16:20:46 -0700 (PDT) --xausph7vkn4i5qzv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 21, 2023 at 10:46:05AM +0200, Geert Uytterhoeven wrote: > On Thu, Sep 21, 2023 at 10:12=E2=80=AFAM Maxime Ripard wrote: > > On Thu, Sep 21, 2023 at 09:57:22AM +0200, Geert Uytterhoeven wrote: > > > On Thu, Sep 21, 2023 at 9:44=E2=80=AFAM Maxime Ripard wrote: > > > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas = wrote: > > > > > Thomas Zimmermann writes: > > > > > > Am 14.09.23 um 21:51 schrieb Javier Martinez Canillas: > > > > > >> The driver uses a naming convention where functions for struct= drm_*_funcs > > > > > >> callbacks are named ssd130x_$object_$operation, while the call= backs for > > > > > >> struct drm_*_helper_funcs are named ssd130x_$object_helper_$op= eration. > > > > > >> > > > > > >> The idea is that this helper_ prefix in the function names den= ote that are > > > > > >> for struct drm_*_helper_funcs callbacks. This convention was c= opied from > > > > > >> other drivers, when ssd130x was written but Maxime pointed out= that is the > > > > > >> exception rather than the norm. > > > > > > > > > > > > I guess you found this in my code. I want to point out that I u= se the > > > > > > _helper infix to signal that these are callback for > > > > > > drm_primary_plane_helper_funcs and *not* drm_primary_plane_func= s. The > > > > > > naming is intentional. > > > > > > > > > > Yes, that's what tried to say in the commit message and indeed I = got the > > > > > convention from drivers in drivers/gpu/drm/tiny. In fact I believ= e these > > > > > function names are since first iteration of the driver, when was = meant to > > > > > be a tiny driver. > > > > > > > > > > According to Maxime it's the exception rather than the rule and s= uggested > > > > > to change it, I don't really have a strong opinion on either nami= ng TBH. > > > > > > > > Maybe that's just me, but the helper in the name indeed throws me o= ff. In my > > > > mind, it's supposed to be used only for helpers, not functions impl= ementing the > > > > helpers hooks. > > > > > > With several callbacks using the same (field) name, it is very helpful > > > to name the actual implementation by combining the struct type name > > > and the field name. > > > > I can't think of any (at least for a given object). Which one do you ha= ve in > > mind? >=20 > E.g. atomic_check(): >=20 > drm_crtc_helper_funcs.atomic_check() > drm_encoder_helper_funcs.atomic_check() > drm_connector_helper_funcs.atomic_check() > drm_plane_helper_funcs.atomic_check() Right, but that's between objects, not between drm_$OBJECT_funcs and drm_$OBJECT_helper_funcs. So conflicts for a single given driver is unlikel= y, and can be solved by using, say, $DRIVER_crtc_atomic_check and $DRIVER_plane_atomic_check. > Interestingly, drm_mode_config_helper_funcs does not have an > atomic_check() callback, but drm_mode_config_funcs has. >=20 > > > Anything else confuses the casual reader. Perhaps the real question i= s whether > > > the structures should have "helper" in their name in the first place? > > > > Those structures are meant for functions used by the helpers, they are = not > > helper functions. >=20 > That might be how they started, but to me it looks like all these helpers > are no longer helpers, but part of the core... They are part of the core, but very much optional still. i915 doesn't use a= lot of helpers, vc4 (used to?) rolls its own atomic_commit implementation, etc.= It's really not uncommon. Maxime --xausph7vkn4i5qzv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZQwEGgAKCRDj7w1vZxhR xYz7AQCBEp34X1kCaihJf5Lq28yeEGdWAmNA3zyOuq9raBubOQEA04SOQI8XPbCN 6cD8oulAR+yTmqwrZazae7cFizHObQw= =kv2D -----END PGP SIGNATURE----- --xausph7vkn4i5qzv--