Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2082352lqp; Sun, 24 Mar 2024 02:21:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoINo0fIovm0xd2lTgTgw0sC9Gar4Qd9ScU0f/E5PKHl1JGttx9CqnexVL5XKNwV0Nn6aj7nlSCeBa2OLqGFP1Mz89Drt2f/xIQhvPQw== X-Google-Smtp-Source: AGHT+IGBczTu//kky/cyEUmJ6STBdYumbE/ef+y4m6qMeyBkOsMYZTct6vcgSzX6h9+UTwT0aoE6 X-Received: by 2002:a05:622a:4d0:b0:431:2813:8075 with SMTP id q16-20020a05622a04d000b0043128138075mr4762087qtx.66.1711272117097; Sun, 24 Mar 2024 02:21:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711272117; cv=pass; d=google.com; s=arc-20160816; b=wJCcoYkOeA0BolPJDPdIitLAVf129YzDP8ajoH5OOXDKrJss2k+F5qZ8TMIjJf4tUA wxz1/d3+di2Az77hXipbFL1sno75whNgOsbnYftoPVRJM+/eLszDWE5eAosTNRLOvjrT Ta0IwTqKBRQP+pzITL99cuz8WuKPIXScisR50fhjVqLZGk2tio43gBQ3b8yAHqx4BGsM HoUFP4edVGI72KRKLcWlk4RQBPUEGDbPFmLnvAOuEjr23DKl3w3VeEcsO82qOewO5SkC 8EnxW4qPMgZA01hwvsEZpMa6adGQrT4hrlE/8keoFDpTS3l+/z0f53km6MjQUx/0ZH9E 6o0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=URa/scX9JJ6Z40dL8WhIkmALLQ5X37NM9gkybLRw27I=; fh=lX9HE0bAuQzg0I8ZLeN6ZV/5PCUUn0w8vlrrx38NLc8=; b=NTxhpjrP3GEDLMjFOvaCZaa0YYv1suQaWJzjjLVHrDvPQVTTPo1PLrOXkgpBw+jpKs f96R6vAOVOwWX1zXrWBXtRoXD3ycmJnr4BaUS4wJ0sJ3HME1+rFR5Osm4MOAxqK/ErmT 5TpEfn4hO+c/2/XGmb21Ubl6X1+t4dj+tyu7jSBlCPb83YmV1m4Aln1nZqrpl0wcYl3I kSSv36WJN5wopiJFQZcJXLH9LVwDqJEccbbBHm0FG5amCWp6Qu+D+9N70iyjIf08Vkbe OY3qzSP8g8I+bmgpzYmO6O546aHd0noLT32zfzYPizizx7+aj05KVdH7x4uyQbDMz1Ca +Jyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=dyxV2Pmf; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-crypto+bounces-2841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t10-20020a05622a180a00b00431508e27eesi636111qtc.682.2024.03.24.02.21.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 02:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2841-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=pass header.i=@wanadoo.fr header.s=t20230301 header.b=dyxV2Pmf; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-crypto+bounces-2841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr 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 C2FD91C21175 for ; Sun, 24 Mar 2024 09:21:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6AA015E96; Sun, 24 Mar 2024 09:21:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="dyxV2Pmf" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2823C14F64; Sun, 24 Mar 2024 09:21:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711272111; cv=none; b=e0GyjyQ+9rVKXJ5POjr7wP8qoXkr+uxE6oc3YOGnzQ6OcdTxAH1H6p33DAT75KIoANZW7jawEJdUS7DSVg5mI3ZKNIEsojT+LuKMMDOp/+TKpWwC7nMMKwcECbY0wzRQ+KZ0htu2gd9oQbooSeyTkAjSyx9u1Ga2m9BjFM22wYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711272111; c=relaxed/simple; bh=R7Wxt0qKdFSSMJZJybfYiE3c4zjA4PPePd0ymFiZ4ZE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ge6ok1WcbOdFpNCxDTh5ohfFuregRuEU0DLSU7liIMsyK6L42ZJHdxeFTA3sdZTQjypybrR2QIWMsfpXT/IW7zP/uhMIs473op5BHxRwft67xJ66bKZMELw0IuRcL1/RJ7wwVi0SdoioV2C0t7DBb3ihHgRjyFo1VuuMR2lBVQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=dyxV2Pmf; arc=none smtp.client-ip=80.12.242.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.18] ([86.243.17.157]) by smtp.orange.fr with ESMTPA id oK2irMGMsawLVoK2jrwkZQ; Sun, 24 Mar 2024 10:21:38 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1711272099; bh=URa/scX9JJ6Z40dL8WhIkmALLQ5X37NM9gkybLRw27I=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=dyxV2PmfdDK4SdMqDlTsqv99dIOXj8UvQ5ME5HH4EtxbgGSf4TnhnkCGwm4s4G5QI tvGWZ//51EwFtkGLbv4M4Ue9oEAXee1J7uAg46dOYYP8hXPnYViBgLx/RWoxKp7RWz 8LmeYJio7eISxEVIBB9onYHxN7t3orzI8cXYOclXyY4tQeVSH/7zTv+k18w+BziPFG pYK8qLUlBndwVIScyE+yX3yFtc7h0eGM7bhZBZchjrveNwHQ5Zamq5YkTumszsnINk kkjHjc9+pcfIq4OG2Ei6Fsl2EytJV36zDiA9RFlGhioo0yef7vG+RnvUseBasPXaSj bcgE0WjFPp23Q== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 24 Mar 2024 10:21:39 +0100 X-ME-IP: 86.243.17.157 Message-ID: <69264f8a-a113-4d49-b8a6-fb9e858584e4@wanadoo.fr> Date: Sun, 24 Mar 2024 10:21:28 +0100 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 08/11] devm-helpers: Add resource managed version of debugfs directory create function To: =?UTF-8?Q?Marek_Beh=C3=BAn?= 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 References: <20240323164359.21642-1-kabel@kernel.org> <20240323164359.21642-9-kabel__6885.49310886941$1711212291$gmane$org@kernel.org> <20240323222506.4ffbdd71@thinkpad> Content-Language: en-MW From: Christophe JAILLET In-Reply-To: <20240323222506.4ffbdd71@thinkpad> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 23/03/2024 à 22:25, Marek Behún a écrit : > On Sat, 23 Mar 2024 22:10:40 +0100 > Christophe JAILLET wrote: > ... >>> static int pvt_ts_dbgfs_create(struct pvt_device *pvt, struct device *dev) >>> { >>> - pvt->dbgfs_dir = debugfs_create_dir(dev_name(dev), NULL); >>> + pvt->dbgfs_dir = devm_debugfs_create_dir(dev, dev_name(dev), NULL); >>> + if (IS_ERR(pvt->dbgfs_dir)) >>> + return PTR_ERR(pvt->dbgfs_dir); >> >> 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 function. >> >> Maybe the same other (already existing) tests in this patch should be >> removed as well, in a separated patch. > > 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. I would say no. If this memory allocation fails, then debugfs_create_dir() will not be called, but that's not a really big deal if the driver itself can still run normally without it. Up to you to leave it as-is or remove what I think is a useless error handling. At least, maybe it could be said in the commit log, so that maintainers can comment on it, if they don't spot the error handling you introduce. CJ > > Marek >