From patchwork Tue Jun 6 13:26:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13269224 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 E5F27C77B73 for ; Tue, 6 Jun 2023 13:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:Subject:References:Cc: To:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jKuq74hUwaqF9XmZdMAGtQvsM9qgAMJ+Z8fJ6uw1Xfg=; b=rKD2ytxwq++YW5 IMJ7aa7ojJ6D1GZpQqfoFxPp89fpXCNrqfKaq+ng42c6AwtPzbqfbv6fQGacdc/kMQsKDLj+2LjfI S5GdZNZI4t5gvuri1bwIBBq8wrWLicWP4oimlGVul3CX4gMHBUyvf1zvA+iTq3Wfe6Nm67jKX+p0c wJhS6ddlU4RYjQTxVDs9K+j6bNNf4XRTF0Kf5lCGTvm0Bb3hHICnnveoJVuIv0Pl5jyBCBKlfCNQc TBtDS8/fEB+mT2sXqv7LfgLcA+ZVPelyVbmI/2gk53D+7MdHx98s3sRn3ItTRY/uw5hid3vcsYd3Y rf3EUEeOqe3naNFFuHZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6WiA-001qS1-33; Tue, 06 Jun 2023 13:26:58 +0000 Received: from mout.web.de ([212.227.15.3]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6Wi8-001qOG-00 for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 13:26:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1686057993; x=1686662793; i=markus.elfring@web.de; bh=YnMiHiuM0cpuvosezDCMkw/pMyPyl/jPac6uo7C6V7s=; h=X-UI-Sender-Class:Date:To:Cc:References:Subject:From:In-Reply-To; b=YbSLAnpTx0O9YH1sJZw5j45iDnR1BJtdtnC+SK5785ILqpuzV6lqX8NLAgLa7IxJTdqjShL 8u14BWK/lSJ2gpZmhHEcozt0M6nO5KQeUqtOZ53R1JyF36OamkQe1HU22v2J4CEBI0zCGL1IB dTvtmGMh7VlSmaziWN0o+NTAEHvBzdV14o4jow4RPJntmu/A/MQ42SqCrnHjraPL9vqZukrsN ydsfd4THBqbFpb0ac/0d7ZZLGgXsVY6zKBIlsaC4S5ruNdQ4BeS0uRoJbgdjiJY+ZDejO10P/ XpJkrjUHXkRcc/koqDWaMrQ3Yzw55r68cZ5F11Zyaa+N7sxkB7Lg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.83]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MXoYS-1pYS052Hoi-00Yb8v; Tue, 06 Jun 2023 15:26:33 +0200 Message-ID: <9ace5c4c-5e17-4207-5a02-6a47ba0aee22@web.de> Date: Tue, 6 Jun 2023 15:26:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 To: kernel-janitors@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andy Shevchenko , Dvorkin Dmitry , Linus Walleij , Wells Lu Cc: LKML , cocci@inria.fr, Wells Lu References: <1685277277-12209-1-git-send-email-wellslutw@gmail.com> Subject: [PATCH] pinctrl: sunplus: Delete an unnecessary check before kfree() in sppctl_dt_node_to_map() Content-Language: en-GB From: Markus Elfring In-Reply-To: <1685277277-12209-1-git-send-email-wellslutw@gmail.com> X-Provags-ID: V03:K1:IfThuN+vRUDXXIjYaUwraSDOMlugaMM9dgnxVhVQ4Bt1v8AFX/6 vCtjuM80AsY33lGUh0y0wwBCll51YgTScSo74bne0YsEw7C99l1+kSI7tnSm2vxG00P6eX9 RMcIBDFwwBo3oqzX1cjjPq8esJxt/FfmlUYJnGubAxw923FHxsBu6fwb7sCbVd10nJ0K02m AOtRYEc+HhVjHGMdsQTtw== UI-OutboundReport: notjunk:1;M01:P0:DA2RpCt+4Ds=;0v3gzyL5WIz+9SPC7H8qjXGluhg PGNpUiGXfF7LhdFVubJtx7p8Pq0iUl8MF7rRXhA4ZDniswpPwBN081j82caOJFZEFouCVtrfG tDfNpTQGKi+R0PBT4m20DNaMlsDxRaquRufLbIPM2zugmGjSzFH+h0ZABXduKeXngekT6CiZE qHBxiSHBWQr5nWAxiouubaS1VJFSkBRFJVTfeghGNagPh9yPexrGdX2zRoQ04p7ysUxWvnMn2 Q+5zf+nDz3QuJka2LyqSDrel0k0JR/np3kFZFfoK6MCAUB6TkPtcTEDHghLfRgF+ih8XQn4uK V2bB0elj2wyk/LmCGu5YEmtgJcLmiatlTVkfFm9PQ6gvQdVQ3PM/ZbJ4nTeDBxiReuOO6Y0MD I4zuxWwR6Sw7pKMY0cG0gZ3rOJz8qlarr3pTaC3X5h4MY25M8j/XQwKZ7r/fu5QmmaYBdWmMh lytqoblKdq5eKi30p8NrlrhFHq6sElK3OPZQM3VnKPn6CC2aQPzIhA2RyMRNY4q5VXvZn2mn2 GMMsbBDkugON5Ai4DrgJWcN/KrRjN8DLJvXZxXm36g4VT6Qvh6VNuA8HVRll00M+8wGY9B0Fz zY7l2lIXyr3YntYPScU2+Yxv5xUAX/rXvjOYG7KyUcNXn9oSImmzCAsAcc7P1h9flVIJbLDK0 LEWeO3m3E9xVIik/OuXgzc9Lhc59nKaCW8xahHJPsnxDLcAnLiDt/Bhi7atzTwDdviV0NcTTx eLt/HsSIT8J/8YwuYBd1LtxQEVWkiR0h/A8TL8byignlR4u3ZPn8f/S+YhGbbOpzL9AOukuDV PRWHwhnRTHTnIDbnFGMRrXl7YII2bEvhOYgtkrfCRgId76kEccSY1IssOkMA4O7/8yH2Nkuhm ETv85WFBxZs+3gVAUVNTxCggeZPUD8IzxNtHojDAit8/sHuyAgt26lrPIa5zSHQ3KC3l2eFeQ WHSj3Q== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_062656_497258_30D0F007 X-CRM114-Status: GOOD ( 10.48 ) 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 From: Markus Elfring Date: Tue, 6 Jun 2023 15:00:18 +0200 It can be known that the function “kfree” performs a null pointer check for its input parameter. It is therefore not needed to repeat such a check before its call. Thus remove a redundant pointer check. Signed-off-by: Markus Elfring Reviewed-by: Andy Shevchenko --- drivers/pinctrl/sunplus/sppctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.40.1 diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c index e91ce5b5d559..150996949ede 100644 --- a/drivers/pinctrl/sunplus/sppctl.c +++ b/drivers/pinctrl/sunplus/sppctl.c @@ -971,8 +971,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node sppctl_map_err: for (i = 0; i < (*num_maps); i++) - if (((*map)[i].type == PIN_MAP_TYPE_CONFIGS_PIN) && - (*map)[i].data.configs.configs) + if ((*map)[i].type == PIN_MAP_TYPE_CONFIGS_PIN) kfree((*map)[i].data.configs.configs); kfree(*map); of_node_put(parent);