From patchwork Mon Oct 14 08:56:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13834576 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 0DFACCFC52F for ; Mon, 14 Oct 2024 09:54:47 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y/JEhqoZl4E0cyUUh/uV9OIb6kXsx02RuLl2MX4iZIs=; b=44gbNq4EiI/oD2PPPViIY/GYYD 0vAJA2GMxaDQ+t85M1JXr+dRGFMNF2HcBIrQq1emCzTCbT+M1ru5MJx0eWvASe7SLRQFW7bU45IYN sRMcoNWPxgpXKSM29JZBJwXY2gn9Qen/Bvl/zfN/WBw8hi9vLVmOs2lCcjk0VtaN/WV3w6bRfiljW OH+faSq+c+gvbNhrpFSaG53y6mQodNs2JacOXV64U+cSxjWyyvOvqbt6140x4IGXD/vieIaqf3eFS LPuUnpymQD5t874dD1vIZ2epS3cp9uFZvIZd1Xklqvz76P1bLVzGAH4uPWu0njEchSQ3sowN1XtdR poyExL2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Hme-00000004bxN-0jlt; Mon, 14 Oct 2024 09:54:36 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0Gsn-00000004OCt-3C5a; Mon, 14 Oct 2024 08:56:55 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5c935d99dc5so4295078a12.1; Mon, 14 Oct 2024 01:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728896212; x=1729501012; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Y/JEhqoZl4E0cyUUh/uV9OIb6kXsx02RuLl2MX4iZIs=; b=GmLwZmVoaq/bh5PkQraWTNKBOSARvOUxOYRJmrDqonjVSbn90v+7z3XpoCE6IoHjhg NEGOQ7LFkDSRAbDosm/5+7NBB3PPLCVJnCCb6DN7mkpp2RLCv34Fb+jfBH8CTCWa4Qje dcHDmVJQnx00eeMwtrH261jQ1ccc4Rakph9YA/0jq13ksP4TN/ZxQBUqn1Dg1QyTYNZi +Od95gd0Cx+Sc5iA+ZShK2dVwIXTz4h8+mulgn6RGYgpnH/HoaGxFKhj+Y/5+ArkXs9y /GkXWC5w5kjyPiN4Ohe9M8zEjY/u+sWH5lIlqVKYZ1gI9y/zaxeP9fInbK76BukIwcPy 093g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728896212; x=1729501012; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y/JEhqoZl4E0cyUUh/uV9OIb6kXsx02RuLl2MX4iZIs=; b=TsWhFTGoULLBq6iHqIsz9QefZoL0KTySFCkb0B77HOV1Q5xHSPuKCSBEMwRc7MhYkS RFt427RXcn8ycbYqnXPVbdqMx9o9shhymjco/hx/K4A0mk2jynf+/lzoQJLAwkuuYq2E jMGe4hLzplekg/DpFum/yTGFK0xujebPF8V661qzOeAiaMSjXjBx9rcnOWpNI0EHDXG2 7H6EGs158IxtOKAOHCfXVcDNOcDma5DsULGuWNPWrnKLopn9jSqUXfQCg2fVHChtBzGi JrC79FC7kg+RADqTQ5pAdwYyV+E0yuFNCV69blWDShDwlEdsTpcuSYH6dRc0wZK65sO3 eyYA== X-Forwarded-Encrypted: i=1; AJvYcCVF3CPv3moT31o1j7RDRGJOmDolQKVEYNK56M5Q5eEA3nToJ52yXAtWrEC0iv0Xh7NBHR02mdZvxkS9SRMAeOgW@lists.infradead.org X-Gm-Message-State: AOJu0YxhIwTda/PM1BlqD6qwO+xklKC/Am+zNS+4xdIDYFAbO8aD9y8f qFBIwmPr/bU8fxlYUJ2LevdmbFG8nxZXSIsb4L3b/QL5LN+sZOgD X-Google-Smtp-Source: AGHT+IEFn6QtuxV2uIFTjjx/8oPht9aHKpTC7u9qcL44bqP67ILGm5a+ZBNPq+GHrpBB1J5epP0+nA== X-Received: by 2002:a05:6402:34ca:b0:5c9:68f9:8af3 with SMTP id 4fb4d7f45d1cf-5c968f9a259mr4404776a12.17.1728896212102; Mon, 14 Oct 2024 01:56:52 -0700 (PDT) Received: from [127.0.1.1] (91-118-163-37.static.upcbusiness.at. [91.118.163.37]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c9370d2296sm4635091a12.15.2024.10.14.01.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 01:56:51 -0700 (PDT) From: Javier Carrasco Date: Mon, 14 Oct 2024 10:56:36 +0200 Subject: [PATCH v2 1/2] staging: vchiq_arm: refactor goto instructions in vchiq_probe() MIME-Version: 1.0 Message-Id: <20241014-vchiq_arm-of_node_put-v2-1-cafe0a4c2666@gmail.com> References: <20241014-vchiq_arm-of_node_put-v2-0-cafe0a4c2666@gmail.com> In-Reply-To: <20241014-vchiq_arm-of_node_put-v2-0-cafe0a4c2666@gmail.com> To: Florian Fainelli , Broadcom internal kernel review list , Greg Kroah-Hartman , Stefan Wahren , Umang Jain , Laurent Pinchart Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1728896207; l=1704; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=xGtdnRt3Vj5TJFE+xPUs3ODpILN2e8JGFrFZ5HwFyn8=; b=qS4TvGWBJCdTNKcjEj/E2YkKBXpwxQCEeub3CsxnCOFRi2PGAsVjTmZNKf7cV1VqYhMDxnDHi aZvTdlM8d5+DTAOddmqFmYTCjnf7qZtGg7jjKKm1cJ57YkZ8DO55+/t X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_015653_872956_1D46F27B X-CRM114-Status: GOOD ( 12.74 ) 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 The 'failed_platform_init' and 'error_exit' labels do not simplify the code, there is a single jump to them in the code, and the actions taken from then on can be easily carried out where the goto occurs. Signed-off-by: Javier Carrasco --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 27ceaac8f6cc..81b2887d1ae0 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1361,8 +1361,10 @@ static int vchiq_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mgmt); ret = vchiq_platform_init(pdev, &mgmt->state); - if (ret) - goto failed_platform_init; + if (ret) { + dev_err(&pdev->dev, "arm: Could not initialize vchiq platform\n"); + return ret; + } vchiq_debugfs_init(&mgmt->state); @@ -1376,18 +1378,13 @@ static int vchiq_probe(struct platform_device *pdev) ret = vchiq_register_chrdev(&pdev->dev); if (ret) { dev_err(&pdev->dev, "arm: Failed to initialize vchiq cdev\n"); - goto error_exit; + return ret; } bcm2835_audio = vchiq_device_register(&pdev->dev, "bcm2835-audio"); bcm2835_camera = vchiq_device_register(&pdev->dev, "bcm2835-camera"); return 0; - -failed_platform_init: - dev_err(&pdev->dev, "arm: Could not initialize vchiq platform\n"); -error_exit: - return ret; } static void vchiq_remove(struct platform_device *pdev)