From patchwork Mon Dec 20 21:29:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaston Gonzalez X-Patchwork-Id: 12696901 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 D606FC433F5 for ; Mon, 20 Dec 2021 21:32:43 +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=xrTr3aurBLb2aquAZ6Mr/jotuwNm5b1+I6dytBH3CH8=; b=MnPNOTlknHVevz wVzFAVpqtTjJtS2r5P1z9G+ojPi5exsi26+qP5yanIXdyXpPAPxefJN+xNzdC3k2UQfTKxZLkR3f7 AdxfKk9jtIjMv5jg9bUxVTtIJMZgzAmZu/n/kjXjM5ZFXY10Zma7PRa+hdcI+Q5FHmvsDlJ+cH5Xd bumcl34mE60tRU86XpyL3J8bC3ZDhuHXYzSj33booef1y19KYmyyN/aLXlQeWSf13aD+iw33OnfKX L81erEYICoEsI4wRa8IZs53asNqqkw7meOAlBhojAyOCiV4R2qnm1+Ta43/A+/FgFGIiR4bvd/R4Q DB9PV/2ULDUSOJmeJD8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQFY-004UdH-E8; Mon, 20 Dec 2021 21:31:17 +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 1mzQFR-004Uac-Ii; Mon, 20 Dec 2021 21:31:11 +0000 Received: by mail-qv1-xf32.google.com with SMTP id kk22so10657198qvb.0; Mon, 20 Dec 2021 13:31:09 -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=XbS9uErZ5c4CCSbiHzp6Nqw9oW8CSOfv3JYeCjB7h/s=; b=ZV2zXZFTlYuITazlNNWKKFxASGrjAHJze0zJTlYdiCD8QL/zjDYWvNbY89WdPJUoIA 3xQzH1UtKZ/YIx6tIJu0P1FrudhMy2ldKE/xmX+EyXAmTBKmTxpwDwYlR22hue7Z2Mww 48be5SJ4bIqXnix7MHQcP7SJ/2Ief5l6Jzlai0SakgOPciszJfpca8I+76Wa8u+rsroT 1CMUKoIen4vDITSx6ohEk37N2tEbM+CA+GPvSpnOs3TN4JLirGOrDJ/DdEecSoN2KuIK TNYK4/xW++y9I5wgSK8tmgpfu8igpAJA2Vrhu6a4KtysUxkGT9g8rCrQ32teNyXw+GrX skwQ== 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=XbS9uErZ5c4CCSbiHzp6Nqw9oW8CSOfv3JYeCjB7h/s=; b=NE8LrZn3oduRabLMkcItcF5rlYQaHyhtzKK0ixpTcSV7kgaZlEc9jrCCJqp7FZO3fa /fZ0oTCJbTdmzX5OKyQHR6xxTJzYtI3bmhuTIt9CpJMjJ/llaNbkHXc2TRXU5k6KxMfx 8kJeSHLeUB3ScwIpjN/GK8y825fzRwwJul7Bz0g+P00L9/Cq/d8OtGe60CExKtyzeOlt gjuFTAWSEgoxQChNlix7jVMTyKS7vVBRVa1/sEPdX0YGl04osxH7q5CSEqfpgIKgXUeT YRM94+Qvp+7GodkY4W5j2fHgOgZesAQD8JhXmIjPGTl33muTg4aESDSCqheAKLdDEyB2 2E9Q== X-Gm-Message-State: AOAM533l8glQ1vAsYyCoM7aFXe6QAR1L/VfbDN0mXiez1xbataWqrbNI iLP5aqeyrLlwUNTDNCWgyKA= X-Google-Smtp-Source: ABdhPJxKZCXLVtjy5SJQkGzGpUEqkJD9cq5OV6++SDXZLl1EbbJvmvvBInFUzc53pV55WkgBljI9Rg== X-Received: by 2002:a05:6214:20e9:: with SMTP id 9mr14767113qvk.28.1640035868201; Mon, 20 Dec 2021 13:31:08 -0800 (PST) Received: from localhost.localdomain ([181.23.83.92]) by smtp.gmail.com with ESMTPSA id s20sm16132210qtc.75.2021.12.20.13.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 13:31:07 -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 1/4] staging: vc04_services: avoid the use of typedef for function pointers Date: Mon, 20 Dec 2021 18:29:11 -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_133109_644762_0E9F8E5C X-CRM114-Status: GOOD ( 12.33 ) 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 typedefs bcm2835_audio_newpcm_func and bcm2835_audio_newctl_func with equivalent declarations to better align with the linux kernel coding style. As the '_func' in the function names is somehow reduntant, it was dropped in favour of the shorter names: 'bcm2835_audio_newpcm' and 'bcm2835_audio_newctl' Signed-off-by: Gaston Gonzalez --- .../vc04_services/bcm2835-audio/bcm2835.c | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c index c250fbef2fa3..412342d5b6c9 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c @@ -52,20 +52,14 @@ static int bcm2835_devm_add_vchi_ctx(struct device *dev) return 0; } -typedef int (*bcm2835_audio_newpcm_func)(struct bcm2835_chip *chip, - const char *name, - enum snd_bcm2835_route route, - u32 numchannels); - -typedef int (*bcm2835_audio_newctl_func)(struct bcm2835_chip *chip); - struct bcm2835_audio_driver { struct device_driver driver; const char *shortname; const char *longname; int minchannels; - bcm2835_audio_newpcm_func newpcm; - bcm2835_audio_newctl_func newctl; + int (*bcm2835_audio_newpcm)(struct bcm2835_chip *chip, const char *name, + enum snd_bcm2835_route route, u32 numchannels); + int (*bcm2835_audio_newctl)(struct bcm2835_chip *chip); enum snd_bcm2835_route route; }; @@ -104,8 +98,8 @@ static struct bcm2835_audio_driver bcm2835_audio_alsa = { .shortname = "bcm2835 ALSA", .longname = "bcm2835 ALSA", .minchannels = 2, - .newpcm = bcm2835_audio_alsa_newpcm, - .newctl = snd_bcm2835_new_ctl, + .bcm2835_audio_newpcm = bcm2835_audio_alsa_newpcm, + .bcm2835_audio_newctl = snd_bcm2835_new_ctl, }; static struct bcm2835_audio_driver bcm2835_audio_hdmi = { @@ -116,8 +110,8 @@ static struct bcm2835_audio_driver bcm2835_audio_hdmi = { .shortname = "bcm2835 HDMI", .longname = "bcm2835 HDMI", .minchannels = 1, - .newpcm = bcm2835_audio_simple_newpcm, - .newctl = snd_bcm2835_new_hdmi_ctl, + .bcm2835_audio_newpcm = bcm2835_audio_simple_newpcm, + .bcm2835_audio_newctl = snd_bcm2835_new_hdmi_ctl, .route = AUDIO_DEST_HDMI }; @@ -129,8 +123,8 @@ static struct bcm2835_audio_driver bcm2835_audio_headphones = { .shortname = "bcm2835 Headphones", .longname = "bcm2835 Headphones", .minchannels = 1, - .newpcm = bcm2835_audio_simple_newpcm, - .newctl = snd_bcm2835_new_headphones_ctl, + .bcm2835_audio_newpcm = bcm2835_audio_simple_newpcm, + .bcm2835_audio_newctl = snd_bcm2835_new_headphones_ctl, .route = AUDIO_DEST_HEADPHONES }; @@ -189,7 +183,7 @@ static int snd_add_child_device(struct device *dev, strscpy(card->shortname, audio_driver->shortname, sizeof(card->shortname)); strscpy(card->longname, audio_driver->longname, sizeof(card->longname)); - err = audio_driver->newpcm(chip, audio_driver->shortname, + err = audio_driver->bcm2835_audio_newpcm(chip, audio_driver->shortname, audio_driver->route, numchans); if (err) { @@ -197,7 +191,7 @@ static int snd_add_child_device(struct device *dev, goto error; } - err = audio_driver->newctl(chip); + err = audio_driver->bcm2835_audio_newctl(chip); if (err) { dev_err(dev, "Failed to create controls, error %d\n", err); goto error; From patchwork Mon Dec 20 21:29:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaston Gonzalez X-Patchwork-Id: 12696902 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 980E7C433F5 for ; Mon, 20 Dec 2021 21:33:08 +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=ZtC3ZrIfyy4jIvqdWSkXE6Wg1WX+fqVpjGZQTFx7VIs=; b=SEEKjkX5K38AVS 8URlHO6uxJTwUgVkZlO0i00dH85D3YF/1sfvHlj9FCwOVRrX6h1nwdfzGfPVxH+dLFXs+H4eBbSWO v2qY9VItWWHWsVxombyNuweRg5Qgp5sl4ZPGW9Q+pJ4FWYjJ/h/YolT52SSYcjYVTqahjNTX6XwPr uF+7Uq8xQxyz0VsY900rHBBUd2Bo2O7Hi4TavjxaBbazT2ZCB5rMkggDg8eG/fWt5bAY5bWvJgugt /85I4yG4IGD82UFs9X6vbjA33uMf+A4SWF48zdEi/N+fTerD6d/lqbgInKakOpDqa7YsgKsKFfocm djoH9Eg6W7oGBQfg42UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQG0-004UtL-F9; Mon, 20 Dec 2021 21:31:44 +0000 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQFd-004Ugx-Nh; Mon, 20 Dec 2021 21:31:23 +0000 Received: by mail-qt1-x834.google.com with SMTP id z9so11096286qtj.9; Mon, 20 Dec 2021 13:31:21 -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=hHGHF/771v/lWlHIpIBMgn0pJ2OF4beYEH9R0ZP6Heo=; b=GOztQB5WaoE24sEWGlnVpZkWx2AyyVC9XzzBKIsDrkDAWZa+49Qx8gfIezCdcqahTC rzEO0lK0h38kLkhlAN182np60N4wYxXZPqHdetD/9SZhLPGa4wctdhxkjOQV5za6W0Pi Ihj2LRv4ccblWuqYM9VkozQ9c/9JA3awsnudBreEck7RrU6snyayJ5Gu1KmB5L5xO1tp 0yB14Ngzfpah5gEWWm20xqbfknoJrQMlAqILi8GUkuSozNla3UxQ3qKKQ1th4NJQ176X JAfuSfzrKOWK9nTtw/W3jh+FVK7g31sGyaTlbSyUAFbxWrw8EB2A+H8kOgwyp0QkjjBZ B/yA== 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=hHGHF/771v/lWlHIpIBMgn0pJ2OF4beYEH9R0ZP6Heo=; b=rho+PdNIEKCln5h/8FCsMbyUX4EtnG3j5RoehNVPCoKu/0UFT04m4+DJBRJp+v1yZB mhyGUJtjoJto+u3PKwiFGjD/T5gAXvsj7g47YjwcA1XOgFHHfnkvZYlOOP0t4OC9Dvfk 0jLx8F8FeQoBW2eMze3fUN6X/0WiVeFM5PSwTpYl5gBWq9v7xj2bZAL8Do6JxmnW9/uK MJzSLpYHN0H1t7YkNlxfY+xZKGOk+P5QtQPBRKfvCJIKpg6z2Btt61qobjWf3klWKAQX 9zIV5VHr9uT82tlbi4WfHF2Djy7xcMKWwXdeUQGBV5MnB6svWK4Wz+d0cMvAuSEmQjwZ zfnQ== X-Gm-Message-State: AOAM530xZefLkztAD5ynXifghNxd6QZZGYr7fCEFalwVtofg02KH/WUG nXyLRYfDXS6zSl7EKVMq/z0= X-Google-Smtp-Source: ABdhPJzEtJ9Sg4a2vOVNIx/4lbdFVp/bxHtTeMpseOoJWPVQCChWxpxX20RMHtpkvjPjfkA+EYpI9w== X-Received: by 2002:ac8:5dcf:: with SMTP id e15mr14402883qtx.567.1640035880556; Mon, 20 Dec 2021 13:31:20 -0800 (PST) Received: from localhost.localdomain ([181.23.83.92]) by smtp.gmail.com with ESMTPSA id s20sm16132210qtc.75.2021.12.20.13.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 13:31:20 -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 2/4] staging: vc04_services: avoid the use of typedef for function pointers Date: Mon, 20 Dec 2021 18:29:12 -0300 Message-Id: <7f681ccee713ef8600f40c765b6a59e119c6bf2c.1639858361.git.gascoar@gmail.com> 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_133121_796756_70EF6119 X-CRM114-Status: GOOD ( 14.32 ) 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 typedef bm2835_mmal_v4l2_ctrl_cb with equivalent declaration to better align with the linux kernel coding style. Signed-off-by: Gaston Gonzalez --- .../vc04_services/bcm2835-camera/controls.c | 76 +++++++++---------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index b096a12387f7..7782742396fc 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -65,13 +65,6 @@ enum bm2835_mmal_ctrl_type { MMAL_CONTROL_TYPE_CLUSTER, /* special cluster entry */ }; -struct bm2835_mmal_v4l2_ctrl; - -typedef int(bm2835_mmal_v4l2_ctrl_cb)( - struct bm2835_mmal_dev *dev, - struct v4l2_ctrl *ctrl, - const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl); - struct bm2835_mmal_v4l2_ctrl { u32 id; /* v4l2 control identifier */ enum bm2835_mmal_ctrl_type type; @@ -84,7 +77,8 @@ struct bm2835_mmal_v4l2_ctrl { u64 step; /* step size of the control */ const s64 *imenu; /* integer menu array */ u32 mmal_id; /* mmal parameter id */ - bm2835_mmal_v4l2_ctrl_cb *setter; + int (*bm2835_mmal_v4l2_ctrl_cb)(struct bm2835_mmal_dev *dev, struct v4l2_ctrl *ctrl, + const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl); }; struct v4l2_to_mmal_effects_setting { @@ -898,12 +892,12 @@ static int bm2835_mmal_s_ctrl(struct v4l2_ctrl *ctrl) const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl = ctrl->priv; int ret; - if (!mmal_ctrl || mmal_ctrl->id != ctrl->id || !mmal_ctrl->setter) { + if (!mmal_ctrl || mmal_ctrl->id != ctrl->id || !mmal_ctrl->bm2835_mmal_v4l2_ctrl_cb) { pr_warn("mmal_ctrl:%p ctrl id:%d\n", mmal_ctrl, ctrl->id); return -EINVAL; } - ret = mmal_ctrl->setter(dev, ctrl, mmal_ctrl); + ret = mmal_ctrl->bm2835_mmal_v4l2_ctrl_cb(dev, ctrl, mmal_ctrl); if (ret) pr_warn("ctrl id:%d/MMAL param %08X- returned ret %d\n", ctrl->id, mmal_ctrl->mmal_id, ret); @@ -924,7 +918,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_SATURATION, - .setter = ctrl_set_rational, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_rational, }, { .id = V4L2_CID_SHARPNESS, @@ -935,7 +929,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_SHARPNESS, - .setter = ctrl_set_rational, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_rational, }, { .id = V4L2_CID_CONTRAST, @@ -946,7 +940,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_CONTRAST, - .setter = ctrl_set_rational, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_rational, }, { .id = V4L2_CID_BRIGHTNESS, @@ -957,7 +951,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_BRIGHTNESS, - .setter = ctrl_set_rational, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_rational, }, { .id = V4L2_CID_ISO_SENSITIVITY, @@ -968,7 +962,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = iso_qmenu, .mmal_id = MMAL_PARAMETER_ISO, - .setter = ctrl_set_iso, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_iso, }, { .id = V4L2_CID_ISO_SENSITIVITY_AUTO, @@ -979,7 +973,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_ISO, - .setter = ctrl_set_iso, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_iso, }, { .id = V4L2_CID_IMAGE_STABILIZATION, @@ -990,7 +984,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_VIDEO_STABILISATION, - .setter = ctrl_set_value, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_value, }, { .id = V4L2_CID_EXPOSURE_AUTO, @@ -1001,7 +995,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 0, .imenu = NULL, .mmal_id = MMAL_PARAMETER_EXPOSURE_MODE, - .setter = ctrl_set_exposure, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_exposure, }, { .id = V4L2_CID_EXPOSURE_ABSOLUTE, @@ -1013,7 +1007,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_SHUTTER_SPEED, - .setter = ctrl_set_exposure, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_exposure, }, { .id = V4L2_CID_AUTO_EXPOSURE_BIAS, @@ -1024,7 +1018,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 0, .imenu = ev_bias_qmenu, .mmal_id = MMAL_PARAMETER_EXPOSURE_COMP, - .setter = ctrl_set_value_ev, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_value_ev, }, { .id = V4L2_CID_EXPOSURE_AUTO_PRIORITY, @@ -1036,7 +1030,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .imenu = NULL, /* Dummy MMAL ID as it gets mapped into FPS range */ .mmal_id = 0, - .setter = ctrl_set_exposure, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_exposure, }, { .id = V4L2_CID_EXPOSURE_METERING, @@ -1047,7 +1041,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 0, .imenu = NULL, .mmal_id = MMAL_PARAMETER_EXP_METERING_MODE, - .setter = ctrl_set_metering_mode, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_metering_mode, }, { .id = V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, @@ -1058,7 +1052,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 0, .imenu = NULL, .mmal_id = MMAL_PARAMETER_AWB_MODE, - .setter = ctrl_set_awb_mode, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_awb_mode, }, { .id = V4L2_CID_RED_BALANCE, @@ -1069,7 +1063,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_CUSTOM_AWB_GAINS, - .setter = ctrl_set_awb_gains, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_awb_gains, }, { .id = V4L2_CID_BLUE_BALANCE, @@ -1080,7 +1074,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_CUSTOM_AWB_GAINS, - .setter = ctrl_set_awb_gains, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_awb_gains, }, { .id = V4L2_CID_COLORFX, @@ -1091,7 +1085,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 0, .imenu = NULL, .mmal_id = MMAL_PARAMETER_IMAGE_EFFECT, - .setter = ctrl_set_image_effect, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_image_effect, }, { .id = V4L2_CID_COLORFX_CBCR, @@ -1102,7 +1096,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_COLOUR_EFFECT, - .setter = ctrl_set_colfx, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_colfx, }, { .id = V4L2_CID_ROTATE, @@ -1113,7 +1107,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 90, .imenu = NULL, .mmal_id = MMAL_PARAMETER_ROTATION, - .setter = ctrl_set_rotate, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_rotate, }, { .id = V4L2_CID_HFLIP, @@ -1124,7 +1118,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_MIRROR, - .setter = ctrl_set_flip, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_flip, }, { .id = V4L2_CID_VFLIP, @@ -1135,7 +1129,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_MIRROR, - .setter = ctrl_set_flip, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_flip, }, { .id = V4L2_CID_MPEG_VIDEO_BITRATE_MODE, @@ -1146,7 +1140,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 0, .imenu = NULL, .mmal_id = MMAL_PARAMETER_RATECONTROL, - .setter = ctrl_set_bitrate_mode, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_bitrate_mode, }, { .id = V4L2_CID_MPEG_VIDEO_BITRATE, @@ -1157,7 +1151,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 25 * 1000, .imenu = NULL, .mmal_id = MMAL_PARAMETER_VIDEO_BIT_RATE, - .setter = ctrl_set_bitrate, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_bitrate, }, { .id = V4L2_CID_JPEG_COMPRESSION_QUALITY, @@ -1168,7 +1162,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_JPEG_Q_FACTOR, - .setter = ctrl_set_image_encode_output, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_image_encode_output, }, { .id = V4L2_CID_POWER_LINE_FREQUENCY, @@ -1179,7 +1173,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_FLICKER_AVOID, - .setter = ctrl_set_flicker_avoidance, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_flicker_avoidance, }, { .id = V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER, @@ -1190,7 +1184,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_VIDEO_ENCODE_INLINE_HEADER, - .setter = ctrl_set_video_encode_param_output, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_video_encode_param_output, }, { .id = V4L2_CID_MPEG_VIDEO_H264_PROFILE, @@ -1204,7 +1198,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_PROFILE, - .setter = ctrl_set_video_encode_profile_level, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_video_encode_profile_level, }, { .id = V4L2_CID_MPEG_VIDEO_H264_LEVEL, @@ -1226,7 +1220,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_PROFILE, - .setter = ctrl_set_video_encode_profile_level, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_video_encode_profile_level, }, { .id = V4L2_CID_SCENE_MODE, @@ -1238,7 +1232,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_PROFILE, - .setter = ctrl_set_scene_mode, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_scene_mode, }, { .id = V4L2_CID_MPEG_VIDEO_H264_I_PERIOD, @@ -1249,7 +1243,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { .step = 1, .imenu = NULL, .mmal_id = MMAL_PARAMETER_INTRAPERIOD, - .setter = ctrl_set_video_encode_param_output, + .bm2835_mmal_v4l2_ctrl_cb = ctrl_set_video_encode_param_output, }, }; @@ -1259,8 +1253,8 @@ int bm2835_mmal_set_all_camera_controls(struct bm2835_mmal_dev *dev) int ret = 0; for (c = 0; c < V4L2_CTRL_COUNT; c++) { - if ((dev->ctrls[c]) && (v4l2_ctrls[c].setter)) { - ret = v4l2_ctrls[c].setter(dev, dev->ctrls[c], + if ((dev->ctrls[c]) && (v4l2_ctrls[c].bm2835_mmal_v4l2_ctrl_cb)) { + ret = v4l2_ctrls[c].bm2835_mmal_v4l2_ctrl_cb(dev, dev->ctrls[c], &v4l2_ctrls[c]); if (ret) { v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, 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 * From patchwork Mon Dec 20 21:29:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaston Gonzalez X-Patchwork-Id: 12696904 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 8DF9AC433EF for ; Mon, 20 Dec 2021 21:33:56 +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=NWuCY0arUOpBuKQnmQwQbGy68vkDCdVXJ+yc0Xb80d0=; b=S/DYpLzBxbSNOF zUxsbTxMxW9fJjDdDrhz4huxGqiSBAEHgXRzFo5bwtYHnuWAhaQyylTE+GCmQgGHTZ+KChWyBmKdu o1SomUDIkPJ/eviCw4vL2UAeNKbpdUb4AX+Y9S0f0KupfEj2vKdLbqk6h8j0mgShqBVVfb/hYTjE8 KAbIiY4A69s8sPS+mEBaOC6m3VRtXXJAb24lmWCHI2OHd9ZeD4b5RaFVg9bZjedwCsyFh+sLHlFVz F4UOVLpBYsNzPnJIQbTpfUzSnCDnW/EOk7fy71Y+gnfFg6TiAMR+PfCk6e+/OL95iutyBK3ypghRF /ejg5H8rUZT1rS5Bjr+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQGv-004VNP-SL; Mon, 20 Dec 2021 21:32:42 +0000 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQFo-004UmJ-AE; Mon, 20 Dec 2021 21:31:34 +0000 Received: by mail-qk1-x72f.google.com with SMTP id l25so10698627qkl.5; Mon, 20 Dec 2021 13:31:31 -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=zj4Z1AB35wd1vTKNBKFRSR6CiKchENns4ZR0v8Fns04=; b=GOR0MBa/Xmy00Aw3b2EieHWd7CevEII7rqbIH1TFVHaFKdc+fYX+8ELGhF9kBQtlPp z0ZPRv2mu7C/hIKRpXtuSChBuzewZU5PA/E+WbUVDvS0Vbv+PlYrCXHXwV+0KE7VOjUv BvFP75ohX2KULNxqsZtMK/IbRDn0q+xXgfL3zW26AgCdM4+c4042iC9UGvKARh1RdUjm qFteVVxJEVQaRld6ohFMOt0yS6Bw65KMFIr8nOX2uyUsZhvfKAFzRh/VGOAAO/pear3x iUVJKfQ3jmuTFf6MkSoD2SKUe+SzDE2BRv2JjKT37jhC6xChgxDbv6r8dt5BHDT8Ktya DFQw== 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=zj4Z1AB35wd1vTKNBKFRSR6CiKchENns4ZR0v8Fns04=; b=qu2a/Lu3eP4hIlNZGq+H4uZiE1I3tPbiVYekhaiFGottjuTHAAIA5T2aA+67g2VqNy HKhrIXgnmBxidVnLJcIYoEiA2+N6xY6uktCO/a7sd5HJ069Asd3fpWthSWQz2llKdkBr 0TBDIG3MYHrlbvb4zUPDLX4rSwVp/gaK8HUc6nGH0CiAHOSKFStIbVbzjWV8w7I/mtmA 78EcJllGYGdT+xhAsKlF6894/hZ2+ITY/d8T2S5rHw/i1LHRVZttityWw7edW0AuwgI4 7lqQRbpHFSBuz4THIamIWdvj7glwCkoagAMmv78UrkSolRn5lc0lpi7OD85QhRUs8b75 JA5A== X-Gm-Message-State: AOAM530G/miWQtbvT2MVxw93LMquNk9bbaM35Zg6GQcqHxB/M2KLrWoF i/sWM3MEqIcdD55+a95fUpw= X-Google-Smtp-Source: ABdhPJwt6/EGrHzCkJ2tXvrtDivRehX0CRfFibm2LENvRbcLBNB+fSJskiTi96LHjFD+g7S7ssn5rQ== X-Received: by 2002:a37:9ed5:: with SMTP id h204mr76593qke.35.1640035890318; Mon, 20 Dec 2021 13:31:30 -0800 (PST) Received: from localhost.localdomain ([181.23.83.92]) by smtp.gmail.com with ESMTPSA id s20sm16132210qtc.75.2021.12.20.13.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 13:31:30 -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 4/4] staging: vc04_services: update TODO file Date: Mon, 20 Dec 2021 18:29:14 -0300 Message-Id: <53c397198ee5f0294b88452cfe24321829a0837d.1639858361.git.gascoar@gmail.com> 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_133132_394130_02BC6C9C X-CRM114-Status: GOOD ( 13.58 ) 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 There are no typedef remaining under vc04_services/. Hence, remove the task from the TODO file. While at it, fix the items sequential numbering. Signed-off-by: Gaston Gonzalez --- drivers/staging/vc04_services/interface/TODO | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/staging/vc04_services/interface/TODO index 39810ce017cd..241ca004735c 100644 --- a/drivers/staging/vc04_services/interface/TODO +++ b/drivers/staging/vc04_services/interface/TODO @@ -80,11 +80,7 @@ vchiq-core.ko and vchiq-dev.ko. This would also ease the upstreaming process. The code in vchiq_bcm2835_arm.c should fit in the generic platform file. -12) Get rid of all the struct typedefs - -Most structs are typedefd, it's not encouraged in the kernel. - -13) Get rid of all non essential global structures and create a proper per +11) Get rid of all non essential global structures and create a proper per device structure The first thing one generally sees in a probe function is a memory allocation @@ -92,6 +88,6 @@ for all the device specific data. This structure is then passed all over the driver. This is good practice since it makes the driver work regardless of the number of devices probed. -14) Clean up Sparse warnings from __user annotations. See +12) Clean up Sparse warnings from __user annotations. See vchiq_irq_queue_bulk_tx_rx(). Ensure that the address of "&waiter->bulk_waiter" is never disclosed to userspace.