Re: [PATCH] v4l2-ctrls: avoid a sparse complain due to __user ptr

2014-09-03 Thread Hans Verkuil
On 09/04/2014 01:19 AM, Mauro Carvalho Chehab wrote: > c->ptr was already copied to Kernelspace. So, this sparse warning > is bogus: > >>> drivers/media/v4l2-core/v4l2-ctrls.c:1685:15: sparse: incorrect type in >>> assignment (different address spaces) >drivers/media/v4l2-core/v4l2-ctrls.c:16

[PATCH 02/37] af9035: enable AF9033 demod clock source for IT9135

2014-09-03 Thread Antti Palosaari
Integrated RF tuner of IT9135 is connected to demod clock source named dyn0_clk. Enable that clock source in order to provide stable clock early enough. Cc: Bimow Chen Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 9 ++--- 1 file changed, 6 insertions(+), 3 dele

[PATCH 10/37] it913x: rename tuner_it913x => it913x

2014-09-03 Thread Antti Palosaari
Remove tuner_ prefix from module name and file names. Prefix was added due to file name conflict on media out-tree build system. Demodulator having same name does not exists anymore. So lets remove dumb prefix. Signed-off-by: Antti Palosaari --- drivers/media/tuners/Makefile| 2 +-

[PATCH 13/37] af9035: use I2C it913x tuner driver

2014-09-03 Thread Antti Palosaari
Use I2C it913x tuner driver. Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 135 -- drivers/media/usb/dvb-usb-v2/af9035.h | 3 +- 2 files changed, 131 insertions(+), 7 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c

[PATCH 06/37] af9035: remove AVerMedia eeprom override

2014-09-03 Thread Antti Palosaari
Reverts commit 3ab25123373270152a9fae98e3c48ef1b2a878c0 [media] af9035: override tuner for AVerMedia A835B devices Original commit itself is correct, but it was replaced by more general solution (commit 1cbbf90d0406913ad4b44194b07f4f41bde84e54). This old solution was committed by a accident and is

[PATCH 08/37] af9033: make checkpatch.pl happy

2014-09-03 Thread Antti Palosaari
Correct issues reported by checkpatch.pl. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c inde

[PATCH 15/37] it913x: rename 'state' to 'dev'

2014-09-03 Thread Antti Palosaari
foo_dev seems to be most correct term for the structure holding data of each device instance. It is most used term in Kernel and also examples from book Linux Device Drivers, Third Edition, uses it. Signed-off-by: Antti Palosaari --- drivers/media/tuners/it913x.c | 150 +-

[PATCH 14/37] it913x: change reg read/write routines more common

2014-09-03 Thread Antti Palosaari
Change register write and read routines to similar which are typically used. We have to add processor core as a part of register address in order to simplify register access. Chip has two cores, called link and ofdm. As for now, use address bit 24 to address used core. Bits 15:0 are register addres

[PATCH 09/37] it913x: make checkpatch.pl happy

2014-09-03 Thread Antti Palosaari
Correct issues reported by checkpatch.pl Signed-off-by: Antti Palosaari --- drivers/media/tuners/tuner_it913x.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/media/tuners/tuner_it913x.c b/drivers/media/tuners/tuner_it913x.c index 281d8c5..b92d599 100644 --- a/drivers/media/tun

[PATCH 01/37] af9033: provide dyn0_clk clock source

2014-09-03 Thread Antti Palosaari
AF903x/IT913x demod provides clock source(s). It seems that this clock source is used for integrated RF tuner of IT913x. It is enabled by default, but firmware disables it automatically when suspend is requested (suspend_flag (0x004c) + trigger_ofsm (0x)). Automatic disable behavior seems to be

[PATCH 11/37] af9035: do not attach IT9135 tuner

2014-09-03 Thread Antti Palosaari
Remove IT9135 tuner attach for a while as we will convert IT9135 driver to Kernel I2C model. Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af903

[PATCH 12/37] it913x: convert to I2C driver

2014-09-03 Thread Antti Palosaari
Convert driver from DVB proprietary model to kernel I2C model. Signed-off-by: Antti Palosaari --- drivers/media/tuners/it913x.c | 133 - drivers/media/tuners/it913x.h | 33 - drivers/media/tuners/it913x_priv.h | 1 - 3 files changed, 90 in

[PATCH 03/37] it913x: fix tuner sleep power leak

2014-09-03 Thread Antti Palosaari
IT913x tuner driver disables own clock, provided by demod core, as very a first operation when tuner is put on *sleep*. That likely causes failure of all the rest commands on sleep sequence, which leads situation where tuner is not actually on sleep, but consuming a lot of power. I measured 102mA

[PATCH 05/37] it913x: fix IT9135 AX sleep

2014-09-03 Thread Antti Palosaari
Old IT9135 AX needs a little bit different register settings for sleep than newer IT9135 BX. This has been broken always, as power management of the whole driver, but it started to be problem as I fixed clock. Earlier clock was disabled very first on sleep and rest of the commands were skipped by t

[PATCH 17/37] it913x: re-implement sleep

2014-09-03 Thread Antti Palosaari
Re-implement sleep. Based USB sniffs taken from the latest Hauppauge windows driver version 07/10/2014, 14.6.23.32191. Signed-off-by: Antti Palosaari --- drivers/media/tuners/it913x.c | 76 +++ drivers/media/tuners/it913x.h | 10 - drivers/medi

[PATCH 25/37] af9033: clean up logging

2014-09-03 Thread Antti Palosaari
It uses I2C client so logging system prints module name automatically. Function name is also added automatically, if it is requested from dynamic debug by setting proper format. Because of that, we could simplify logging in our driver. Signed-off-by: Antti Palosaari --- drivers/media/dvb-fronten

[PATCH 34/37] af9033: implement DVBv5 post-Viterbi BER

2014-09-03 Thread Antti Palosaari
Implement following DTV API commands: DTV_STAT_POST_ERROR_BIT_COUNT DTV_STAT_POST_TOTAL_BIT_COUNT These will provide post-Viterbi bit error rate reporting. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 15 +++ 1 file changed, 15 insertions(+) diff --git

[PATCH 23/37] af9033: rename 'state' to 'dev'

2014-09-03 Thread Antti Palosaari
foo_dev seems to be most correct term for the structure holding data of each device instance. It is most used term in Kernel codebase and also examples from book Linux Device Drivers, Third Edition, uses it. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 328 ++

[PATCH 19/37] it913x: get rid of script loader and and private header file

2014-09-03 Thread Antti Palosaari
Used script loader is quite useless and hides register numbers making code hard to understand. Get rid of it and use standard RegMap register write functions directly. it913x_priv.h file leaves empty after that change and is also removed. Signed-off-by: Antti Palosaari --- drivers/media/tuners/

[PATCH 32/37] af9033: wrap DVBv3 read SNR to DVBv5 CNR

2014-09-03 Thread Antti Palosaari
Remove 'duplicate' DVBv3 read SNR implementation and return value, calculated already by DVBv5 CNR, from the cache. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 52 --- drivers/media/dvb-frontends/af9033_priv.h | 1 + 2 files changed

[PATCH 21/37] it913x: replace udelay polling with jiffies

2014-09-03 Thread Antti Palosaari
udelay based I/O polling loop is a bad idea, especially system performance point of view. Kernel jiffies are preferred solution for such situations. Use it instead. Signed-off-by: Antti Palosaari --- drivers/media/tuners/it913x.c | 29 - 1 file changed, 20 insertions(

[PATCH 30/37] af9033: implement DVBv5 statistic for signal strength

2014-09-03 Thread Antti Palosaari
Let the demod firmware estimate RF signal strength and return it to the app as a dBm. To handle that, use thread which reads signal strengths from firmware in 2 sec intervals when device is active. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 48 +

[PATCH 16/37] it913x: convert to RegMap API

2014-09-03 Thread Antti Palosaari
Use RegMap API to cover I2C register access routines. Signed-off-by: Antti Palosaari --- drivers/media/tuners/Kconfig | 1 + drivers/media/tuners/it913x.c | 137 + drivers/media/tuners/it913x_priv.h | 1 + 3 files changed, 34 insertions(+), 105

[PATCH 36/37] af9033: wrap DVBv3 BER to DVBv5 BER

2014-09-03 Thread Antti Palosaari
DVBv5 BER is calculated anyway, so just return it for legacy read_ber() API too. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontend

[PATCH 20/37] it913x: refactor code largely

2014-09-03 Thread Antti Palosaari
Refactor code largely in order to satisfy me. Try to keep order of register read/write same as windows driver does as it makes comparing sniffs easier. Signed-off-by: Antti Palosaari --- drivers/media/tuners/it913x.c | 356 +++--- 1 file changed, 194 insertion

[PATCH 35/37] af9033: wrap DVBv3 UCB to DVBv5 UCB stats

2014-09-03 Thread Antti Palosaari
Remove 'duplicate' DVBv3 read UCB implementation and return value, calculated already for DVBv5 statistics. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/af9033.c b/d

[PATCH 18/37] it913x: remove dead code

2014-09-03 Thread Antti Palosaari
Remove unused tuner set template. Signed-off-by: Antti Palosaari --- drivers/media/tuners/it913x.c | 9 + drivers/media/tuners/it913x_priv.h | 11 --- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.

[PATCH 37/37] af9033: remove all DVBv3 stat calculation logic

2014-09-03 Thread Antti Palosaari
Statistics are now calculated for DVBv5 and those DVBv5 values are returned for legacy DVBv3 calls also. So we could remove all old statistics calculation logic. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 49 1 file changed, 49

[PATCH 22/37] af9033: fix firmware version logging

2014-09-03 Thread Antti Palosaari
AF9030 and IT9130 series has different memory location for firmware version. Choose correct location according to chip type. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/media

[PATCH 33/37] af9033: implement DVBv5 stat block counters

2014-09-03 Thread Antti Palosaari
Implement following API commands: DTV_STAT_ERROR_BLOCK_COUNT DTV_STAT_TOTAL_BLOCK_COUNT These returns total and uncorrected error packets from outer FEC. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 33 - 1 file changed, 32 insertions

[PATCH 07/37] af9035: make checkpatch.pl happy

2014-09-03 Thread Antti Palosaari
Correct issues reported by checkpatch.pl. Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 85f2c4b..f37cf7d 1006

[PATCH 26/37] af9035: few small I2C master xfer changes

2014-09-03 Thread Antti Palosaari
Biggest problem of that function is complexity. Try reduce complexity: * define macros to detect all 3 supported xfers * remove duplicate message maximum size checks Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 37 +-- 1 file changed

[PATCH 28/37] af9035: replace PCTV device model numbers with name

2014-09-03 Thread Antti Palosaari
Use device names for recent PCTV Systems devices: PCTV AndroiDTV (78e) PCTV microStick (79e) Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb

[PATCH 31/37] af9033: implement DVBv5 statistic for CNR

2014-09-03 Thread Antti Palosaari
Return CNR via DVBv5 statistic API. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 54 ++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c index

[PATCH 24/37] af9033: convert to I2C client

2014-09-03 Thread Antti Palosaari
Convert driver to kernel I2C model. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.c | 236 +++--- drivers/media/dvb-frontends/af9033.h | 44 ++- drivers/media/usb/dvb-usb-v2/af9035.c | 50 +-- drivers/media/usb/dvb-usb-v2/af9035.h |

[PATCH 29/37] MAINTAINERS: IT913X driver filenames

2014-09-03 Thread Antti Palosaari
I removed tuner_ prefix from the driver file names. Update maintainers entry according to that. Signed-off-by: Antti Palosaari --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index aefa948..182a4a1 100644 --- a/MAINTAINERS +++ b/MAINT

[PATCH 27/37] af9033: remove I2C addr from config

2014-09-03 Thread Antti Palosaari
I2C driver address is passed as a i2c_new_device() parameter when device is created. Thus no need to keep it in config struct. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/af9033.h | 9 - drivers/media/usb/dvb-usb-v2/af9035.c | 29 ++--- driver

[PATCH 04/37] it913x: avoid division by zero on error case

2014-09-03 Thread Antti Palosaari
Error on init leaves some internal divisor zero, which causes oops later. Fix it by populating divisors even it fails. Signed-off-by: Antti Palosaari --- drivers/media/tuners/tuner_it913x.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/tuners/tuner_it913x.c b/drivers/medi

[PATCH] [media] s5p_mfc: unify variable naming style

2014-09-03 Thread Zhaowei Yuan
Variable frame_size represents the size of plane luminance here, not just frame size, its naming style should be unified as frame_size_ch and frame_size_mv. Signed-off-by: Zhaowei Yuan --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c |8 1 file changed, 4 insertions(+), 4 deletio

[PATCH] [media] s5p_mfc: correct the loop condition

2014-09-03 Thread Zhaowei Yuan
It should take ctx->dst_fmt->num_planes as the loop condition for CAPTURE. Signed-off-by: Zhaowei Yuan --- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5

Re: [PATCH 32/46] [media] e4000: simplify boolean tests

2014-09-03 Thread Mauro Carvalho Chehab
Em Thu, 04 Sep 2014 04:27:57 +0300 Antti Palosaari escreveu: > > By being shorter, a reviewer can read it faster and, at least for > > me, it is a non-brain to understand !foo. On the other hand, > > "false" is not part of standard C. So, it takes more time for my > > brain to parse it. > > No,

cron job: media_tree daily build: ERRORS

2014-09-03 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Thu Sep 4 04:00:19 CEST 2014 git branch: test git hash: 89fffac802c18caebdf4e91c0785b522c9f6399a gcc versi

Re: [PATCH 32/46] [media] e4000: simplify boolean tests

2014-09-03 Thread Antti Palosaari
On 09/04/2014 04:12 AM, Mauro Carvalho Chehab wrote: Em Thu, 04 Sep 2014 02:56:19 +0300 Antti Palosaari escreveu: Which is static analyzer you are referring to fix these? Coccinelle. See: scripts/coccinelle/misc/boolinit.cocci Using true/false for boolean datatype sounds OK, but personal

Re: [PATCH 32/46] [media] e4000: simplify boolean tests

2014-09-03 Thread Mauro Carvalho Chehab
Em Thu, 04 Sep 2014 02:56:19 +0300 Antti Palosaari escreveu: > Which is static analyzer you are referring to fix these? Coccinelle. See: scripts/coccinelle/misc/boolinit.cocci > Using true/false for boolean datatype sounds OK, but personally I > dislike use of negation operator. For my eyes (f

[PATCH v4 2/2] V4L: uvcvideo: Add support for pan/tilt speed controls

2014-09-03 Thread Vincent Palatin
Map V4L2_CID_TILT_SPEED and V4L2_CID_PAN_SPEED to the standard UVC CT_PANTILT_RELATIVE_CONTROL terminal control request. Tested by plugging a Logitech ConferenceCam C3000e USB camera and controlling pan/tilt from the userspace using the VIDIOC_S_CTRL ioctl. Verified that it can pan and tilt at the

Re: [PATCH v3 2/2] V4L: uvcvideo: Add support for pan/tilt speed controls

2014-09-03 Thread Pawel Osciak
On Thu, Sep 4, 2014 at 4:40 AM, Vincent Palatin wrote: > Map V4L2_CID_TILT_SPEED and V4L2_CID_PAN_SPEED to the standard UVC > CT_PANTILT_RELATIVE_CONTROL terminal control request. > > Tested by plugging a Logitech ConferenceCam C3000e USB camera > and controlling pan/tilt from the userspace using

Re: [PATCH 32/46] [media] e4000: simplify boolean tests

2014-09-03 Thread Antti Palosaari
Which is static analyzer you are referring to fix these? Using true/false for boolean datatype sounds OK, but personally I dislike use of negation operator. For my eyes (foo = 0) / (foo == false) is better and I have changed all the time negate operators to equal operators from my drivers. r

[PATCH RFC] [media] ngene: properly handle __user ptr

2014-09-03 Thread Mauro Carvalho Chehab
Sparse is complaining about ngene's bad usage of a __user ptr: >> drivers/media/pci/ngene/ngene-dvb.c:62:48: sparse: incorrect type in >> argument 2 (different address spaces) drivers/media/pci/ngene/ngene-dvb.c:62:48:expected unsigned char const [usertype] *buf drivers/media/pci/ngene

[PATCH] v4l2-ctrls: avoid a sparse complain due to __user ptr

2014-09-03 Thread Mauro Carvalho Chehab
c->ptr was already copied to Kernelspace. So, this sparse warning is bogus: >> drivers/media/v4l2-core/v4l2-ctrls.c:1685:15: sparse: incorrect type in >> assignment (different address spaces) drivers/media/v4l2-core/v4l2-ctrls.c:1685:15:expected void *[assigned] p drivers/media/v4l2-cor

[PATCH 1/5] [media] xc4000: Fix bad alignments

2014-09-03 Thread Mauro Carvalho Chehab
As reported by cocinelle: drivers/media/tuners/xc4000.c:573:2-28: code aligned with following code on line 574 drivers/media/tuners/xc4000.c:575:2-29: code aligned with following code on line 576 drivers/media/tuners/xc4000.c:577:2-29: code aligned with following code on line 578 drivers/media/

[PATCH 3/5] [media] sp8870: fix bad alignments

2014-09-03 Thread Mauro Carvalho Chehab
As reported by cocinelle: drivers/media/dvb-frontends/sp8870.c:395:2-14: code aligned with following code on line 397 Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/sp8870.c b/drivers/media/dvb-frontends/sp8870.c index 2aa8ef76eba2..57dc2abaa87b 100644 --- a/dri

[PATCH 5/5] [media] drxk_hard: fix bad alignments

2014-09-03 Thread Mauro Carvalho Chehab
drivers/media/dvb-frontends/drxk_hard.c:2224:3-22: code aligned with following code on line 2227 Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 88182c18e186..672195147d01 100644 --- a/drivers/media/dvb-f

[PATCH 2/5] [media] tuner-xc2028: fix bad alignments

2014-09-03 Thread Mauro Carvalho Chehab
As reported by cocinelle: drivers/media/tuners/tuner-xc2028.c:182:2-18: code aligned with following code on line 183 drivers/media/tuners/tuner-xc2028.c:184:2-19: code aligned with following code on line 185 drivers/media/tuners/tuner-xc2028.c:186:2-19: code aligned with following code on line

[PATCH 4/5] [media] drxd_hard: fix bad alignments

2014-09-03 Thread Mauro Carvalho Chehab
As reported by cocinelle: drivers/media/dvb-frontends/drxd_hard.c:2632:3-51: code aligned with following code on line 2633 Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c index ae2276db77bc..961641b67728 10064

Re: [PATCH 04/46] [media] vivid-vid-out: use memdup_user()

2014-09-03 Thread Mauro Carvalho Chehab
Em Wed, 03 Sep 2014 22:49:47 +0200 Hans Verkuil escreveu: > On 09/03/2014 10:32 PM, Mauro Carvalho Chehab wrote: > > Instead of allocating and coping from __user, do it using > > one atomic call. That makes the code simpler. Also, > > Also what? I added a comment about IS_ERR(new_bitmap), and r

Re: [PATCH 03/46] [media] soc_camera: use kmemdup()

2014-09-03 Thread Mauro Carvalho Chehab
Em Wed, 3 Sep 2014 22:44:02 +0200 (CEST) Guennadi Liakhovetski escreveu: > Hi Mauro, > > On Wed, 3 Sep 2014, Mauro Carvalho Chehab wrote: > > > Instead of calling kzalloc and then copying, use kmemdup(). That > > avoids zeroing the data structure before copying. > > > > Found by coccinelle. >

Re: [PATCH 04/46] [media] vivid-vid-out: use memdup_user()

2014-09-03 Thread Hans Verkuil
On 09/03/2014 10:32 PM, Mauro Carvalho Chehab wrote: > Instead of allocating and coping from __user, do it using > one atomic call. That makes the code simpler. Also, Also what? Anyway, looks good to me: Acked-by: Hans Verkuil Regards, Hans > > Found by coccinelle. > > Signed-off-b

Re: [PATCH 03/46] [media] soc_camera: use kmemdup()

2014-09-03 Thread Guennadi Liakhovetski
Hi Mauro, On Wed, 3 Sep 2014, Mauro Carvalho Chehab wrote: > Instead of calling kzalloc and then copying, use kmemdup(). That > avoids zeroing the data structure before copying. > > Found by coccinelle. > > Signed-off-by: Mauro Carvalho Chehab > > diff --git a/drivers/media/platform/soc_camer

Re: [PATCH 39/46] [media] davinci: just return 0 instead of using a var

2014-09-03 Thread Prabhakar Lad
On Wed, Sep 3, 2014 at 9:33 PM, Mauro Carvalho Chehab wrote: > Instead of allocating a var to store 0 and just return it, > change the code to return 0 directly. > Acked-by: Lad, Prabhakar Regards, --Prabhakar Lad > Signed-off-by: Mauro Carvalho Chehab > > diff --git a/drivers/media/platform/

[PATCH 05/46] [media] s5k5baf: remove an uneeded semicolon

2014-09-03 Thread Mauro Carvalho Chehab
We don't use semicolons after curly braces in the middle of the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index 564f05f2c9ef..0e461a6fd065 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -816,7

[PATCH 11/46] [media] af9013: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index ecf6388d2200..8001690d7576 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/d

[PATCH 44/46] [media] mt2060: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/tuners/mt2060.c b/drivers/media/tuners/mt2060.c index 13381de58a84..b87b2549d58d 100644 --- a/drivers/media/tuners/mt2060.c +++ b/drive

[PATCH 46/46] [media] cx231xx: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 2adfecf70236..6c7b5e250eed 100644 --- a/drivers/media/usb/cx

[PATCH 18/46] [media] omap3isp: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index cabf46b4b645..81a9dc053d58 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/

[PATCH 03/46] [media] soc_camera: use kmemdup()

2014-09-03 Thread Mauro Carvalho Chehab
Instead of calling kzalloc and then copying, use kmemdup(). That avoids zeroing the data structure before copying. Found by coccinelle. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index f4308f

[PATCH 38/46] [media] saa7164: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/pci/saa7164/saa7164-api.c b/drivers/media/pci/saa7164/saa7164-api.c index e042963d377d..4f3b1dd18ba4 100644 --- a/drivers/media/pci/sa

[PATCH 15/46] [media] tda10071: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index 9619be5d4827..4a19b85995f1 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/m

[PATCH 10/46] [media] tuner-core: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c index 177023200737..559f8372e2eb 100644 --- a/drivers/media/v4l2-core/tuner-core.c +++ b/drivers/media/v

[PATCH 39/46] [media] davinci: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index ed9dd27e3c63..c557eb5ebf6b 100644 --- a/drivers/

[PATCH 40/46] [media] marvel-ccic: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c index 93f9cf2ebcd6..9d8d885558e5 100644 ---

[PATCH 45/46] [media] mxl5005s: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/tuners/mxl5005s.c b/drivers/media/tuners/mxl5005s.c index b473b76cb278..92a3be4fde87 100644 --- a/drivers/media/tuners/mxl5005s.c +++ b

[PATCH 36/46] [media] media-devnode: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index 7acd19c881de..ebf9626e5ae5 100644 --- a/drivers/media/media-devnode.c +++ b/drive

[PATCH 41/46] [media] fintek-cir: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index f0a1f7d31ee6..b5167573240e 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drive

[PATCH 35/46] [media] stv0367: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index 764577218974..59f622ae80e8 100644 --- a/drivers/media/dvb-fronte

[PATCH 42/46] [media] ite-cir: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 447fe35862dc..56abf9120cc2 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/

[PATCH 12/46] [media] cxd2820r: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/cxd2820r_c.c b/drivers/media/dvb-frontends/cxd2820r_c.c index 0f4657e01cde..149fdca3fb44 100644 --- a/drivers/media/dvb-frontends/cxd2820r_c.c +++ b/dri

[PATCH 43/46] [media] nuvoton-cir: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 7f4fd859bba5..9c2c8635ff33 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/dr

[PATCH 08/46] [media] stv0900_core: don't allocate a temporary var

2014-09-03 Thread Mauro Carvalho Chehab
The error return code STV0900_NO_ERROR happens only once, at the end of the functions. So, just return it directly. This driver should actually be fixed to return standard Linux error codes, instead of its own macros, but this should be done on a separate patchset. Signed-off-by: Mauro Carvalho C

[PATCH 14/46] [media] af9013: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Also, instead of testing foo == false, just use the simplified notation if(!foo). Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index fdbed35c87fa.

[PATCH 34/46] [media] siano: just return 0 instead of using a var

2014-09-03 Thread Mauro Carvalho Chehab
Instead of allocating a var to store 0 and just return it, change the code to return 0 directly. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 050984c5b1e3..a3677438205e 100644 --- a/drivers/media/common

[PATCH 28/46] [media] lm3560: simplify boolean tests

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using if (on == true), just use if (on). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index c23de593c17d..d9ece4b2d047 100644 --- a/drivers/media/i2c/lm3560.c +++

[PATCH 31/46] [media] via-camera: simplify boolean tests

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using if (foo == false), just use if (!foo). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c index 00d431293190..ae6870cb8339 100644 --- a/drivers

[PATCH 29/46] [media] lm3560: simplify a boolean test

2014-09-03 Thread Mauro Carvalho Chehab
lml33dpatch is boolean. So, the possible values are true or false. Instead of using if (lml33dpath), just use if (!lml33dpath). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/pci/zoran/zoran_device.c b/drivers/media

[PATCH 33/46] [media] s5p-tv: Simplify the return logic

2014-09-03 Thread Mauro Carvalho Chehab
Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE(). Reported by scripts/coccinelle/api/pm_runtime.cocci script. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index 754740f4b671..37c8bd694c

[PATCH 32/46] [media] e4000: simplify boolean tests

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using if (foo == false), just use if (!foo). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c index 90d93348f20c..cd9cf643f602 100644 --- a/drivers/media/tuners/e

[PATCH 21/46] [media] radio: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index 235c0e349820..cff1eb144a5c 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/r

[PATCH 16/46] [media] smiapp-core: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index c4cc5de3ae59..d312932bc56e 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/m

[PATCH 25/46] [media] af9005: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/usb/dvb-usb/af9005.c b/drivers/media/usb/dvb-usb/af9005.c index af176b6ce738..3f4361e48a32 100644 --- a/drivers/media/usb/dvb-usb/af9005.c +++ b/drivers/media/usb/dvb

[PATCH 30/46] [media] omap: simplify test logic

2014-09-03 Thread Mauro Carvalho Chehab
instead of testing bools if they are false or true, just use if (!foo) or if (foo). That makes the code easier to read and shorter. Also, properly initialize booleans with true or false. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/p

[PATCH 26/46] [media] msi2500: simplify boolean tests

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using if (foo == false), just use if (!foo). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index 71e0960b46c0..e980aaa47b7c 100644 --- a/drivers

[PATCH 17/46] [media] ov9740: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c index ea76863dfdb4..ee9eb635d540 100644 --- a/drivers/media/i2c/soc_camera/ov9740.c +++ b/drivers/medi

[PATCH 07/46] [media] soc_camera: remove uneeded semicolons

2014-09-03 Thread Mauro Carvalho Chehab
We don't use semicolons after curly braces in the middle of the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c index 64dc80ccd6f9..66178fc9f9eb 100644 --- a/drivers/media/platform/soc_camera

[PATCH 19/46] [media] ti-vpe: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index 773b1fbf3269..febeca70211b 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/plat

[PATCH 22/46] [media] ene_ir: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index d16d9b496b92..e80f2c6c5f1a 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -979,7 +979,7 @@ sta

[PATCH 24/46] [media] lmedm04: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c index e332af731187..9f2c5459b73a 100644 --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c +++ b/drivers/m

[PATCH 23/46] [media] au0828-dvb: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c index 4bd9d687d2d6..00ab1563d142 100644 --- a/drivers/media/usb/au0828/au0828-dvb.c +++ b/drivers/medi

[PATCH 20/46] [media] vivid-tpg: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 8576b2c1d4a1..57ff428c897e 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/dri

[PATCH 06/46] [media] bttv-driver: remove an uneeded semicolon

2014-09-03 Thread Mauro Carvalho Chehab
We don't use semicolons after curly braces in the middle of the code. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 970e542d3a51..750bdab8aacb 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers

[PATCH 27/46] [media] drxk_hard: simplify test logic

2014-09-03 Thread Mauro Carvalho Chehab
instead of testing if it is false or true, just use if (!foo) or if (foo). That makes the code easier to read and shorter. Also, properly initialize booleans with true or false. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-fronte

[PATCH 13/46] [media] m88ds3103: use true/false for boolean vars

2014-09-03 Thread Mauro Carvalho Chehab
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c index 6eae2c619843..81657e94c5a4 100644 --- a/drivers/media/dvb-frontends/m88ds3103.c +++ b/driver

  1   2   >