From patchwork Mon Jun 29 15:09:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11631167 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D9F4618 for ; Mon, 29 Jun 2020 15:27:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD75124920 for ; Mon, 29 Jun 2020 15:27:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wZn8Fh0y"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nnne0pOZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD75124920 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PWA6ksPxWcunHNhhfB1ZXKMczrv0rzC+JBxr+4sbRXc=; b=wZn8Fh0yu4G5hglnCcjwnpEV4 eCqCXOeeuqFlXcpjmM40LVyruaGYez5xOfkd+pLdFmQ9gGWuOEq6ISouCxetZ4Hxdlmj7W0ajNCho O3hz1+jGofGMvJ7C84CXYYwlaXGB73M0Gw3rV+UNQ62O65ckReuBLilMAIushBTOtPDJyVqVcgQWk jNCG0j49OwQgQMJjTlPxf2sMBzteMToP+JHzdXouw29YY0o9FKfLKUvCnhEOkpC14b1atmkJ2iYdQ z9ZMQpUx30MJlSHJ8wiIdMBt6pWiOrOvxhqR7ubkSQxUvMIixOYpdO4IEWSYXKHC+FT+SQT+wfEGD yrVhleKsg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvfJ-0001lB-2Q; Mon, 29 Jun 2020 15:25:49 +0000 Received: from casper.infradead.org ([90.155.50.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvQP-0002n3-Ct; Mon, 29 Jun 2020 15:10:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=rsbMSv8SEFzLxYCivwxMYiyZyUmM65WroMhUX2Ndab8=; b=nnne0pOZQC5lySTJL6GNCFdLBT gJsTnUa8NxX/W8VhEIkubBjz9qtVy2B1f15x1JJDyEYGA/+QayIZWAGY/lttsXcbaGIXE7YCY+Esu u5BA79I5Y7kIVBjmA8fLdHM3WFvRbkJyaT8Fp/BAnOiRbtKAJF5aaKtgHyZiBGVsQOD1KBjASFnc/ 9PJWdlZlajEtZPclsVyIaIh3gaGROzD3AeOdJon8n7p3iusCr0v4nTWSZM3Ot6mUhx9YH0/c+vNx2 dgn9C8gCQCQmROf+tLwidxsYd/92Q6HRgBcLiTOKAfRI0g2DLk7VK9a9T/f5pXwkemYKVdlxpknzR pCj76qug==; Received: from mx2.suse.de ([195.135.220.15]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvQB-0003SB-1x; Mon, 29 Jun 2020 15:10:22 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 78DFFB012; Mon, 29 Jun 2020 15:10:06 +0000 (UTC) From: Nicolas Saenz Julienne To: gregkh@linuxfoundation.org Subject: [PATCH v2 33/47] staging: vchi: Rework vchi_msg_hold() to match vchiq_msg_hold() Date: Mon, 29 Jun 2020 17:09:31 +0200 Message-Id: <20200629150945.10720-34-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629150945.10720-1-nsaenzjulienne@suse.de> References: <20200629150945.10720-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200629_161012_799343_96D1D580 X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-4.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, kernel-list@raspberrypi.com, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The services have access to struct vchiq_header's internals, so we can let them get the data pointer. This pretty much makes both functions exactly the same, which will allow us to make a switch to vchiq_msg_hold() further down the road. Signed-off-by: Nicolas Saenz Julienne --- .../staging/vc04_services/interface/vchi/vchi.h | 5 +---- .../interface/vchiq_arm/vchiq_shim.c | 15 ++------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchi/vchi.h b/drivers/staging/vc04_services/interface/vchi/vchi.h index 72771fdee9d6..59559d4cd5f1 100644 --- a/drivers/staging/vc04_services/interface/vchi/vchi.h +++ b/drivers/staging/vc04_services/interface/vchi/vchi.h @@ -54,10 +54,7 @@ extern int vchi_queue_kernel_message(unsigned handle, void *data, // Routine to look at a message in place. // The message is dequeued, so the caller is left holding it; the descriptor is // filled in and must be released when the user has finished with the message. -extern int32_t vchi_msg_hold(unsigned handle, - void **data, // } may be NULL, as info can be - uint32_t *msg_size, // } obtained from HELD_MSG_T - struct vchiq_header **message); +struct vchiq_header *vchi_msg_hold(unsigned handle); /******************************************************************************* * Global service support API - operations on held messages diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c index 6eb9a9878641..fc12b76617d1 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c @@ -154,20 +154,9 @@ EXPORT_SYMBOL(vchi_held_msg_release); * Returns: int32_t - success == 0 * ***********************************************************/ -int32_t vchi_msg_hold(unsigned handle, void **data, uint32_t *msg_size, - struct vchiq_header **message) +struct vchiq_header *vchi_msg_hold(unsigned handle) { - struct vchiq_header *header; - - header = vchiq_msg_hold(handle); - if (!header) - return -ENOENT; - - *data = header->data; - *msg_size = header->size; - *message = header; - - return 0; + return vchiq_msg_hold(handle); } EXPORT_SYMBOL(vchi_msg_hold);