Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp527823pxm; Wed, 23 Feb 2022 05:45:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjY1yRFUfQQr2U/r/swqHAVin0wcB6VS8Yl4BE8pZZRKLKWMFcuu//vbmPhI5i5OKll03/ X-Received: by 2002:a17:90a:800c:b0:1bc:6faa:623f with SMTP id b12-20020a17090a800c00b001bc6faa623fmr8738674pjn.76.1645623957420; Wed, 23 Feb 2022 05:45:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645623957; cv=none; d=google.com; s=arc-20160816; b=TlaYm9ytVUJE75HOiUy+EAnHZr5CwykpJWn4uHfFPA1GE9l5XMviDHLU6tGpEhBLW+ D75entAvM6OYabzKkaixlt9Y5NtDTaKF9J5LDyiz+Vpu66JhS+BUZSfnLyHJAvjNr4zM qn9AK0O0lwR5gFcwZVlYMSp9bxyinCOhrcjDYBu7OFljuZ3HNLt/P78sM2AU82ImS87k q19el12Jq+gIVdU9IVUeXj3Gno1+n4Xj95I5OgKBAoQ3QlrBrhYmoZLybmgfJ+/K2bEv sKBtR11MRfl1Kw3YncEPTExlHJ1RPmmflJ6i7cb8FFbCKVLWgi+zD5Zaz/djmXdNXIUP s3Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X0F77fbIU1LkyDEiRwNiDPK4+9RtifiKKhYt8ZyZykg=; b=U33GBDYsU1mkhFIpItB/gximpBhh7tmYgxgSsAcz3diyO8XoRvpjUaeTX9dZGP29qH rOND7B/2JnfSCKeTA+AgE8GHHLzP7fLc+TVYyba80Zdt9twPMxGPdwCGlF1fiYAzTbM3 fledhrCyIoPCfW1ghje2OqfuB8e6K3Naq8Ga0PMO5LL2tQJxuqN8ZmlmI3WIHzub+l4E kFIgiWnqYhWM2NZndnAtjeTKc09H10x/CGDmcJy2dSu8pjA/bYK41KszQU6yrC2Snk2d 24tTwT2zN57+4GP73/hLoLfqxARvInK8XYSQFoT9bOjb7dAuC66FC6FpI2ghi5CBm6BC L8QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OtP7IFPi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7si40851887plh.398.2022.02.23.05.45.40; Wed, 23 Feb 2022 05:45:57 -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=@chromium.org header.s=google header.b=OtP7IFPi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236388AbiBVXsT (ORCPT + 99 others); Tue, 22 Feb 2022 18:48:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236335AbiBVXsJ (ORCPT ); Tue, 22 Feb 2022 18:48:09 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B8D4C434 for ; Tue, 22 Feb 2022 15:47:42 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id p15so47586693ejc.7 for ; Tue, 22 Feb 2022 15:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X0F77fbIU1LkyDEiRwNiDPK4+9RtifiKKhYt8ZyZykg=; b=OtP7IFPifLHaL18s430w4QMwCl8fqgUQZF6vITBFV0Y2ISfFMWayXI1UbC79Swbr2q Y9zB2Loo9QWTHv3XZEzrZbb6fTeRpW+NDy5LYOzubMU09FjBJzlWv470tLJLosmvvlH8 oaWdtvbT3xjZun9F1YAretW7g5VOMCyfIEbF8= 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; bh=X0F77fbIU1LkyDEiRwNiDPK4+9RtifiKKhYt8ZyZykg=; b=07DWLx9FN+XZ0Z9dP95zRWnjWUbeKIOcfixC0QC2+Q9FDDmKZNCNoMxi/Md71+x4mF 2t5vINhHIhGxjwicx8l1r04bTW4KYeRDLoruXmoIL/kcmZKIgWNeLaBZCPfWBtavVIpB 7SkKents+tqH2YwJ1Kx718t/T5Ga/nwOZaEO+8w6VS/tVtXm7ykrUXrgXdrlhFRcM6yK qWau78osD42c/GdLzfHwl7z8P63wjGNfrrU8dBw08lYimdHJrDT4MPJmxKSA/Ja4WuaF uUpRIt7ub1ShIeNXkqIEtMuOM4yuF0tY5SACi8MM01cuTcv9gJGZsY26LzNdulUKsj6h NkiA== X-Gm-Message-State: AOAM533Fi/jS8UsdDrjCnYCXrhK43q1dtg2OMC0KrC+fb/jor2+BCq5d 7Yqv2t+etI/nVDzSDwp5nJPMQIY6u2xCaVCU6I8= X-Received: by 2002:a17:906:2608:b0:6ce:60fa:12ad with SMTP id h8-20020a170906260800b006ce60fa12admr21651076ejc.231.1645573661182; Tue, 22 Feb 2022 15:47:41 -0800 (PST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com. [209.85.221.44]) by smtp.gmail.com with ESMTPSA id ek21sm10044025edb.27.2022.02.22.15.47.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Feb 2022 15:47:40 -0800 (PST) Received: by mail-wr1-f44.google.com with SMTP id d3so20798480wrf.1 for ; Tue, 22 Feb 2022 15:47:39 -0800 (PST) X-Received: by 2002:a5d:64ea:0:b0:1ea:8148:6b97 with SMTP id g10-20020a5d64ea000000b001ea81486b97mr4917201wri.679.1645573659282; Tue, 22 Feb 2022 15:47:39 -0800 (PST) MIME-Version: 1.0 References: <20220205001342.3155839-1-dianders@chromium.org> <20220204161245.v2.2.Ib0bd5346135cbb0b63006b69b61d4c8af6484740@changeid> <5d60473d-be8f-e2dc-2ce9-bc0b9056e4b4@redhat.com> <87ee435fjs.fsf@intel.com> In-Reply-To: From: Doug Anderson Date: Tue, 22 Feb 2022 15:47:26 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/3] drm: Plumb debugfs_init through to panels To: Javier Martinez Canillas Cc: Jani Nikula , Andrzej Hajda , Neil Armstrong , David Airlie , Robert Foss , dri-devel , Jonas Karlman , LKML , Jernej Skrabec , Thierry Reding , Laurent Pinchart , Thomas Zimmermann , lschyi@chromium.org, Sam Ravnborg , jjsu@chromium.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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, On Wed, Feb 16, 2022 at 1:36 AM Javier Martinez Canillas wrote: > > On 2/16/22 10:25, Jani Nikula wrote: > > [snip] > > >> > >> I actually wrote said follow-up patches and they were ready to go, but > >> when I was trying to come up with the right "Fixes" tag I found commit > >> b792e64021ec ("drm: no need to check return value of debugfs_create > >> functions"). So what's being requested is nearly the opposite of what > >> Greg did there. > >> > >> I thought about perhaps only checking for directories but even that > >> type of check was removed by Greg's patch. Further checking shows that > >> start_creating() actually has: > >> > >> if (IS_ERR(parent)) > >> return parent; > >> > >> ...so I guess that explains why it's fine to skip the check even for parents? > >> > >> Sure enough I confirmed that if I pass `ERR_PTR(-EINVAL)` as the root > >> for `panel->funcs->debugfs_init()` that nothing bad seems to happen... > > > > Yeah, the idea is that you don't need to check for debugfs function > > return values and you can safely pass error pointers to debugfs > > functions. The worst that can happen is you don't get the debugfs, but > > hey, it's debugfs so you shouldn't fail anything else because of that > > anyway. > > > > Thanks a lot Doug and Jani for the explanations. That makes sense and it > explains why most code I looked was not checking for the return value. > > I guess we should write something about this in the debugfs functions > kernel doc so it's mentioned explicitly and people don't have to guess. For anyone interested, I've taken Javier's suggestion and tried to update the docs: https://lore.kernel.org/r/20220222154555.1.I26d364db7a007f8995e8f0dac978673bc8e9f5e2@changeid