From: Stefan Wahren <wahrenst@gmx.net>
To: Eric Anholt <eric@anholt.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dave Stevenson <dave.stevenson@raspberrypi.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: devel@driverdev.osuosl.org, linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org
Subject: [PATCH 31/31] staging: bcm2835-camera: Correct ctrl min/max/step/def to 64bit
Date: Thu, 27 Jun 2019 23:09:29 +0200 [thread overview]
Message-ID: <1561669769-2498-5-git-send-email-wahrenst@gmx.net> (raw)
In-Reply-To: <1561669769-2498-1-git-send-email-wahrenst@gmx.net>
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
The V4L2 control API was expanded to take 64 bit values in commit
0ba2aeb6dab (Apr 16 2014), but as this driver wasn't in the mainline
kernel at that point this was overlooked.
Update to use 64 bit values. This also fixes a couple of warnings
in 64 bit builds.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/staging/vc04_services/bcm2835-camera/controls.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c
index 848b14a..89786c2 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
@@ -78,10 +78,10 @@ struct bm2835_mmal_v4l2_ctrl {
/* control minimum value or
* mask for MMAL_CONTROL_TYPE_STD_MENU
*/
- s32 min;
- s32 max; /* maximum value of control */
- s32 def; /* default value of control */
- s32 step; /* step size of the control */
+ s64 min;
+ s64 max; /* maximum value of control */
+ s64 def; /* default value of control */
+ 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;
@@ -1250,7 +1250,7 @@ int bm2835_mmal_init_controls(struct bm2835_mmal_dev *dev,
case MMAL_CONTROL_TYPE_STD_MENU:
{
- int mask = ctrl->min;
+ u64 mask = ctrl->min;
if (ctrl->id == V4L2_CID_SCENE_MODE) {
/* Special handling to work out the mask
@@ -1260,11 +1260,11 @@ int bm2835_mmal_init_controls(struct bm2835_mmal_dev *dev,
*/
int i;
- mask = 1 << V4L2_SCENE_MODE_NONE;
+ mask = BIT(V4L2_SCENE_MODE_NONE);
for (i = 0;
i < ARRAY_SIZE(scene_configs);
i++) {
- mask |= 1 << scene_configs[i].v4l2_scene;
+ mask |= BIT(scene_configs[i].v4l2_scene);
}
mask = ~mask;
}
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-06-27 21:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 21:09 [PATCH 27/31] staging: mmal-vchiq: Avoid use of bool in structures Stefan Wahren
2019-06-27 21:09 ` [PATCH 28/31] staging: bcm2835-camera: Fix stride on RGB3/BGR3 formats Stefan Wahren
2019-06-27 21:09 ` [PATCH 29/31] staging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS Stefan Wahren
2019-06-28 8:12 ` Dan Carpenter
2019-06-27 21:09 ` [PATCH 30/31] staging: bcm2835-camera: Set the field value within ach buffer Stefan Wahren
2019-06-27 21:09 ` Stefan Wahren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1561669769-2498-5-git-send-email-wahrenst@gmx.net \
--to=wahrenst@gmx.net \
--cc=dave.stevenson@raspberrypi.org \
--cc=devel@driverdev.osuosl.org \
--cc=eric@anholt.net \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox