From patchwork Fri Jan 27 21:54:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Anholt X-Patchwork-Id: 9542801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 370E8604AB for ; Fri, 27 Jan 2017 21:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27BE627F54 for ; Fri, 27 Jan 2017 21:57:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AF9827F9F; Fri, 27 Jan 2017 21:57:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A812267EC for ; Fri, 27 Jan 2017 21:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbdA0V4x (ORCPT ); Fri, 27 Jan 2017 16:56:53 -0500 Received: from anholt.net ([50.246.234.109]:52066 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbdA0Vzy (ORCPT ); Fri, 27 Jan 2017 16:55:54 -0500 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 382D410A2288; Fri, 27 Jan 2017 13:55:08 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sbRkOHC_doY5; Fri, 27 Jan 2017 13:55:05 -0800 (PST) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 082E610A1E90; Fri, 27 Jan 2017 13:55:05 -0800 (PST) Received: by eliezer.anholt.net (Postfix, from userid 1000) id D9D5C2EDA33; Fri, 27 Jan 2017 13:55:03 -0800 (PST) From: Eric Anholt To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Eric Anholt Subject: [PATCH 2/6] staging: bcm2835-v4l2: Update the driver to the current VCHI API. Date: Fri, 27 Jan 2017 13:54:59 -0800 Message-Id: <20170127215503.13208-3-eric@anholt.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170127215503.13208-1-eric@anholt.net> References: <20170127215503.13208-1-eric@anholt.net> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 49bec49fd7f2 ("staging: vc04_services: remove vchiq_copy_from_user") removed the flags/msg_handle arguments, which were unused, and pushed the implementation of copying using memcpy vs copy_from_user to the caller. Signed-off-by: Eric Anholt --- drivers/staging/media/platform/bcm2835/mmal-vchiq.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/platform/bcm2835/mmal-vchiq.c b/drivers/staging/media/platform/bcm2835/mmal-vchiq.c index 781322542d5a..24bd2948136c 100644 --- a/drivers/staging/media/platform/bcm2835/mmal-vchiq.c +++ b/drivers/staging/media/platform/bcm2835/mmal-vchiq.c @@ -378,6 +378,14 @@ static int inline_receive(struct vchiq_mmal_instance *instance, return 0; } +static ssize_t mmal_memcpy_wrapper(void *src, void *dst, + size_t offset, size_t size) +{ + memcpy(dst + offset, src + offset, size); + + return size; +} + /* queue the buffer availability with MMAL_MSG_TYPE_BUFFER_FROM_HOST */ static int buffer_from_host(struct vchiq_mmal_instance *instance, @@ -442,10 +450,9 @@ buffer_from_host(struct vchiq_mmal_instance *instance, vchi_service_use(instance->handle); - ret = vchi_msg_queue(instance->handle, &m, + ret = vchi_msg_queue(instance->handle, mmal_memcpy_wrapper, &m, sizeof(struct mmal_msg_header) + - sizeof(m.u.buffer_from_host), - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + sizeof(m.u.buffer_from_host)); if (ret != 0) { release_msg_context(msg_context); @@ -731,9 +738,9 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, vchi_service_use(instance->handle); ret = vchi_msg_queue(instance->handle, + mmal_memcpy_wrapper, msg, - sizeof(struct mmal_msg_header) + payload_len, - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + sizeof(struct mmal_msg_header) + payload_len); vchi_service_release(instance->handle);