From patchwork Wed Jul 31 20:13:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13749164 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 D66ACC3DA64 for ; Wed, 31 Jul 2024 20:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=OufMybdXky8SUvvziR3CTSkxwDMy1xPFtKYMRxlkO/4=; b=SvQFJOLP2v/AWqKRLXIVASw+8b TSESKLCeKENN3rK+zCO5ydhbd2XQlnUQCyx/BIuL8C3j38rgaoUlZkGcivvhOBFylK/xL544MXc4u ijCgtx7M/hg0Y7KQgV2lz0Z89xpPHEZ33KaRWEl1vG078ZxcDEVlDmuYt9mvh3gsHck/UyNUyvViI N4USWiEQYfq9+fejjtWI2W3ehUHSPCz67TGyokuuRJ0EdyXF/tUOKsHV3x0heXxGr4oT7/Cqhjuf/ oUhwLA56/+Dv+ZXoxRpj3WQeuvXtz/qhkb1vddrgkkCuQF3PN4H6l7vAThfqFIglOZs4hJ1BSeSNu t/JoZwTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZFjS-00000002Q2w-0741; Wed, 31 Jul 2024 20:15:34 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZFiY-00000002Pl5-3DnW for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 20:14:40 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 01EACCE1814; Wed, 31 Jul 2024 20:14:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25C98C116B1; Wed, 31 Jul 2024 20:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722456876; bh=M+Tz5VtrPahR60wYhrP5uNuiYTcPNjq7pq/plSzVD90=; h=From:To:Cc:Subject:Date:From; b=miCcdDS+MKXAlrHucvcdqOzeA/zUrzm7selWNUVeog/0tD3UNsiEuOC81ibfI3pT7 NkfzgwoSXmUYKvf66I+xTAftazsfyas0/cahZlSHst3eRdDOcA9AiCIAwQxf75AhSm HGkadHxiQtNe3mMuoq5WL5oADQ6yAamvlvS4ing1J+wM6okimEX6wrdsdF7uvjWFu4 XLZQ8I9SZ/xBdyicMqgpoN+Gy5xQo+oUncv1+uUn2pjRxWOWze1wZ7fZuWbz5qArmG pz1WXYGBMS16BqcDdKmunIbQNpjd4i1q8o3uYEx/rv0LM3yp1qSCWzK4K3uSOct564 UPWzCvkhRww0g== From: "Rob Herring (Arm)" To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] soc: ti: knav: Drop unnecessary check for property presence Date: Wed, 31 Jul 2024 14:13:57 -0600 Message-ID: <20240731201407.1838385-2-robh@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_131438_999988_6664D565 X-CRM114-Status: UNSURE ( 8.69 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org of_property_read_u32() returns -EINVAL if a property is not present, so the preceeding check for presence with of_get_property() can be dropped. This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT struct property and data pointers which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) --- drivers/soc/ti/knav_qmss_queue.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index f2055a76f84c..a15eaa1900ab 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1104,11 +1104,6 @@ static int knav_queue_setup_regions(struct knav_device *kdev, continue; } - if (!of_get_property(child, "link-index", NULL)) { - dev_err(dev, "No link info for %s\n", region->name); - devm_kfree(dev, region); - continue; - } ret = of_property_read_u32(child, "link-index", ®ion->link_index); if (ret) {