From: Dan Carpenter <dan.carpenter@oracle.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: devel@driverdev.osuosl.org, linux-renesas-soc@vger.kernel.org,
linux-media@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Daeseok Youn" <daeseok.youn@gmail.com>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
adi-buildroot-devel@lists.sourceforge.net,
"Hans Verkuil" <hverkuil@xs4all.nl>,
linux-ide@vger.kernel.org, "Guenter Roeck" <linux@roeck-us.net>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Tejun Heo" <tj@kernel.org>,
akpm@linux-foundation.org,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Robert Jarzmik" <robert.jarzmik@free.fr>,
linux-arm-kernel@lists.infradead.org,
"Alan Cox" <alan@linux.intel.com>
Subject: Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool
Date: Fri, 14 Jul 2017 15:41:32 +0300 [thread overview]
Message-ID: <20170714124132.u3fzpetbh3b7gj7f@mwanda> (raw)
In-Reply-To: <20170714093938.1469319-1-arnd@arndb.de>
On Fri, Jul 14, 2017 at 11:36:56AM +0200, Arnd Bergmann wrote:
> @@ -1158,7 +1158,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
> */
> fmt_src.pad = pad->index;
> fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE;
> - if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) {
> + ret = v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src);
> + if (!ret) {
> fmt_info = omap3isp_video_format_info(fmt_src.format.code);
> depth_in = fmt_info->width;
> }
Is the original code buggy?
media/platform/omap3isp/ispccdc.c
1156 /* Compute the lane shifter shift value and enable the bridge when the
1157 * input format is a non-BT.656 YUV variant.
1158 */
1159 fmt_src.pad = pad->index;
1160 fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE;
1161 if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) {
1162 fmt_info = omap3isp_video_format_info(fmt_src.format.code);
1163 depth_in = fmt_info->width;
1164 }
If v4l2_subdev_call() then depth_in is zero.
1165
1166 fmt_info = omap3isp_video_format_info(format->code);
1167 depth_out = fmt_info->width;
1168 shift = depth_in - depth_out;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
How do we know that this subtraction doesn't set "shift" to a very high
positive?
1169
1170 if (ccdc->bt656)
1171 bridge = ISPCTRL_PAR_BRIDGE_DISABLE;
1172 else if (fmt_info->code == MEDIA_BUS_FMT_YUYV8_2X8)
1173 bridge = ISPCTRL_PAR_BRIDGE_LENDIAN;
1174 else if (fmt_info->code == MEDIA_BUS_FMT_UYVY8_2X8)
1175 bridge = ISPCTRL_PAR_BRIDGE_BENDIAN;
1176 else
1177 bridge = ISPCTRL_PAR_BRIDGE_DISABLE;
1178
1179 omap3isp_configure_bridge(isp, ccdc->input, parcfg, shift, bridge);
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-07-14 12:41 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 9:25 [PATCH 00/14] gcc-7 warnings Arnd Bergmann
2017-07-14 9:25 ` [PATCH, RESEND 01/14] ide: avoid warning for timings calculation Arnd Bergmann
2017-07-14 9:25 ` [PATCH, RESEND 02/14] ata: avoid gcc-7 warning in ata_timing_quantize Arnd Bergmann
2017-07-15 10:56 ` Tejun Heo
2017-07-14 9:25 ` [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning Arnd Bergmann
2017-07-14 10:11 ` Jani Nikula
2017-07-14 19:21 ` Linus Torvalds
2017-07-14 19:23 ` Linus Torvalds
2017-07-14 20:28 ` Arnd Bergmann
2017-07-17 13:15 ` Sinclair Yeh
2017-07-14 9:25 ` [PATCH 04/14] x86: math-emu: avoid -Wint-in-bool-context warning Arnd Bergmann
2017-07-14 9:25 ` [PATCH 05/14] isdn: isdnloop: suppress a gcc-7 warning Arnd Bergmann
2017-07-14 10:08 ` Joe Perches
2017-07-14 10:37 ` Arnd Bergmann
2017-07-15 4:20 ` Kevin Easton
2017-07-14 9:25 ` [PATCH 06/14] acpi: thermal: fix gcc-6/ccache warning Arnd Bergmann
2017-07-14 9:25 ` [PATCH 07/14] proc/kcore: hide a harmless warning Arnd Bergmann
2017-07-14 12:28 ` Ard Biesheuvel
2017-07-18 19:53 ` Arnd Bergmann
2017-07-18 19:55 ` Ard Biesheuvel
2017-07-18 20:01 ` Arnd Bergmann
2017-07-18 20:07 ` Ard Biesheuvel
2017-07-18 20:21 ` Arnd Bergmann
2017-07-14 9:25 ` [PATCH 08/14] Input: adxl34x - fix gcc-7 -Wint-in-bool-context warning Arnd Bergmann
2017-07-14 19:24 ` Linus Torvalds
2017-07-14 20:17 ` Arnd Bergmann
2017-07-14 21:40 ` Dmitry Torokhov
2017-07-14 9:30 ` [PATCH 09/14] SFI: fix tautological-compare warning Arnd Bergmann
2017-07-14 9:31 ` [PATCH 10/14] staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read Arnd Bergmann
2017-07-15 11:42 ` Jonathan Cameron
2017-07-14 9:31 ` [PATCH 11/14] IB/uverbs: fix gcc-7 type warning Arnd Bergmann
2017-07-14 9:46 ` Leon Romanovsky
2017-07-14 9:31 ` [PATCH 12/14] drm/nouveau/clk: fix gcc-7 -Wint-in-bool-context warning Arnd Bergmann
2017-07-14 9:31 ` [PATCH 13/14] iopoll: avoid " Arnd Bergmann
2017-07-14 9:55 ` Joe Perches
2017-07-14 10:22 ` Arnd Bergmann
2017-07-14 9:36 ` [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool Arnd Bergmann
2017-07-14 12:05 ` Dan Carpenter
2017-07-14 12:27 ` Arnd Bergmann
2017-07-14 12:55 ` Dan Carpenter
2017-07-14 13:09 ` Dan Carpenter
2017-07-14 19:32 ` Arnd Bergmann
2017-07-14 12:41 ` Dan Carpenter [this message]
2017-07-17 13:45 ` Hans Verkuil
2017-07-17 14:26 ` Arnd Bergmann
2017-07-17 14:28 ` Dan Carpenter
2017-07-17 14:32 ` Hans Verkuil
2017-07-17 14:35 ` Hans Verkuil
2017-07-17 21:23 ` Arnd Bergmann
2017-07-14 10:29 ` [PATCH 00/14] gcc-7 warnings Greg Kroah-Hartman
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=20170714124132.u3fzpetbh3b7gj7f@mwanda \
--to=dan.carpenter@oracle.com \
--cc=adi-buildroot-devel@lists.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=alan@linux.intel.com \
--cc=arnd@arndb.de \
--cc=daeseok.youn@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=robert.jarzmik@free.fr \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).