Message ID | 20231103230001.3652259-3-u.kleine-koenig@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1356797vqu; Fri, 3 Nov 2023 16:01:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGw3lucSRvF7TDlJ5jynERdk82Q1caUBTEUiwC+cdgAMzFuULH+URwi5nAUDj61dzlz6Hml X-Received: by 2002:a05:6870:aa8c:b0:1a6:a547:ffe1 with SMTP id gr12-20020a056870aa8c00b001a6a547ffe1mr30625852oab.21.1699052496146; Fri, 03 Nov 2023 16:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699052496; cv=none; d=google.com; s=arc-20160816; b=RiZaErn/zMwHulf7IhtKQB4gldgn0uv2QedOgV1GDEajm4sepe897Da2uxYG+6KQc3 lBMj+/ECPd3xFqix2Rv0ZDvePC853vGtrN2q6gK2lfiyOGeMlXJluZ7SiAW5TtmP1ECb ZkXjigZMHivyaB9OyCs7jevAVXikdgUMt4KtIi1nKh4TE7pnZNWxUuUtNGg6j3MLVm84 WWzln4Ndh1vGelqlqQ+vnzoP2C0HTtdbyUUF6VrrdTcho6W4TxHFQweE7haFlyFqb5mm L4F9Pc8lZeYy5cbrw959hhQejZ9lzviTXYQKXc6ff+i7/QY41ldi2xJOKze9cTc/ujT5 f/cA== 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 :message-id:date:subject:cc:to:from; bh=YQVSDDcKiclcNs6OzoVwDBy1VQY49JDMd8amVoi1GoU=; fh=RyLpDu7gZQ/WwsblApwZ+KHItlOyG8G5iNVUa6SrcqQ=; b=zbtjC7oL5rNjcja4H+toOPvk7/cFWoVUMQkpu69Stri06I3+6QMRxgqKj1c+QkFuWJ 3HhFpMTT+AG/8iob58b9rmT5rmt7MIDf4+InjQu4PVN3pXB2SirPzyzrDMtKc+uOOk1/ 3yjs1woHHAlwtcdG7fkN2YZSvyva/ut1T5CI7gWdZykUUC9e4l2ZH7x6BPmsIyK4J0/d e53viBsbytu6VacUg7EvljylzApUwTnb44grzwQE/NIpnmri2HbqXrBCoaup/nR2VxoR vf49kNjwuDZ73/oDZstLpCxkz4F6+MZY+nYE5oA7RgDM8SHhVaK95MTL44vYTgWNV1j0 owDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i129-20020a636d87000000b00565d88203c8si2272759pgc.535.2023.11.03.16.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 16:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A1EDA8093D66; Fri, 3 Nov 2023 16:00:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376811AbjKCXAR (ORCPT <rfc822;heyuhang3455@gmail.com> + 35 others); Fri, 3 Nov 2023 19:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234200AbjKCXAQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Nov 2023 19:00:16 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002B118B for <linux-kernel@vger.kernel.org>; Fri, 3 Nov 2023 16:00:12 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ukl@pengutronix.de>) id 1qz398-0001mn-Rt; Sat, 04 Nov 2023 00:00:10 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1qz398-006QIE-5v; Sat, 04 Nov 2023 00:00:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1qz397-00Cfjv-Sj; Sat, 04 Nov 2023 00:00:09 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Stuart Yoder <stuyoder@gmail.com>, Laurentiu Tudor <laurentiu.tudor@nxp.com> Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/2] bus: fsl-mc: Drop if block with always false condition Date: Sat, 4 Nov 2023 00:00:02 +0100 Message-ID: <20231103230001.3652259-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1317; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cV8SR9+e1pN98X9OciDQA6uUZrvZUrW5fK8gTZABZlk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlRXtypbwtUMpc2Hzdu6C986lYDTFJW/fCBYzRu q9PXCC/Ac6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUV7cgAKCRCPgPtYfRL+ TsqQCACluSwWQ1d5t2IR2O+leoOjQLawHZw2/8n+YeybUkRqlQvdZJ0U1PjVB+mCYLwbeTMmekp QDqhgv3Pz2uarINsHUkKL0sc5krHEHDL91ock0T6yvHuj17Ow83U50haZKr/3qqztATEWqxYVmR bhJPeiYgrzQ7IoQPZCbDnzK8qKAoxbz6ykMgcCSwHiILLOGbbfMAGG5vg0G8MTaKD7L69Ksin4F /ZKNfLHCfvh5JNjy8tLfkrtKDZfUtZMBqRX07Ff7qzyioR4ZupXyyameIKDDQYWt6mIYWWLarsJ 8u4V29cm+fFbXRX3uW5S4urOm6XIoiiBQn1EUooNNhOoIcMl X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 16:00:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781585670410758774 X-GMAIL-MSGID: 1781585670410758774 |
Series |
[1/2] bus: fsl-mc: Drop if block with always false condition
|
|
Commit Message
Uwe Kleine-König
Nov. 3, 2023, 11 p.m. UTC
The mc that belongs to a pdev is always a root dprc. In
fsl_mc_bus_probe() the mc device gets assigned the platform device as
parent. As dev_is_fsl_mc() is false for a platform device,
fsl_mc_get_root_dprc() will always be true and so the if body is never
run and it can be dropped.
The motivation for this change is to get rid of an error path in
.remove() that is broken (because only a part of the necessary cleanup
is done resulting in leaks and/or use-after-frees and the driver core
ignores the return value of .remove().)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 3 ---
1 file changed, 3 deletions(-)
base-commit: e27090b1413ff236ca1aec26d6b022149115de2c
Comments
Hello, I just noticed a double space in the Subject line. Feel free to replace it by a single one when applying. (I assume I shouldn't resend just for that, tell me if you prefer that though.) Best regards Uwe
Hello, On Sun, Nov 05, 2023 at 03:31:46PM +0100, Uwe Kleine-König wrote: > I just noticed a double space in the Subject line. Feel free to replace > it by a single one when applying. (I assume I shouldn't resend just for > that, tell me if you prefer that though.) Gentle ping. Is this patch set still waiting for review in someone's mailbox, or did it fell through the cracks already? Best regards Uwe
Hello, On Tue, Nov 28, 2023 at 06:03:10PM +0100, Uwe Kleine-König wrote: > On Sun, Nov 05, 2023 at 03:31:46PM +0100, Uwe Kleine-König wrote: > > I just noticed a double space in the Subject line. Feel free to replace > > it by a single one when applying. (I assume I shouldn't resend just for > > that, tell me if you prefer that though.) > > Gentle ping. Is this patch set still waiting for review in someone's > mailbox, or did it fell through the cracks already? For the record: These two patches are included in a pull request to Arnd (https://lore.kernel.org/all/20231128174927.m46dgp4juig2omci@pengutronix.de/) for all of drivers/bus. Best regards Uwe
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 2f6d5002e43d..75a8d365ffd4 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -1172,9 +1172,6 @@ static int fsl_mc_bus_remove(struct platform_device *pdev) struct fsl_mc *mc = platform_get_drvdata(pdev); struct fsl_mc_io *mc_io; - if (!fsl_mc_is_root_dprc(&mc->root_mc_bus_dev->dev)) - return -EINVAL; - mc_io = mc->root_mc_bus_dev->mc_io; fsl_mc_device_remove(mc->root_mc_bus_dev); fsl_destroy_mc_io(mc_io);