From patchwork Tue Sep 10 05:10:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13797957 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 0106FEB64DE for ; Tue, 10 Sep 2024 05:12:27 +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=vBeqwjsXqVc+qm+5ZQZpdCrTfw33GGFd5n9DZ7oxRpI=; b=ljbJhdOSTRLD/K8i1qy3puRobB h1rJ1YQ17S74Z1FtJht0VYcBgcDZ7FWQoAzwUFWwCvuuMO6gx8dz3fML3vOxtbwYVNokhL2uLm2L/ NeS3BM6xk1q4+pJF9ajzbQURS6nKSjMyvgDE1q7DqAnaFrkFKIf2SqXYimbL1sTBR48L6U/6yHiTd gpYa+ndV8QJVdZzOc13kaa/P9t2eBas0K2IoEJAbwKcFFzAHTn89k1YjEukdljbieWYUChqUEv/X6 M6E690Db2O+9OP1sStEqg4bVkDTDYjSVXpgh/cpgHG/ljTxubtgBMcDY3yHXhJ9ekoZc4pIRdahNZ CnWAkdvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sntAo-00000004IS8-2lEz; Tue, 10 Sep 2024 05:12:18 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snt9C-00000004IHg-42gV; Tue, 10 Sep 2024 05:11:16 +0000 Received: from localhost.localdomain (unknown [IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0141163D; Tue, 10 Sep 2024 07:09:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1725944960; bh=vXpRoO946QW0NHI5KTFMYe++HiL2NqHu6+sgb2bkYZE=; h=From:To:Cc:Subject:Date:From; b=n3K3WqC12lo5o5J/nxglu+lKrOXvWW2BF8wV6ZpeEfLGLEayHaft/w1xakG0P5yKQ EVb7FbNnMP4fWTfK/NAwT2cv9b7riQZBPQMVaFPoV5x+v8YZGriovCpqhFRGBvt7fJ +edBFU89IjouOAzfepANwu992k/D0pvMON7CARG0= From: Umang Jain To: Broadcom internal kernel review list , Greg Kroah-Hartman Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, Kieran Bingham , Arnd Bergmann , Stefan Wahren , Laurent Pinchart , Umang Jain Subject: [PATCH v6 0/7] staging: vchiq_core: Remove unused function argument Date: Tue, 10 Sep 2024 10:40:00 +0530 Message-ID: <20240910051007.297227-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_221039_168137_F1963C8C X-CRM114-Status: GOOD ( 12.21 ) 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 Series mostly refactors vchiq_bulk_transfer() code according to Arnd's review comment from [1]: > You can also wrap vchiq_bulk_transfer() in order to have > four separate functions based on the different 'mode' > values and have them only take the arguments they actually > need. I didn't wrap vchiq_bulk_transfer(), instead created four differnet function, one for each mode. This will pave the way to address his second comment: > Ideally this should be cleaned up in a way that completely > avoids passing both user and kernel data at the same time. which is not part of this series and will be done on top as arguments shuffling will have to fix the sparse warnings that exists currently. Patch 1/7 first moves the VCHIQ_BULK_MODE_WAITING logic out of vchiq_bulk_transfer Patch 2/7 then moves the core logic to vchiq_bulk_transfer() which can be shared in subsequent patches Patch 3/7 and 4/7 refactors remaining bulk transfer modes Patch 5/7 finally drops the vchiq_bulk_transfer() as not needed patch 6/7 and 7/7 are drive by patches, noticed during development. [1]: https://lore.kernel.org/linux-staging/3d3b7368-93b2-4c0d-845e-4099c2de9dc1@app.fastmail.com/ Changes in v6: - Drop forward declaration vchiq_bulk_xfer_queue_msg_interruptible() in 2/7 changes in v5: - Fix regression for VCHIQ_BULK_MODE_BLOCKING in 3/7 (Fixes strange hang from v4 with 'vchiq_test -p') Changes in v4: - In 1/7 return 0 direcly instead of assigning status = 0 - In 3/7, fix null assignment of bulk waiter CHanges in v3: - Directly return if service == NULL in 1/7 and 4/7 - Drop set-but-unused variable from 1/7 Changes in v2: - Directly return if service == NULL in 3/7 - Prefix non-static functions with "vchiq_" (appropriate driver prefix) - Use typed argument for 'userdata' in 1/7 Umang Jain (7): staging: vchiq: Factor out bulk transfer for VCHIQ_BULK_MODE_WAITING staging: vchiq_core: Simplify vchiq_bulk_transfer() staging: vchiq_core: Factor out bulk transfer for blocking mode staging: vchiq_core: Factor out bulk transfer for (no/)callback mode staging: vchiq_core: Drop vchiq_bulk_transfer() staging: vchiq_core: Remove unused function argument staging: vchiq_core: Pass enumerated flag instead of int .../interface/vchiq_arm/vchiq_arm.c | 20 +- .../interface/vchiq_arm/vchiq_core.c | 323 +++++++++++------- .../interface/vchiq_arm/vchiq_core.h | 16 +- .../interface/vchiq_arm/vchiq_dev.c | 15 +- 4 files changed, 232 insertions(+), 142 deletions(-) Tested-by: Stefan Wahren