Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2212970lqp; Sun, 24 Mar 2024 08:08:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOPZfTJGaXduEYMyG6wGpRRIR3F5cDIL5mcR/f/miKywM1wF7VDdyKi/t73xjgJhdnCC5K18R6zTgwukWxKlh27DoK9Z1TN3VcIBViVg== X-Google-Smtp-Source: AGHT+IGsJAJg1R5Gg6lte/L8hLzZ6mF4P/Zo5x0Zj6XpqLo4smYxnSGDQ3Zt6D4LZiEUybedmg+M X-Received: by 2002:a05:6871:b21:b0:229:f6d4:32f5 with SMTP id fq33-20020a0568710b2100b00229f6d432f5mr5390587oab.1.1711292929486; Sun, 24 Mar 2024 08:08:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711292929; cv=pass; d=google.com; s=arc-20160816; b=A6L22am/2avQYjKEp1eT/I6CepvFcT+vGZJNIj5xA107CQuMDuc8qrwqDRsVFqGGeF 4sWW3JpzwBu8QRQuZ5AyHgVdW5zMlB4nptgZOvjLDbNP11aXs/Uv0mTWESx2KziafmHz BeuRz7vkab+4UuztKKCtX9JS75gg6q+2NSUF+WHIkuqjXhdHPb2qwn7aop9a5TiK8usr ozMnc7tQJlwT/zEPsp2xISuf5h/ye8lTgWVGfDKq05+ADNeutUOBA30Al2MwPScWlHVJ EKGyvaRie+rnj1HpVI/jGzy5wrvVPl+L/tNNPfXiO2Z14QhvSuMD7E0Cmmf1jDYofTu4 vUhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=95D47y20IaWcp8TmYPbM8Fl2A9AeKNTkG4IZIMtiMzw=; fh=UJM36JIAu26gxWbSVDC8tDmyOU0RaZzP1LPJTTN5MG4=; b=NavBl6Zu3I+3HrgXI6B1FjUCaRYtRI5L8sk/X+JgSrd66EwbB5fBs1vYbcpAQzpq44 knBM2umfo6DWi4Q5zV71Z+7Duin9s9DHvYy+R7J9GaBHhgMQwYgplgYriFTaGJ81SALH 76ejc66EvtVr3nH8zYcnceLpNu7O8sDCx3hclQosYmxixOsno8PjbQYLDXPR7EK3KPDL dQ/zs6viWheczvY3U/37Gb7UTr+B+h7zfeVFwZvUV75ef2BMQPm+M8j93qcUppWJKrts /XelgomDXVelTNyDCVZVlNYMCdP71llVcKMcUAvc8r5sHjK1Vg8CSIYaFlLunQx+w7Cb InQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=CCaqs4Q0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h17-20020ac87d51000000b0043118a5d8f2si3668236qtb.138.2024.03.24.08.08.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 08:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=CCaqs4Q0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 027331C20A6F for ; Sun, 24 Mar 2024 15:08:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 966901862F; Sun, 24 Mar 2024 15:08:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CCaqs4Q0" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AADB17BC7; Sun, 24 Mar 2024 15:08:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711292923; cv=none; b=qGXsEdQU6nlmHKVnN5X8wSZjlqplxD2FK+vVNVoKAO1m+jJu7T9Y+i0uS8wOkXgvWXcuNqKGTYqd/GphzX9xtIbutiAVd+DnWoiyhagEPIh94l7rbW+tu9vvvMxLUXj+gz8JYrLsl+pO89kwie77OtAswFFtuq4R6TBnINpMY9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711292923; c=relaxed/simple; bh=jbSdBHS0w1eaicjduO3/4ltPjzKnV2+4/Gm18hBir+0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ijRQ4lNHlL173oHqBqQ71u+nL5SGXr/O+duF+MwDOia0Qu6RBmViSJOjmLidbjca2gomZpGR0c7pH1wvZQjAp+aZPP1Tb5IpTyLv9nhCQd5gS514DzTSy+NOvP4XSmL/pUxdEZhN3lsa4TWJEG0EyQ9WBT2c7flkKRhCw9bQrjw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CCaqs4Q0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE7ADC433C7; Sun, 24 Mar 2024 15:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711292923; bh=jbSdBHS0w1eaicjduO3/4ltPjzKnV2+4/Gm18hBir+0=; h=Date:From:To:List-Id:Cc:Subject:In-Reply-To:References:From; b=CCaqs4Q0v54OS/qibjDzeR5rnTLCeMB5BEWL9FOQOm8nUsrsP4agxz9UeijgZT7BG 4MKSbYfhrQ29CGt+4vnpliHU74QTU5qGLG+bJ0dnax0OIzumnGe5d79tXGVUDVMCwA SUnGl4wT7Kx7SgjiwWQGT8hc1XE8NU7wy5/lvXLsYw1SyVT+Lk0Y7KoBDoIr+Sq5kz G3RLG4eMVQAo0e9iXkjKdxwniW2P5X8xhO9Ro3uHGyprv5IKfuJrfyJjlUyZ06toot J/zg4uC6SCjy+mHbaghEESneDQeaLg4J7rdI5mJb4e8SPi2cU5WxgujzdHnBylvUEu 2BTwaVwc1gecg== Date: Sun, 24 Mar 2024 16:08:28 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Christophe JAILLET Cc: Jonathan.Cameron@huawei.com, Laurent.pinchart@ideasonboard.com, airlied@gmail.com, andrzej.hajda@intel.com, arm@kernel.org, arnd@arndb.de, bamv2005@gmail.com, brgl@bgdev.pl, daniel@ffwll.ch, davem@davemloft.net, dianders@chromium.org, dri-devel@lists.freedesktop.org, eajames@linux.ibm.com, gaurav.jain@nxp.com, gregory.clement@bootlin.com, hdegoede@redhat.com, herbert@gondor.apana.org.au, horia.geanta@nxp.com, james.clark@arm.com, james@equiv.tech, jdelvare@suse.com, jernej.skrabec@gmail.com, jonas@kwiboo.se, linus.walleij@linaro.org, linux-crypto@vger.kernel.org, linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux@roeck-us.net, maarten.lankhorst@linux.intel.com, mazziesaccount@gmail.com, mripard@kernel.org, naresh.solanki@9elements.com, neil.armstrong@linaro.org, pankaj.gupta@nxp.com, patrick.rudolph@9elements.com, rfoss@kernel.org, soc@kernel.org, tzimmermann@suse.de Subject: Re: [PATCH v5 08/11] devm-helpers: Add resource managed version of debugfs directory create function Message-ID: <20240324160828.7f873a96@thinkpad> In-Reply-To: <69264f8a-a113-4d49-b8a6-fb9e858584e4@wanadoo.fr> References: <20240323164359.21642-1-kabel@kernel.org> <20240323164359.21642-9-kabel__6885.49310886941$1711212291$gmane$org@kernel.org> <20240323222506.4ffbdd71@thinkpad> <69264f8a-a113-4d49-b8a6-fb9e858584e4@wanadoo.fr> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.39; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, 24 Mar 2024 10:21:28 +0100 Christophe JAILLET wrote: > Le 23/03/2024 =C3=A0 22:25, Marek Beh=C3=BAn a =C3=A9crit=C2=A0: > > On Sat, 23 Mar 2024 22:10:40 +0100 > > Christophe JAILLET wrote: > > =20 >=20 > ... >=20 > >>> static int pvt_ts_dbgfs_create(struct pvt_device *pvt, struct devi= ce *dev) > >>> { > >>> - pvt->dbgfs_dir =3D debugfs_create_dir(dev_name(dev), NULL); > >>> + pvt->dbgfs_dir =3D devm_debugfs_create_dir(dev, dev_name(dev), NULL= ); > >>> + if (IS_ERR(pvt->dbgfs_dir)) > >>> + return PTR_ERR(pvt->dbgfs_dir); =20 > >> > >> Not sure if the test and error handling should be added here. > >> *If I'm correct*, functions related to debugfs already handle this case > >> and just do nothing. And failure in debugfs related code is not > >> considered as something that need to be reported and abort a probe fun= ction. > >> > >> Maybe the same other (already existing) tests in this patch should be > >> removed as well, in a separated patch. =20 > >=20 > > Functions related to debugfs maybe do, but devm_ resource management > > functions may fail to allocate release structure, and those errors need > > to be handled, AFAIK. =20 >=20 > I would say no. > If this memory allocation fails, then debugfs_create_dir() will not be=20 > called, but that's not a really big deal if the driver itself can still=20 > run normally without it. debugfs_create_dir() will always be called. Resource allocation is done afterwards, and if it fails, then the created dir will be removed. But now I don't know what to do, because yes, it seems that the debugfs errors are being ignored at many places... >=20 > Up to you to leave it as-is or remove what I think is a useless error=20 > handling. > At least, maybe it could be said in the commit log, so that maintainers=20 > can comment on it, if they don't spot the error handling you introduce. >=20 > CJ >=20 > >=20 > > Marek > > =20 >=20