From patchwork Mon Dec 20 21:29:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaston Gonzalez X-Patchwork-Id: 12696903 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 30E97C433F5 for ; Mon, 20 Dec 2021 21:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KbKYJ98Ps5qz9LpvbNPqNBc5mvtfn0WiXC7GDp3Z6pk=; b=HLq7Sbc3YInJ0V Gmfbkval3O+AggrFHfmqc0BfiuV9mSOa/0hEuN1OXL/yr+uSQWXO864SNg9E7ldQ81eqFsH8Ww1mq tFkDWiVfR4qFH/fOHOyFGayTun+J9vmXh1OsmoJvRN+HxHU9UEryKRggRfh5ujFN07C+zOafrJiQ7 +1V3JOXRKhXG0amJBYJU3OkFtdbj2WZejbgt2SE1iB84hrGVLmRdE6v7tfOhCFkW4IegNBwkvYtg8 MuN790lKVeWgDpqYyqpUOJbXXn9jnMOrTTabVe/aQi0IL0kNhsUAZJ5ppa/poWbU7QCBuqpFIbvCg HW03mz3NpxO0zLwPM90w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQGX-004V9a-Vx; Mon, 20 Dec 2021 21:32:18 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQFi-004UjK-A1; Mon, 20 Dec 2021 21:31:28 +0000 Received: by mail-qv1-xf32.google.com with SMTP id kk22so10657821qvb.0; Mon, 20 Dec 2021 13:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3TZsqgcnexho8xD1nxnnl9R0Pkmm2FcWy2QDii/7Sys=; b=n7n49IRDQvxi7CHuTHh+u+OuE171gKGZZ7wBNG9SVgP38qEBz6+/x1F90nKaiV8OR0 Wgke/xLnpPtMYahVI6VTnKVS8h/pfBCINkn05Sl4blF9cx+mjPjwMYprlCp5h2T2HsTZ LVYtvBMKom+l8h1LcausygllYlzPVz5DfaAgxCTTA/Jg8T9SAMKWuj1VAOnrUPgftosv b3awbxGC2I0RLoqfzUfYnZlMUPjAimgzb78J7XCGrtPg7bTSrWFcwga6oKYpdS01H9Ho hGTyLu+V6ap9V+bAMbm+jtp7RuyNDryH/G/8UHie+aqJbqYse+CzgO1MlUaVEgbL5+Ll QGAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3TZsqgcnexho8xD1nxnnl9R0Pkmm2FcWy2QDii/7Sys=; b=YRyxAkOUlWsOAx8/NZUIj+t1deqPXk8hrTsoqejYkzmHmzpImfsykUqyROwJpkCMci QlKLbBxnZx3iJnwMERiXNRkDW9o/dqIS4YKcCB/7o8wdmR8z81Xp5bni1GqnZ1/R/6mc ppEgcu+pLV8moSvauThopiehrL3DBeU8eg3a7ZVCu2KqMaG7Q44R+jWaVcyBnEOnfAP2 awTBxFdeW6/zFWw+A8qqwEAZHDgeSyaA05qQwLdSz/PU2NqbJvxSf6hnNMGSq+RP+nVP ON1kRfNr8kIaHiQ7sNlkTcGFhoF36mQjy9peLAjsluYVsoOTvAFrDsDy+hIVgI4GQ0DM MGCQ== X-Gm-Message-State: AOAM531UliMY0IdzZKG4P58Tl2IoknREELkkDuEKNWZCfk0ukD5SbtO4 5/7zkV/JWH1aeCyKNwTaetQ= X-Google-Smtp-Source: ABdhPJy805I2vaVWrMqFtSrfyvP2UMaV1jMyh9EYwgEB2ksQ59Z01784aSMHQfsx1wy4tIwFV0eJNA== X-Received: by 2002:a05:6214:500f:: with SMTP id jo15mr39831qvb.64.1640035885582; Mon, 20 Dec 2021 13:31:25 -0800 (PST) Received: from localhost.localdomain ([181.23.83.92]) by smtp.gmail.com with ESMTPSA id s20sm16132210qtc.75.2021.12.20.13.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 13:31:25 -0800 (PST) From: Gaston Gonzalez To: linux-staging@lists.linux.dev Cc: gregkh@linuxfoundation.org, nsaenz@kernel.org, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, juerg.haefliger@canonical.com, rdunlap@infradead.org, dave.stevenson@raspberrypi.com, stefan.wahren@i2se.com, unixbhaskar@gmail.com, mitaliborkar810@gmail.com, phil@raspberrypi.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gascoar@gmail.com Subject: [PATCH 3/4] staging: vc04_services: avoid the use of typedef for function pointers Date: Mon, 20 Dec 2021 18:29:13 -0300 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_133126_439381_BD6002A9 X-CRM114-Status: GOOD ( 15.36 ) 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 Replace the function pointer typedef vchiq_mmal_buffer_cb with equivalent declaration to better align with the linux kernel coding style. While at it, realignments were done in some touched lines. Signed-off-by: Gaston Gonzalez --- .../vc04_services/vchiq-mmal/mmal-vchiq.c | 24 +++++++++---------- .../vc04_services/vchiq-mmal/mmal-vchiq.h | 13 +++++----- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index 76d3f0399964..54e5ce245ae7 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -269,10 +269,10 @@ static void buffer_work_cb(struct work_struct *work) atomic_dec(&msg_context->u.bulk.port->buffers_with_vpu); - msg_context->u.bulk.port->buffer_cb(msg_context->u.bulk.instance, - msg_context->u.bulk.port, - msg_context->u.bulk.status, - msg_context->u.bulk.buffer); + msg_context->u.bulk.port->vchiq_mmal_buffer_cb(msg_context->u.bulk.instance, + msg_context->u.bulk.port, + msg_context->u.bulk.status, + msg_context->u.bulk.buffer); } /* workqueue scheduled callback to handle receiving buffers @@ -1327,13 +1327,12 @@ static int port_disable(struct vchiq_mmal_instance *instance, mmalbuf = list_entry(buf_head, struct mmal_buffer, list); list_del(buf_head); - if (port->buffer_cb) { + if (port->vchiq_mmal_buffer_cb) { mmalbuf->length = 0; mmalbuf->mmal_flags = 0; mmalbuf->dts = MMAL_TIME_UNKNOWN; mmalbuf->pts = MMAL_TIME_UNKNOWN; - port->buffer_cb(instance, - port, 0, mmalbuf); + port->vchiq_mmal_buffer_cb(instance, port, 0, mmalbuf); } } @@ -1363,7 +1362,7 @@ static int port_enable(struct vchiq_mmal_instance *instance, port->enabled = 1; - if (port->buffer_cb) { + if (port->vchiq_mmal_buffer_cb) { /* send buffer headers to videocore */ hdr_count = 1; list_for_each_safe(buf_head, q, &port->buffers) { @@ -1454,9 +1453,10 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_get); * enables a port and queues buffers for satisfying callbacks if we * provide a callback handler */ -int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance, - struct vchiq_mmal_port *port, - vchiq_mmal_buffer_cb buffer_cb) +int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance, struct vchiq_mmal_port *port, + void (*vchiq_mmal_buffer_cb)(struct vchiq_mmal_instance *instance, + struct vchiq_mmal_port *port, int status, + struct mmal_buffer *buffer)) { int ret; @@ -1469,7 +1469,7 @@ int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance, goto unlock; } - port->buffer_cb = buffer_cb; + port->vchiq_mmal_buffer_cb = vchiq_mmal_buffer_cb; ret = port_enable(instance, port); diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h index 1dc81ecf9268..39615ce6584a 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h @@ -42,11 +42,6 @@ struct vchiq_mmal_port_buffer { struct vchiq_mmal_port; -typedef void (*vchiq_mmal_buffer_cb)( - struct vchiq_mmal_instance *instance, - struct vchiq_mmal_port *port, - int status, struct mmal_buffer *buffer); - struct vchiq_mmal_port { u32 enabled:1; u32 handle; @@ -76,7 +71,9 @@ struct vchiq_mmal_port { /* Count of buffers the VPU has yet to return */ atomic_t buffers_with_vpu; /* callback on buffer completion */ - vchiq_mmal_buffer_cb buffer_cb; + void (*vchiq_mmal_buffer_cb)(struct vchiq_mmal_instance *instance, + struct vchiq_mmal_port *port, int status, + struct mmal_buffer *buffer); /* callback context */ void *cb_ctx; }; @@ -126,7 +123,9 @@ int vchiq_mmal_component_disable( int vchiq_mmal_port_enable( struct vchiq_mmal_instance *instance, struct vchiq_mmal_port *port, - vchiq_mmal_buffer_cb buffer_cb); + void (*vchiq_mmal_buffer_cb)(struct vchiq_mmal_instance *instance, + struct vchiq_mmal_port *port, int status, + struct mmal_buffer *buffer)); /* disable a port *