From patchwork Fri Mar 10 22:41:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 67830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp9824wrd; Fri, 10 Mar 2023 14:55:09 -0800 (PST) X-Google-Smtp-Source: AK7set9H3sB+5b0lXJoYRMsFY5pSbDlKV7qUtpC0+v2tTwT73runTVRUzP3sGiwJeIQEvDQYHMhG X-Received: by 2002:aa7:9f1a:0:b0:5df:5310:e2f9 with SMTP id g26-20020aa79f1a000000b005df5310e2f9mr19427248pfr.22.1678488909195; Fri, 10 Mar 2023 14:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678488909; cv=none; d=google.com; s=arc-20160816; b=O/LzGglKDysw1Pb1suXCTEtTbNykybLwmsaYE08y8YCBNRQUn+33bIRzxzleOr4R7q XqvVlG2+qABmTpxRnX0sBDNpu3kMZr3CZNxeF5iwZOFZnXf12PsmO9jBfgcK7DIntQWU cH5iFqa7XsohYTyWBjsujbFtPdk94dV7TVdrCvtRKcGSMglP2gQvQTuJkJwStdwKDxat VUTWwy3VlXWcUoxvSWg9gAYCtQhn0cC2wHj7aE+vP/Xm+HWsb8vDahkPVGIJNTRjVVk7 0ZFtpxtGzRFoSEzuhNdssYkI30ZO0PCMORrQAf/hb1QVqttgj0VkC/P7f8qXtv5hQcQC ZSwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=t4g1dpVL9vi0BNj7nx3GV3SsGWfOjKNdVEIPkd5/jLE=; b=dJzB3ZCgo66/AgzygRVr9T7QswZeW2/osFG9sU/r0b7eK7QVxKFGcYJ0S9677HUWao H2eARLOlwqiK9r43gRZnKX+s1eZ5eHN2ZtJthdEvZUYgV+BxphTx83sQGwoD5Q70Zuhe DrI4jB2yAVkykHKZyyGVezqW4nPvLzlH60I1kfMPgh31XQpJgUDFApZBYUgnEBvyU5bk 3tl2Kr0Pd8wXgZkEStCEiihGETVlqfS6eCqZ22V/NnG+TBb65DKlMvVayIAC3Abm2uet zzChKuZCdYrJeg5Vmr4JAZ3Mnc41B4af8hx7rwchvXXZqFh5x63m381vqrJ2jI0OIheP tCNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a630309000000b005030925d31asi872464pgd.203.2023.03.10.14.54.55; Fri, 10 Mar 2023 14:55:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbjCJWmm (ORCPT + 99 others); Fri, 10 Mar 2023 17:42:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231887AbjCJWmI (ORCPT ); Fri, 10 Mar 2023 17:42:08 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49D6814FE04 for ; Fri, 10 Mar 2023 14:41:44 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQg-0002dC-Cg; Fri, 10 Mar 2023 23:41:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQe-003GqP-UJ; Fri, 10 Mar 2023 23:41:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQe-003uEb-A7; Fri, 10 Mar 2023 23:41:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stuart Yoder , Laurentiu Tudor Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition Date: Fri, 10 Mar 2023 23:41:25 +0100 Message-Id: <20230310224128.2638078-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1280; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Us0uaGo+ZVeSCyVAMYktRapjadAzUAbMySr9dkZDyhY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7IIiLBXyBkvldrNjLxXSuVihB+XZFHPrH9iZ bSlYnYChKKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyCAAKCRDB/BR4rcrs CUUWB/9/k9C4veBM5Ob0UtSIRQ0RivJZb9RntiAY5ubwFG0IuOjbbv7HTRcqEAHgS4cjiroDepr fSyQLcyu3ha75lLy3dvgFC61wso4UbZpTyPFO1GGUsmHihdhRP+nwnb14lQe40QPUX23fKiYKgZ 7QRGp3c+Vvlufr+G43AloQzBpDYgzqCyLH+KpXW9Wq2psPWujyDhQiFPTjci8dNQJnY/isPi6IP gsYRdbtoiB922C7ibOW7Zbu7jIjPxlTZHSlyrrrapXtN4jilw43+naa4rnKUgI9ql/lhClvqnzo LeD899Bgjn62Eyk5CVpT45EyFpAWkwkzDITW1VPBtDSVa/pU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760023186236187026?= X-GMAIL-MSGID: =?utf-8?q?1760023186236187026?= If fsl_mc_is_allocatable(mc_dev) evaluates to false, the driver won't have bound to that device and then fsl_mc_allocator_remove() is never called for that device. fsl_mc_allocator_remove() is the only caller of fsl_mc_resource_pool_remove_device(), so the same check can be removed from there. Signed-off-by: Uwe Kleine-König --- drivers/bus/fsl-mc/fsl-mc-allocator.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c index dced427ca8ba..e60faf8edaa1 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -103,9 +103,6 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device struct fsl_mc_resource *resource; int error = -EINVAL; - if (!fsl_mc_is_allocatable(mc_dev)) - goto out; - resource = mc_dev->resource; if (!resource || resource->data != mc_dev) goto out; @@ -613,9 +610,6 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev) { int error; - if (!fsl_mc_is_allocatable(mc_dev)) - return -EINVAL; - if (mc_dev->resource) { error = fsl_mc_resource_pool_remove_device(mc_dev); if (error < 0)