Hans Verkuil [Fri, 3 Apr 2015 10:22:40 +0000 (07:22 -0300)]
[media] cx88: v4l2-compliance fixes
Fix three v4l2-compliance failures:
- the colorspace wasn't set in vidioc_try_fmt_vid_cap().
- the field wasn't set in v4l2_buffer when vb2_buffer_done() was called.
- the sequence wasn't set in v4l2_buffer when vb2_buffer_done() was called.
This fix also removes the unused buf->count field and starts the count
at 0 instead of 1.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Tue, 21 Apr 2015 13:39:49 +0000 (10:39 -0300)]
[media] vivid: drop format description
The format description is now filled in by the core, so we can
drop this in this virtual driver.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Tue, 21 Apr 2015 13:39:30 +0000 (10:39 -0300)]
[media] vim2m: drop format description
The format description is now filled in by the core, so we can
drop this in this virtual m2m driver.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Tue, 21 Apr 2015 13:38:32 +0000 (10:38 -0300)]
[media] v4l2-pci-skeleton: drop format description
The format description is now filled in by the core, so we can
drop this in this skeleton driver.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Fri, 1 May 2015 09:54:03 +0000 (06:54 -0300)]
v4l2-ioctl: add a missing break at v4l_fill_fmtdesc()
The changeset
ba3002045f8022 added a logic at the core to fill
the format description, however, a break is missing on one of
the formats, as reported by smatch:
drivers/media/v4l2-core/v4l2-ioctl.c:1211 v4l_fill_fmtdesc() warn: missing break? reassigning 'descr'
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Fri, 20 Mar 2015 12:05:22 +0000 (09:05 -0300)]
[media] v4l2-ioctl: fill in the description for VIDIOC_ENUM_FMT
The descriptions used in drivers for the formats returned with ENUM_FMT
are all over the place.
So instead allow the core to fill them in if the driver didn't. This
allows drivers to drop the description and flags.
Based on an earlier patch from Philipp Zabel:
http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/81411
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 23:32:48 +0000 (20:32 -0300)]
[media] m2m-deinterlace: remove dead code
As reported by smatch:
drivers/media/platform/m2m-deinterlace.c:1063 deinterlace_probe() info: ignoring unreachable code.
There's no need to call v4l2_m2m_release() here, as the last possible
failure in this code is to allocate the m2m struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 23:29:10 +0000 (20:29 -0300)]
[media] cx23885: fix bad indentation
drivers/media/pci/cx23885/altera-ci.c:762 altera_ci_init() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 23:24:56 +0000 (20:24 -0300)]
[media] vivid: fix bad indenting
drivers/media/platform/vivid/vivid-vid-out.c:1155 vivid_vid_out_g_parm() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 23:22:20 +0000 (20:22 -0300)]
[media] xirlink_cit: comment unreachable code
drivers/media/usb/gspca/xirlink_cit.c:1776 cit_start_model2() info: ignoring unreachable code.
drivers/media/usb/gspca/xirlink_cit.c:1858 cit_start_model2() info: ignoring unreachable code.
drivers/media/usb/gspca/xirlink_cit.c:1910 cit_start_model2() info: ignoring unreachable code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 23:19:20 +0000 (20:19 -0300)]
[media] dw2102: fix bad indenting
drivers/media/usb/dvb-usb/dw2102.c:440 dw2104_i2c_transfer() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 20:17:24 +0000 (17:17 -0300)]
[media] af9005: fix bad indenting
drivers/media/usb/dvb-usb/af9005-fe.c:484 af9005_fe_read_status() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 20:16:27 +0000 (17:16 -0300)]
[media] dib0700: fix bad indentation
drivers/media/usb/dvb-usb/dib0700_devices.c:864 dib7770_set_param_override() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 20:14:31 +0000 (17:14 -0300)]
[media] saa7134: fix bad indenting
drivers/media/pci/saa7134/saa7134-dvb.c:1682 dvb_init() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 20:11:35 +0000 (17:11 -0300)]
[media] usbvision: fix bad indentation
drivers/media/usb/usbvision/usbvision-core.c:2395 usbvision_init_isoc() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 20:10:47 +0000 (17:10 -0300)]
[media] s5p-mfc: fix bad indentation
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c:187 s5p_mfc_alloc_codec_buffers_v5() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 20:09:50 +0000 (17:09 -0300)]
[media] ttusb-dec: fix bad indentation
drivers/media/usb/ttusb-dec/ttusb_dec.c:1434 ttusb_dec_init_stb() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 23:06:07 +0000 (20:06 -0300)]
[media] bttv: fix audio hooks
as reported by smatch:
drivers/media/pci/bt8xx/bttv-audio-hook.c:201 lt9415_audio() warn: bitwise AND condition is false here
drivers/media/pci/bt8xx/bttv-audio-hook.c:241 winfast2000_audio() warn: bitwise AND condition is false here
drivers/media/pci/bt8xx/bttv-audio-hook.c:276 pvbt878p9b_audio() warn: bitwise AND condition is false here
drivers/media/pci/bt8xx/bttv-audio-hook.c:307 fv2000s_audio() warn: bitwise AND condition is false here
drivers/media/pci/bt8xx/bttv-audio-hook.c:334 windvr_audio() warn: bitwise AND condition is false here
drivers/media/pci/bt8xx/bttv-audio-hook.c:371 adtvk503_audio() warn: bitwise AND condition is false here
there are some serious issues at the audio hook implementation.
They're not following what's specified at the DocBook:
http://linuxtv.org/downloads/v4l-dvb-apis/vidioc-g-tuner.html#tuner-audmode
Basically, it was assuming that the audmode (V4L2_TUNER_MODE_foo)
is a variable with a bit maskk. However, it isn't.
The bitmask only applies to rxsubchans field (V4L2_TUNER_SUB_foo).
As the code is also too complex, and not all hooks were returning
both audmode and rxsubchans to a VIDIOC_G_TUNER, rewrite the
functions, in order to fix both for get and set tuner ioctls.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:48:10 +0000 (15:48 -0300)]
[media] tda10086: change typecast to u64 to avoid smatch warnings
drivers/media/dvb-frontends/tda10086.c:476 tda10086_get_frontend() warn: should 'tda10086_read_byte(state, 81) << 8' be a 64 bit type?
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:46:24 +0000 (15:46 -0300)]
[media] s5h1420: use only one statement per line
drivers/media/dvb-frontends/s5h1420.c:565 s5h1420_setfec_inversion() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:41:45 +0000 (15:41 -0300)]
[media] stv0900: fix bad indenting
drivers/media/dvb-frontends/stv0900_sw.c:1559 stv0900_search_srate_fine() warn: inconsistent indenting
drivers/media/dvb-frontends/stv0900_sw.c:2012 stv0900_algo() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:18:20 +0000 (15:18 -0300)]
[media] cx25840: fix bad identing
drivers/media/i2c/cx25840/cx25840-core.c:974 input_change() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:14:40 +0000 (15:14 -0300)]
[media] pvrusb2: fix inconsistent indenting
smatch complains about multiple issues here:
drivers/media/usb/pvrusb2/pvrusb2-context.c:402 pvr2_channel_claim_stream() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-ioread.c:240 pvr2_ioread_setup() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-ioread.c:255 pvr2_ioread_set_enabled() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-ioread.c:485 pvr2_ioread_read() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-io.c:522 pvr2_stream_set_callback() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-io.c:561 pvr2_stream_set_buffer_count() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-io.c:640 pvr2_buffer_queue() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-io.c:667 pvr2_buffer_set_buffer() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-io.c:668 pvr2_buffer_set_buffer() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2614 pvr2_hdw_create() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2740 pvr2_hdw_destroy() warn: inconsistent indenting
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3353 pvr2_hdw_trigger_module_log() warn: inconsistent indenting
Let's get rid of those, in order to cleanup as much as possible the smatch error log.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:06:20 +0000 (15:06 -0300)]
[media] stk014: fix bad indenting
drivers/media/usb/gspca/stk014.c:279 sd_start() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:05:28 +0000 (15:05 -0300)]
[media] sonixj: fix bad indenting
drivers/media/usb/gspca/sonixj.c:1792 expo_adjust() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 18:00:30 +0000 (15:00 -0300)]
[media] redrat3: change return argument on redrat3_send_cmd() to int
redrat3_send_cmd() can return an error or the read data. However,
it currently returns an u8, as reported by smatch:
drivers/media/rc/redrat3.c:416 redrat3_send_cmd() warn: signedness bug returning '(-12)'
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 17:56:50 +0000 (14:56 -0300)]
[media] vp702x: comment dead code
Since the first version of this driver, the remote controller
code is disabled, adding an early return inside vp702x_rc_query().
Let's disable the code with #if 0, to remove this warning:
drivers/media/usb/dvb-usb/vp702x.c:268 vp702x_rc_query() info: ignoring unreachable code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 15:44:18 +0000 (12:44 -0300)]
[media] go7007: Comment some dead code
drivers/media/usb/go7007/go7007-usb.c:1099 go7007_usb_probe() info: ignoring unreachable code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 15:23:49 +0000 (12:23 -0300)]
[media] dib0070: Fix indenting
The indentation on this driver were deadly broken. On lots
of places, it was using 4 spaces instead of tab to indent.
On other parts, it were using tabs.
Also, on several places, it were not even being properly aligned,
as reported by smatch:
drivers/media/dvb-frontends/dib0070.c:179 dib0070_set_bandwidth() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:198 dib0070_captrim() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:246 dib0070_set_ctrl_lo5() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:260 dib0070_ctrl_agc_filter() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:494 dib0070_tune_digital() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:498 dib0070_tune_digital() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:655 dib0070_reset() warn: inconsistent indenting
drivers/media/dvb-frontends/dib0070.c:711 dib0070_reset() warn: curly braces intended?
drivers/media/dvb-frontends/dib0070.c:713 dib0070_reset() warn: inconsistent indenting
My first idea were to leave it as-is or to just touch the above.
However, this won't be fixing anything. So, as painful as it
is, let's fix indentation globally on the driver, and then
address the inconsistencies.
Hopefully, this driver doesn't have much patches, so it likely
won't conflict to any other patch during this merge window.
Besides the big size of this patch, no functional changes
were done.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 13:06:17 +0000 (10:06 -0300)]
[media] dib3000mc: fix bad indenting
drivers/media/dvb-frontends/dib3000mc.c:149 dib3000mc_setup_pwm_state() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 13:00:39 +0000 (10:00 -0300)]
[media] cx231xx: fix bad indenting
drivers/media/usb/cx231xx/cx231xx-avcore.c:1598 cx231xx_set_DIF_bandpass() warn: inconsistent indenting
drivers/media/usb/cx231xx/cx231xx-core.c:656 cx231xx_demod_reset() warn: inconsistent indenting
drivers/media/usb/cx231xx/cx231xx-core.c:659 cx231xx_demod_reset() warn: inconsistent indenting
drivers/media/usb/cx231xx/cx231xx-core.c:664 cx231xx_demod_reset() warn: inconsistent indenting
drivers/media/usb/cx231xx/cx231xx-core.c:669 cx231xx_demod_reset() warn: inconsistent indenting
drivers/media/usb/cx231xx/cx231xx-core.c:673 cx231xx_demod_reset() warn: inconsistent indenting
drivers/media/usb/cx231xx/cx231xx-417.c:1164 cx231xx_initialize_codec() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:50:41 +0000 (09:50 -0300)]
[media] ov7670: check read error also for REG_AECHH on ov7670_s_exp()
ov7670_s_exp() checks read error for 2 registers: REG_COM1
and REG_COM8. But, although it uses the value latter, it
doesn't check errors on REG_AECHH read. Yet, as it is doing
a bitmask operation there, the read operation should succeed.
So, fix the code to also check if this succeeded.
This fixes this smatch report:
drivers/media/i2c/ov7670.c:1366 ov7670_s_exp() warn: inconsistent indenting
Compile-tested only.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:46:24 +0000 (09:46 -0300)]
[media] stv0297: change typecast to u64 to avoid smatch warnings
drivers/media/dvb-frontends/stv0297.c:140 stv0297_get_symbolrate() warn: should 'stv0297_readreg(state, 86) << 8' be a 64 bit type?
drivers/media/dvb-frontends/stv0297.c:141 stv0297_get_symbolrate() warn: should 'stv0297_readreg(state, 87) << 16' be a 64 bit type?
drivers/media/dvb-frontends/stv0297.c:142 stv0297_get_symbolrate() warn: should 'stv0297_readreg(state, 88) << 24' be a 64 bit type?
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:42:43 +0000 (09:42 -0300)]
[media] zl10353: fix indenting
drivers/media/dvb-frontends/zl10353.c:536 zl10353_read_ucblocks() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:41:34 +0000 (09:41 -0300)]
[media] bttv: fix indenting
drivers/media/pci/bt8xx/bttv-driver.c:2679 bttv_s_fbuf() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:40:24 +0000 (09:40 -0300)]
[media] r820t: fix identing
drivers/media/tuners/r820t.c:945 r820t_sysfreq_sel() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:38:59 +0000 (09:38 -0300)]
[media] tda1004x: fix identation
drivers/media/dvb-frontends/tda1004x.c:653 tda10046_init() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:38:06 +0000 (09:38 -0300)]
[media] mantis: remove dead code
drivers/media/pci/mantis/mantis_cards.c:229 mantis_pci_probe() info: ignoring unreachable code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Wed, 29 Apr 2015 12:33:02 +0000 (09:33 -0300)]
[media] qt1010: avoid going past array
As reported by smatch:
drivers/media/tuners/qt1010.c:357 qt1010_init() error: buffer overflow 'i2c_data' 34 <= 34
This should not happen with the current code, as the i2c_data array
doesn't end with a QT1010_M1, but it doesn't hurt add a BUG_ON
to notify if one modifies it and breaks.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 23:00:55 +0000 (20:00 -0300)]
[media] vivid-radio-rx: Don't go past buffer
drivers/media/platform/vivid/vivid-radio-rx.c:198 vivid_radio_rx_s_hw_freq_seek() error: buffer overflow 'vivid_radio_bands' 3 <= 3
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 22:49:07 +0000 (19:49 -0300)]
[media] zc3xx: remove dead code and uneeded gotos
As reported by smatch:
drivers/media/usb/gspca/zc3xx.c:5994 transfer_update() info: ignoring unreachable code.
That happens because there's a return that it is never called,
as the work queue runs an infinite loop, except when the device is
put to sleep or an error happens.
When an error happens, a break statement is enough to go out of
the loop. So, let's remove the goto, as break is the typical
instruction used to end a loop.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 22:39:53 +0000 (19:39 -0300)]
[media] zc3xx: don't go past quality array
drivers/media/usb/gspca/zc3xx.c:6363 zcxx_s_ctrl() error: buffer overflow 'jpeg_qual' 3 <= 3
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 22:03:59 +0000 (19:03 -0300)]
[media] cx24117: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up much more values:
drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 22:02:19 +0000 (19:02 -0300)]
[media] af9013: Don't accept invalid bandwidth
If userspace sends an invalid bandwidth, it should either return
EINVAL or switch to auto mode.
This driver will go past an array and program the hardware on a
wrong way if this happens.
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:51:17 +0000 (18:51 -0300)]
[media] cx24116: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up much more values:
drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:34:40 +0000 (18:34 -0300)]
[media] s5h1420: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up to 7 values:
drivers/media/dvb-frontends/s5h1420.c:193 s5h1420_send_master_cmd() error: buffer overflow 'cmd->msg' 6 <= 7
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:46:13 +0000 (18:46 -0300)]
[media] stv0288: fix indentation
drivers/media/dvb-frontends/stv0288.c:137 stv0288_set_symbolrate() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:31:21 +0000 (18:31 -0300)]
[media] lgdt3306a: fix indentation
drivers/media/dvb-frontends/lgdt3306a.c:2104 lgdt3306a_DumpRegs() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:29:05 +0000 (18:29 -0300)]
[media] dib3000mc: Fix indentation
drivers/media/dvb-frontends/dib3000mc.c:134 dib3000mc_setup_pwm_state() warn: inconsistent indenting
drivers/media/dvb-frontends/dib3000mc.c:144 dib3000mc_setup_pwm_state() warn: inconsistent indenting
drivers/media/dvb-frontends/dib3000mc.c:420 dib3000mc_sleep() warn: inconsistent indenting
drivers/media/dvb-frontends/dib3000mc.c:453 dib3000mc_set_channel_cfg() warn: inconsistent indenting
The last one is actually due to a commented code. Let's rework
it, in order to remove the sparse warning without removing the
dead code, as it may be useful in the future.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:25:14 +0000 (18:25 -0300)]
[media] bcm3510: fix indentation
drivers/media/dvb-frontends/bcm3510.c:688 bcm3510_reset() warn: inconsistent indenting
drivers/media/dvb-frontends/bcm3510.c:711 bcm3510_clear_reset() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 21:18:28 +0000 (18:18 -0300)]
[media] benq: fix indentation
drivers/media/usb/gspca/benq.c:239 sd_isoc_irq() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 20:09:23 +0000 (17:09 -0300)]
[media] go7007: don't use vb before test if it is not NULL
As reported by smatch:
drivers/media/usb/go7007/go7007-driver.c:452 frame_boundary() warn: variable dereferenced before check 'vb' (see line 449)
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 15:39:02 +0000 (12:39 -0300)]
[media] qt1010: Reduce text size by using static const
Using static const allows the compiler to optimize the code.
Before static const:
text data bss dec hex filename
4982 524 1568 7074 1ba2 drivers/media/tuners/qt1010.o
After static const:
text data bss dec hex filename
4714 524 1568 6806 1a96 drivers/media/tuners/qt1010.o
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 15:32:25 +0000 (12:32 -0300)]
[media] wl128x: fix int type for streg_cbdata
The streg_cbdata can have a negative error value. So, it should be
an integer, and not u8, as reported by smatch:
drivers/media/radio/wl128x/fmdrv_common.c:1517 fmc_prepare() warn: assigning (-115) to unsigned variable 'fmdev->streg_cbdata'
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 15:23:56 +0000 (12:23 -0300)]
[media] ir-sony-decoder: shutup smatch warnings
There are some false-positive warnings produced by smatch:
drivers/media/rc/ir-sony-decoder.c:129 ir_sony_decode() warn: missing break? reassigning 'data->state'
drivers/media/rc/ir-sony-decoder.c:137 ir_sony_decode() warn: missing break? reassigning 'data->state'
drivers/media/rc/ir-sony-decoder.c:165 ir_sony_decode() warn: missing break? reassigning 'data->state'
This is due to the logic used there to detect the need of a break.
While those are false positives, it is easy to get rid of them without
any drawbacks. The side effect is a cleaner function, with is good.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 15:16:52 +0000 (12:16 -0300)]
[media] s5p_mfc: remove a dead code
As reported by smatch:
drivers/media/platform/s5p-mfc/s5p_mfc.c:1340 s5p_mfc_runtime_resume() warn: this array is probably non-NULL. 'm_dev->alloc_ctx'
alloc_ctx can never be NULL, as it is embeeded inside the struct
s5p_mfc_dev.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 15:12:09 +0000 (12:12 -0300)]
[media] s3c-camif: Check if fmt is NULL before use
As reported by smatch:
drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup() warn: variable dereferenced before check 'fmt' (see line 460)
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 14:13:09 +0000 (11:13 -0300)]
[media] zoran: fix indent
As reported by smatch:
drivers/media/pci/zoran/zoran_device.c:1594 zoran_init_hardware() warn: inconsistent indenting
Fix indent. While here, fix CodingStyle and remove dead code, as it
can always be recovered from git logs.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 13:35:13 +0000 (10:35 -0300)]
[media] ivtv: avoid going past input/audio array
As reported by smatch:
drivers/media/pci/ivtv/ivtv-driver.c:832 ivtv_init_struct2() error: buffer overflow 'itv->card->video_inputs' 6 <= 6
That happens because nof_inputs and nof_audio_inputs can be initialized
as IVTV_CARD_MAX_VIDEO_INPUTS, instead of IVTV_CARD_MAX_VIDEO_INPUTS - 1.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 13:33:57 +0000 (10:33 -0300)]
[media] radio-si476x: Fix indent
As reported by smatch:
drivers/media/radio/radio-si476x.c:571 si476x_radio_do_post_powerup_init() warn: inconsistent indenting
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 13:28:13 +0000 (10:28 -0300)]
[media] saa717x: fix multi-byte read code
As reported by smatch:
drivers/media/i2c/saa717x.c:155 saa717x_read() warn: mask and shift to zero
drivers/media/i2c/saa717x.c:155 saa717x_read() warn: mask and shift to zero
This is done right at saa717x_write(), but the read function is
broken. Thankfully, there's just one place at saa717x driver that
uses multibyte read (for status report, via printk).
Yet, let's fix it. From saa717x_write(), it is clear that the
bytes are in little endian:
mm1[4] = (value >> 16) & 0xff;
mm1[3] = (value >> 8) & 0xff;
mm1[2] = value & 0xff;
So, the same order should be valid for read too.
Compile-tested only.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 13:07:01 +0000 (10:07 -0300)]
[media] saa7164: Check if dev is NULL before dereferencing it
As reported by smatch:
drivers/media/pci/saa7164/saa7164-core.c:631 saa7164_irq() warn: variable dereferenced before check 'dev' (see line 621)
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 13:02:07 +0000 (10:02 -0300)]
[media] ngene: preventing dereferencing a NULL pointer
As reported by smatch:
drivers/media/pci/ngene/ngene-core.c:1529 init_channel() error: we previously assumed 'chan->fe' could be null (see line 1521)
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 12:56:01 +0000 (09:56 -0300)]
[media] saa7134: fix indent issues
As reported by smatch:
drivers/media/pci/saa7134/saa7134-cards.c:7197 saa7134_xc2028_callback() warn: inconsistent indenting
drivers/media/pci/saa7134/saa7134-cards.c:7846 saa7134_board_init2() warn: inconsistent indenting
drivers/media/pci/saa7134/saa7134-cards.c:7913 saa7134_board_init2() warn: inconsistent indenting
While here, fix a few CodingStyle issues on the affected code
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 12:50:36 +0000 (09:50 -0300)]
[media] cx18: avoid going past input/audio array
As reported by smatch:
drivers/media/pci/cx18/cx18-driver.c:807 cx18_init_struct2() error: buffer overflow 'cx->card->video_inputs' 6 <= 6
That happens because nof_inputs and nof_audio_inputs can be initialized
as CX18_CARD_MAX_VIDEO_INPUTS, instead of CX18_CARD_MAX_VIDEO_INPUTS - 1.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 12:43:17 +0000 (09:43 -0300)]
[media] rc: fix bad indenting
drivers/media/rc/rc-main.c:749 rc_close() warn: inconsistent indenting
There's an extra space there.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 11:57:26 +0000 (08:57 -0300)]
[media] am437x: remove unused variable
drivers/media/platform/am437x/am437x-vpfe.c: In function 'vpfe_get_subdev_input_index':
drivers/media/platform/am437x/am437x-vpfe.c:1679:27: warning: variable 'sdinfo' set but not used [-Wunused-but-set-variable]
struct vpfe_subdev_info *sdinfo;
^
Cc: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 11:55:46 +0000 (08:55 -0300)]
[media] am437x: Fix a wrong identation
drivers/media/platform/am437x/am437x-vpfe.c:513 vpfe_ccdc_set_params() warn: inconsistent indenting
Cc: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 11:48:15 +0000 (08:48 -0300)]
[media] am437x-vpfe: really update the vpfe_ccdc_update_raw_params data
drivers/media/platform/am437x/am437x-vpfe.c: In function 'vpfe_ccdc_update_raw_params':
drivers/media/platform/am437x/am437x-vpfe.c:430:38: warning: variable 'config_params' set but not used [-Wunused-but-set-variable]
struct vpfe_ccdc_config_params_raw *config_params =
^
vpfe_ccdc_update_raw_params() is supposed to update the raw
params at ccdc. However, it is just creating a local var and changing
it.
Compile-tested only.
Cc: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 27 Apr 2015 07:29:55 +0000 (04:29 -0300)]
[media] radio-bcm2048: fix compiler warning
radio-bcm2048.c: In function 'bcm2048_i2c_driver_probe':
radio-bcm2048.c:2597:11: warning: variable 'skip_release' set but not used [-Wunused-but-set-variable]
int err, skip_release = 0;
^
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Tue, 28 Apr 2015 12:28:45 +0000 (09:28 -0300)]
[media] dib8000: fix compiler warning
In file included from include/uapi/linux/posix_types.h:4:0,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/uapi/linux/sysinfo.h:4,
from include/uapi/linux/kernel.h:4,
from include/linux/cache.h:4,
from include/linux/time.h:4,
from include/linux/input.h:11,
from drivers/media/usb/dvb-usb/dvb-usb.h:13,
from drivers/media/usb/dvb-usb/dib0700.h:13,
from drivers/media/usb/dvb-usb/dib0700_devices.c:9:
drivers/media/dvb-frontends/dib8000.h: In function 'dib8000_attach':
include/linux/stddef.h:8:14: warning: return makes integer from pointer without a cast [-Wint-conversion]
#define NULL ((void *)0)
^
drivers/media/dvb-frontends/dib8000.h:72:9: note: in expansion of macro 'NULL'
return NULL;
^
Reported-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 27 Apr 2015 07:29:53 +0000 (04:29 -0300)]
[media] cx24123/mb86a20s/s921: fix compiler warnings
In file included from drivers/media/common/b2c2/flexcop-fe-tuner.c:13:0:
drivers/media/dvb-frontends/cx24123.h:54:2: warning: 'cx24123_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
cx24123_get_tuner_i2c_adapter(struct dvb_frontend *fe)
^
In file included from drivers/media/usb/em28xx/em28xx-dvb.c:46:0:
drivers/media/dvb-frontends/s921.h:40:2: warning: 's921_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
s921_get_tuner_i2c_adapter(struct dvb_frontend *fe)
^
In file included from drivers/media/usb/em28xx/em28xx-dvb.c:55:0:
drivers/media/dvb-frontends/mb86a20s.h:49:2: warning: 'mb86a20s_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
mb86a20s_get_tuner_i2c_adapter(struct dvb_frontend *fe)
^
In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
drivers/media/dvb-frontends/mb86a20s.h:49:2: warning: 'mb86a20s_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
mb86a20s_get_tuner_i2c_adapter(struct dvb_frontend *fe)
^
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 27 Apr 2015 07:29:52 +0000 (04:29 -0300)]
[media] s3c-camif: fix compiler warnings
Fix these compiler warnings that appeared after switching to gcc-5.1.0:
drivers/media/platform/s3c-camif/camif-capture.c: In function 'sensor_set_power':
drivers/media/platform/s3c-camif/camif-capture.c:118:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!on == camif->sensor.power_count)
^
drivers/media/platform/s3c-camif/camif-capture.c: In function 'sensor_set_streaming':
drivers/media/platform/s3c-camif/camif-capture.c:134:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!on == camif->sensor.stream_count)
^
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 27 Apr 2015 07:29:51 +0000 (04:29 -0300)]
[media] s5c73m3/s5k5baf/s5k6aa: fix compiler warnings
Fix these compiler warnings that appeared after switching to gcc-5.1.0:
drivers/media/i2c/s5k5baf.c: In function 's5k5baf_set_power':
drivers/media/i2c/s5k5baf.c:1057:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!on != state->power)
^
drivers/media/i2c/s5k6aa.c: In function 's5k6aa_set_power':
drivers/media/i2c/s5k6aa.c:878:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!on == s5k6aa->power) {
^
drivers/media/i2c/s5c73m3/s5c73m3-core.c: In function 's5c73m3_oif_set_power':
drivers/media/i2c/s5c73m3/s5c73m3-core.c:1456:17: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
} else if (!on == state->power) {
^
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 25 Apr 2015 08:15:24 +0000 (05:15 -0300)]
[media] DocBook/media: attemps -> attempts
Fix typo.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Fri, 24 Apr 2015 14:16:26 +0000 (11:16 -0300)]
[media] vivid-tpg: fix XV601/709 Y'CbCr encoding
For these encodings the quantization range should be ignored, since
there is only one possible Y'CbCr encoding.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Fri, 24 Apr 2015 14:16:25 +0000 (11:16 -0300)]
[media] vivid-tpg: add full range BT.2020C support
In order to be consistent with the other Y'CbCr encodings add
support for full range V4L2_YCBCR_ENC_BT2020_CONST_LUM.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Fri, 24 Apr 2015 14:16:24 +0000 (11:16 -0300)]
[media] vivid-tpg: add full range BT.2020 support
In order to be consistent with the other Y'CbCr encodings add
support for full range V4L2_YCBCR_ENC_BT2020.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Fri, 24 Apr 2015 14:16:23 +0000 (11:16 -0300)]
[media] vivid-tpg: add full range SMPTE 240M support
In order to be consistent with the other Y'CbCr encodings add
support for full range V4L2_YCBCR_ENC_SMPTE240M.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Fri, 24 Apr 2015 14:16:22 +0000 (11:16 -0300)]
[media] vivid-tpg: add tpg_log_status()
Add a log_status function to the test pattern generator and use that
in vivid. This simplifies debugging complex colorspace problems.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Philipp Zabel [Thu, 23 Apr 2015 13:52:54 +0000 (10:52 -0300)]
[media] vivid: add 1080p capture at 2 fps and 5 fps to webcam emulation
Use the VIVID_WEBCAM_SIZES constant where appropriate and add a
1920x1080 pixel frame size setting with frame rates of 2 fps and
5 fps.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Tue, 28 Apr 2015 06:41:00 +0000 (03:41 -0300)]
[media] v4l2-of: fix compiler errors if CONFIG_OF is undefined
You must use static inline otherwise you get these errors if CONFIG_OF is not defined:
In file included from drivers/media/platform/soc_camera/soc_camera.c:39:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
^
In file included from drivers/media/platform/soc_camera/atmel-isi.c:28:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
^
In file included from drivers/media/platform/soc_camera/rcar_vin.c:36:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
^
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Pavel Machek [Thu, 9 Apr 2015 07:42:38 +0000 (04:42 -0300)]
[media] media: i2c/adp1653: Devicetree support for adp1653
Add device tree support for adp1653 flash LED driver.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Pavel Machek [Sat, 4 Apr 2015 07:43:37 +0000 (04:43 -0300)]
[media] media: i2c/adp1653: Documentation for devicetree support for adp1653
Documentation for adp1653 bindings.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Sakari Ailus [Sun, 22 Mar 2015 20:58:45 +0000 (17:58 -0300)]
[media] smiapp: Use v4l2_of_alloc_parse_endpoint()
Instead of parsing the link-frequencies property in the driver, let
v4l2_of_alloc_parse_endpoint() do it.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Sakari Ailus [Sun, 22 Mar 2015 20:48:26 +0000 (17:48 -0300)]
[media] v4l: of: Parse variable length properties --- link-frequencies
The link-frequencies property is a variable length array of link frequencies
in an endpoint. The array is needed by an increasing number of drivers, so
it makes sense to add it to struct v4l2_of_endpoint.
However, the length of the array is variable and the size of struct
v4l2_of_endpoint is fixed since it is allocated by the caller. The options
here are
1. to define a fixed maximum limit of link frequencies that has to be the
global maximum of all boards. This is seen as problematic since the maximum
could be largish, and everyone hitting the problem would need to submit a
patch to fix it, or
2. parse the property in every driver. This doesn't sound appealing as two
of the three implementations submitted to linux-media were wrong, and one of
them was even merged before this was noticed, or
3. change the interface so that allocating and releasing memory according to
the size of the array is possible. This is what the patch does.
v4l2_of_alloc_parse_endpoint() is just like v4l2_of_parse_endpoint(), but it
will allocate the memory resources needed to store struct v4l2_of_endpoint
and the additional arrays pointed to by this struct. A corresponding release
function v4l2_of_free_endpoint() is provided to release the memory allocated
by v4l2_of_alloc_parse_endpoint().
In addition to this, the link-frequencies property is parsed as well, and
the result is stored to struct v4l2_of_endpoint field link_frequencies.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Sakari Ailus [Sun, 22 Mar 2015 20:42:31 +0000 (17:42 -0300)]
[media] v4l: of: Instead of zeroing bus_type and bus field separately, unify this
Zero the entire struct starting from bus_type. As more fields are added, no
changes will be needed in the function to reset their value explicitly.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Sakari Ailus [Sun, 22 Mar 2015 20:38:44 +0000 (17:38 -0300)]
[media] v4l: of: Remove the head field in struct v4l2_of_endpoint
The field is unused. Remove it.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Mon, 27 Apr 2015 13:32:45 +0000 (10:32 -0300)]
Merge tag 'v4.1-rc1' into patchwork
Linux 4.1-rc1
* tag 'v4.1-rc1': (11651 commits)
Linux 4.1-rc1
x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue
v4l: xilinx: fix for include file movement
platform/chrome: chromeos_laptop - instantiate Atmel at primary address
RCU pathwalk breakage when running into a symlink overmounting something
fix I_DIO_WAKEUP definition
direct-io: only inc/dec inode->i_dio_count for file systems
fs/9p: fix readdir()
Btrfs: prevent list corruption during free space cache processing
toshiba_acpi: Do not register vendor backlight when acpi_video bl is available
x86: fix special __probe_kernel_write() tail zeroing case
crypto: img-hash - CRYPTO_DEV_IMGTEC_HASH should depend on HAS_DMA
crypto: x86/sha512_ssse3 - fixup for asm function prototype change
nios2: rework cache
nios2: Add types.h header required for __u32 type
ALSA: hda - fix headset mic detection problem for one more machine
eth: bf609 eth clock: add pclk clock for stmmac driver probe
blackfin: Wire up missing syscalls
Btrfs: fix inode cache writeout
ACPI / scan: Add a scan handler for PRP0001
...
Linus Torvalds [Mon, 27 Apr 2015 00:59:10 +0000 (17:59 -0700)]
Linux 4.1-rc1
Andy Lutomirski [Sun, 26 Apr 2015 23:47:59 +0000 (16:47 -0700)]
x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue
AMD CPUs don't reinitialize the SS descriptor on SYSRET, so SYSRET with
SS == 0 results in an invalid usermode state in which SS is apparently
equal to __USER_DS but causes #SS if used.
Work around the issue by setting SS to __KERNEL_DS __switch_to, thus
ensuring that SYSRET never happens with SS set to NULL.
This was exposed by a recent vDSO cleanup.
Fixes:
e7d6eefaaa44 x86/vdso32/syscall.S: Do not load __USER32_DS to %ss
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Mon, 27 Apr 2015 00:55:26 +0000 (17:55 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull intel drm fixes from Dave Airlie.
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg
drm/i915: Workaround to avoid lite restore with HEAD==TAIL
drm/i915: cope with large i2c transfers
Linus Torvalds [Mon, 27 Apr 2015 00:47:46 +0000 (17:47 -0700)]
Merge git://git.infradead.org/intel-iommu
Pull intel iommu updates from David Woodhouse:
"This lays a little of the groundwork for upcoming Shared Virtual
Memory support — fixing some bogus #defines for capability bits and
adding the new ones, and starting to use the new wider page tables
where we can, in anticipation of actually filling in the new fields
therein.
It also allows graphics devices to be assigned to VM guests again.
This got broken in 3.17 by disallowing assignment of RMRR-afflicted
devices. Like USB, we do understand why there's an RMRR for graphics
devices — and unlike USB, it's actually sane. So we can make an
exception for graphics devices, just as we do USB controllers.
Finally, tone down the warning about the X2APIC_OPT_OUT bit, due to
persistent requests. X2APIC_OPT_OUT was added to the spec as a nasty
hack to allow broken BIOSes to forbid us from using X2APIC when they
do stupid and invasive things and would break if we did.
Someone noticed that since Windows doesn't have full IOMMU support for
DMA protection, setting the X2APIC_OPT_OUT bit made Windows avoid
initialising the IOMMU on the graphics unit altogether.
This means that it would be available for use in "driver mode", where
the IOMMU registers are made available through a BAR of the graphics
device and the graphics driver can do SVM all for itself.
So they started setting the X2APIC_OPT_OUT bit on *all* platforms with
SVM capabilities. And even the platforms which *might*, if the
planets had been aligned correctly, possibly have had SVM capability
but which in practice actually don't"
* git://git.infradead.org/intel-iommu:
iommu/vt-d: support extended root and context entries
iommu/vt-d: Add new extended capabilities from v2.3 VT-d specification
iommu/vt-d: Allow RMRR on graphics devices too
iommu/vt-d: Print x2apic opt out info instead of printing a warning
iommu/vt-d: kill bogus ecap_niotlb_iunits()
Linus Torvalds [Mon, 27 Apr 2015 00:44:09 +0000 (17:44 -0700)]
Merge branch 'i2c/for-next' of git://git./linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang:
"This has a mixture of merge window cleanups and bugfixes"
* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: st: add include for pinctrl
i2c: mux: use proper dev when removing "channel-X" symlinks
i2c: digicolor: remove duplicate include
i2c: Mark adapter devices with pm_runtime_no_callbacks
i2c: pca-platform: fix broken email address
i2c: mxs: fix broken email address
i2c: rk3x: report number of messages transmitted
Linus Torvalds [Mon, 27 Apr 2015 00:40:30 +0000 (17:40 -0700)]
Merge branch 'for-linus-4.1' of git://git./linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason:
"Filipe hit two problems in my block group cache patches. We finalized
the fixes last week and ran through more tests"
* 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: prevent list corruption during free space cache processing
Btrfs: fix inode cache writeout
Dave Airlie [Mon, 27 Apr 2015 00:35:15 +0000 (10:35 +1000)]
Merge tag 'drm-intel-next-fixes-2015-04-25' of git://anongit.freedesktop.org/drm-intel into drm-fixes
three fixes for i915.
* tag 'drm-intel-next-fixes-2015-04-25' of git://anongit.freedesktop.org/drm-intel:
drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg
drm/i915: Workaround to avoid lite restore with HEAD==TAIL
drm/i915: cope with large i2c transfers
Linus Torvalds [Mon, 27 Apr 2015 00:33:59 +0000 (17:33 -0700)]
Merge tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Another set of mainly bugfixes and a couple of cleanups. No new
functionality in this round.
Highlights include:
Stable patches:
- Fix a regression in /proc/self/mountstats
- Fix the pNFS flexfiles O_DIRECT support
- Fix high load average due to callback thread sleeping
Bugfixes:
- Various patches to fix the pNFS layoutcommit support
- Do not cache pNFS deviceids unless server notifications are enabled
- Fix a SUNRPC transport reconnection regression
- make debugfs file creation failure non-fatal in SUNRPC
- Another fix for circular directory warnings on NFSv4 "junctioned"
mountpoints
- Fix locking around NFSv4.2 fallocate() support
- Truncating NFSv4 file opens should also sync O_DIRECT writes
- Prevent infinite loop in rpcrdma_ep_create()
Features:
- Various improvements to the RDMA transport code's handling of
memory registration
- Various code cleanups"
* tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (55 commits)
fs/nfs: fix new compiler warning about boolean in switch
nfs: Remove unneeded casts in nfs
NFS: Don't attempt to decode missing directory entries
Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one"
NFS: Rename idmap.c to nfs4idmap.c
NFS: Move nfs_idmap.h into fs/nfs/
NFS: Remove CONFIG_NFS_V4 checks from nfs_idmap.h
NFS: Add a stub for GETDEVICELIST
nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes
nfs: fix DIO good bytes calculation
nfs: Fetch MOUNTED_ON_FILEID when updating an inode
sunrpc: make debugfs file creation failure non-fatal
nfs: fix high load average due to callback thread sleeping
NFS: Reduce time spent holding the i_mutex during fallocate()
NFS: Don't zap caches on fallocate()
xprtrdma: Make rpcrdma_{un}map_one() into inline functions
xprtrdma: Handle non-SEND completions via a callout
xprtrdma: Add "open" memreg op
xprtrdma: Add "destroy MRs" memreg op
xprtrdma: Add "reset MRs" memreg op
...
Linus Torvalds [Sun, 26 Apr 2015 22:48:49 +0000 (15:48 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs
Pull fourth vfs update from Al Viro:
"d_inode() annotations from David Howells (sat in for-next since before
the beginning of merge window) + four assorted fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
RCU pathwalk breakage when running into a symlink overmounting something
fix I_DIO_WAKEUP definition
direct-io: only inc/dec inode->i_dio_count for file systems
fs/9p: fix readdir()
VFS: assorted d_backing_inode() annotations
VFS: fs/inode.c helpers: d_inode() annotations
VFS: fs/cachefiles: d_backing_inode() annotations
VFS: fs library helpers: d_inode() annotations
VFS: assorted weird filesystems: d_inode() annotations
VFS: normal filesystems (and lustre): d_inode() annotations
VFS: security/: d_inode() annotations
VFS: security/: d_backing_inode() annotations
VFS: net/: d_inode() annotations
VFS: net/unix: d_backing_inode() annotations
VFS: kernel/: d_inode() annotations
VFS: audit: d_backing_inode() annotations
VFS: Fix up some ->d_inode accesses in the chelsio driver
VFS: Cachefiles should perform fs modifications on the top layer only
VFS: AF_UNIX sockets should call mknod on the top layer only
Linus Torvalds [Sun, 26 Apr 2015 20:56:35 +0000 (13:56 -0700)]
Merge tag 'pm+acpi-4.1-rc1-2' of git://git./linux/kernel/git/rafael/linux-pm
Pull more power management and ACPI updates from Rafael Wysocki:
"These are fixes mostly (intel_pstate, ACPI core, ACPI EC driver,
cpupower tool), a new CPU ID for the Intel RAPL driver and one
intel_pstate driver improvement that didn't make it to my previous
pull requests due to timing.
Specifics:
- Fix a build warning in the intel_pstate driver showing up in
non-SMP builds (Borislav Petkov)
- Change one of the intel_pstate's P-state selection parameters for
Baytrail and Cherrytrail CPUs to significantly improve performance
at the cost of a small increase in energy consumption (Kristen
Carlson Accardi)
- Fix a NULL pointer dereference in the ACPI EC driver due to an
unsafe list walk in the query handler removal routine (Chris
Bainbridge)
- Get rid of a false-positive lockdep warning in the ACPI container
hot-remove code (Rafael J Wysocki)
- Prevent the ACPI device enumeration code from creating device
objects of a wrong type in some cases (Rafael J Wysocki)
- Add Skylake processors support to the Intel RAPL power capping
driver (Brian Bian)
- Drop the stale MAINTAINERS entry for the ACPI dock driver that is
regarded as part of the ACPI core and maintained along with it now
(Chao Yu)
- Fix cpupower tool breakage caused by a library API change in libpci
3.3.0 (Lucas Stach)"
* tag 'pm+acpi-4.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / scan: Add a scan handler for PRP0001
ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline()
ACPI / EC: fix NULL pointer dereference in acpi_ec_remove_query_handler()
MAINTAINERS: remove maintainship entry of docking station driver
powercap / RAPL: Add support for Intel Skylake processors
cpufreq: intel_pstate: Fix an annoying !CONFIG_SMP warning
intel_pstate: Change the setpoint for Atom params
cpupower: fix breakage from libpci API change
Linus Torvalds [Sun, 26 Apr 2015 20:51:05 +0000 (13:51 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
"This push fixes a build problem with img-hash under non-standard
configurations and a serious regression with sha512_ssse3 which can
lead to boot failures"
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: img-hash - CRYPTO_DEV_IMGTEC_HASH should depend on HAS_DMA
crypto: x86/sha512_ssse3 - fixup for asm function prototype change