From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07D0DC2BD09 for ; Sat, 6 Jul 2024 10:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2OStuHDQZkFxG2N/2ZtYtwo2uVC+FboHO/7oRsKz/J8=; b=QABkxnG09vBFG7 d4EY8hohtwSBSJf59JH9ga883dtdKcmOSqnq9Q36YBq6y0KLW4LgjEo0tMU8BUYSUqSO6W1IVU6m1 7DXpRIMMt6t+kzIt2nQxs0bo0/iKEcl1LtBV+nvXxmyUqvc+5YZdxfshN+GXgJgH+Ywn9FeiPDAO/ z6zXUMGKPkeEzw4rkouvirf8qJ9rZvrbKcxIh/IGAhsVhhU4+W9kayWpuBwPwzGvKleFUmLRUrRz/ /Rm1oB7FwEOM/f+vebinBAoLB1xYsjsAAvXHOtS6cBaExTNcEJ8QwY/J3hOrWFsKSQqGP45Uc//id Fr2yejsmq4dYNlXP+DtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ32G-000000005aB-1M8x; Sat, 06 Jul 2024 10:52:56 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ321-000000005Wm-0FEz for linux-arm-kernel@lists.infradead.org; Sat, 06 Jul 2024 10:52:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 0F541CE1AFE; Sat, 6 Jul 2024 10:52:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0194C2BD10; Sat, 6 Jul 2024 10:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720263158; bh=efIB17EZMlXMPPwEmi+fVqnF5tydmg78Dy0ZZdC6FRc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lpmb7dnNDG0IOB+Ry63fTHcdB9r9VE0uVvVgccZXfJjQ9fu5fx/2xTAMO5LDsVa5c Nx37Xp0PDbkazb7hzPZLKWVf/FYBbHYzbaIJcSe84l2jBLudA6+Lp9rOKZR1TSTsFL oF9B4yNO/x0hpgFodxcHhJepSRG3en9gCZ+wPcVjIGOP5bHi6fPf4oZLMno9AchxZq s6BaST1EeN1ko7gyPzZtaKRKUn4CNfPnOX2Ex0G8iklvOp+V4czRlckEkwySaNroSk RNMHKeuP84pS3waujmzxn3wy0KEr1ShwE75D7Tvq2FUoB5N2Os+Wdid4moQiv/SBry b7OAIz1WD4p0g== Date: Sat, 6 Jul 2024 11:52:29 +0100 From: Jonathan Cameron To: Krzysztof Kozlowski Subject: Re: [PATCH 6/6] iio: adc: ad5755: drop redundant devm_kfree() Message-ID: <20240706115229.47b8d7fa@jic23-huawei> In-Reply-To: <20240705-cleanup-h-iio-v1-6-77114c7e84c5@linaro.org> References: <20240705-cleanup-h-iio-v1-0-77114c7e84c5@linaro.org> <20240705-cleanup-h-iio-v1-6-77114c7e84c5@linaro.org> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240706_035241_321249_01DBEBEC X-CRM114-Status: GOOD ( 16.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Dan Robertson , Michael Hennerich , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , Oleksij Rempel , Lars-Peter Clausen , kernel@pengutronix.de, Sean Nyekjaer , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 05 Jul 2024 12:40:49 +0200 Krzysztof Kozlowski wrote: > The driver calls ad5755_parse_fw() only from probe() function, so > devm_kfree() during error path is not necessary and only makes code > weirder. > > Signed-off-by: Krzysztof Kozlowski The path this is in doesn't result in the driver failing to probe as it falls back to a const default structure. So whilst it's not a 'bug' to remove this free, we are removing data the driver is not going to use - so to my eye at least this is a deliberate design decision. Mind you it's not a particularly big allocation so maybe worth not cleaning up until driver remove in order to save on complexity. Sean, your code I think. Do you care either way? Jonathan > --- > drivers/iio/dac/ad5755.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c > index 0b24cb19ac9d..bfbfc3c1b6a5 100644 > --- a/drivers/iio/dac/ad5755.c > +++ b/drivers/iio/dac/ad5755.c > @@ -803,7 +803,6 @@ static struct ad5755_platform_data *ad5755_parse_fw(struct device *dev) > > error_out: > fwnode_handle_put(pp); > - devm_kfree(dev, pdata); > return NULL; > } > >