Commit Graph

66 Commits (70e522a02838e52ca007d3f183171fd9324eceb4)

Author SHA1 Message Date
Leonid V. Fedorenchik 3038f638ac Staging: cx25821: Replace :? by if-else in cx25821-video.c
Replace :? operator by equivalent if-else statement where in improves
readability. Don't add else branch if it is not needed.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:46 +02:00
Leonid V. Fedorenchik e313e1f983 Staging: cx25821: Fix braces around statements in cx25821-video.c
Delete braces around single statements.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:46 +02:00
Leonid V. Fedorenchik 527db49d91 Staging: cx25821: Change indent with spaces to tabs 35
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik fa7ce1f41d Staging: cx25821: Change indent with spaces to tabs 34
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik d2a167c8fc Staging: cx25821: Change indent with spaces to tabs 33
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik 2a51749fd5 Staging: cx25821: Change indent with spaces to tabs 32
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik 12fe746fa9 Staging: cx25821: Change indent with spaces to tabs 31
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik 16a81efe88 Staging: cx25821: Change indent with spaces to tabs 30
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik 5e6440141e Staging: cx25821: Change indent with spaces to tabs 29
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:45 +02:00
Leonid V. Fedorenchik f9ef6be389 Staging: cx25821: Change indent with spaces to tabs 28
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik 43be3824d9 Staging: cx25821: Change indent with spaces to tabs 27
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik 6f87cc6cd9 Staging: cx25821: Change indent with spaces to tabs 26
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik 75965b8f6f Staging: cx25821: Change indent with spaces to tabs 25
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik 8a911ed9c0 Staging: cx25821: Change indent with spaces to tabs 24
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik e0b871bd2c Staging: cx25821: Change indent with spaces to tabs 23
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik 70e7f145e4 Staging: cx25821: Change indent with spaces to tabs 22
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:44 +02:00
Leonid V. Fedorenchik f9a8150c92 Staging: cx25821: Change indent with spaces to tabs 21
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik 02859b61cc Staging: cx25821: Change indent with spaces to tabs 20
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik 6678762aa2 Staging: cx25821: Change indent with spaces to tabs 19
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik 255c040a42 Staging: cx25821: Change indent with spaces to tabs 18
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik a39bea3a4e Staging: cx25821: Change indent with spaces to tabs 17
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik eda59eb189 Staging: cx25821: Change indent with spaces to tabs 16
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik 3f3d9e4a54 Staging: cx25821: Change indent with spaces to tabs 15
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:43 +02:00
Leonid V. Fedorenchik 21377cdd5e Staging: cx25821: Change indent with spaces to tabs 14
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik 55c37c0d6c Staging: cx25821: Change indent with spaces to tabs 13
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik 20e8a366c0 Staging: cx25821: Change indent with spaces to tabs 12
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik 0bf42c9e4f Staging: cx25821: Change indent with spaces to tabs 11
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik 9eadb1711c Staging: cx25821: Change indent with spaces to tabs 10
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik fb5f2c8010 Staging: cx25821: Change indent with spaces to tabs 9
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik 8ebbda49b7 Staging: cx25821: Change indent with spaces to tabs 8
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:42 +02:00
Leonid V. Fedorenchik e6cf66c1c0 Staging: cx25821: Change indent with spaces to tabs 7
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 8e4ac0741f Staging: cx25821: Change indent with spaces to tabs 6
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 2ba5149861 Staging: cx25821: Change indent with spaces to tabs 5
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 84cd410e11 Staging: cx25821: Change indent with spaces to tabs 4
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 48eb80ba3d Staging: cx25821: Change indent with spaces to tabs 3
Change indent with spaces to tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 788d0f33b9 Staging: cx25821: Change indent with spaces to tabs 2
Change indent with spaces to use tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 69dfe45f7b Staging: cx25821: Change indent with spaces to tabs 1
Changed indent with spaces to use tabs.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik c2c311fd3b Staging: cx25821: Fix indent in comment
Change indent in comment to use tabs instead of spaces.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:41 +02:00
Leonid V. Fedorenchik 692cfb9bec Staging: cx25821: Fix obscure line endings
Fix obscure line endings to less obscure ones. Rationale: readability.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:40 +02:00
Leonid V. Fedorenchik c1e6e24175 Staging: cx25821: Fix function signatures
Fix long function signatures (over 80 characters) and indent them
properly.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:40 +02:00
Leonid V. Fedorenchik 2748f26b6a Staging: cx25821: Fix labels' placement in cx25821-video.c
Delete whitespace before labels.

Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:45:40 +02:00
Joe Perches 95cd17c9f3 staging: Remove unnecessary semicolons when switch (foo) {...};
Done via perl script:

$ cat remove_semi_switch.pl
my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;

foreach my $file (@ARGV) {
    my $f;
    my $text;
    my $oldtext;

    next if ((-d $file));

    open($f, '<', $file)
	or die "$P: Can't open $file for read\n";
    $oldtext = do { local($/) ; <$f> };
    close($f);

    next if ($oldtext eq "");

    $text = $oldtext;

    my $count = 0;
    do {
	$count = 0;
	$count += $text =~ s@\b(switch\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
    } while ($count > 0);

    if ($text ne $oldtext) {
	my $newfile = $file;

	open($f, '>', $newfile)
	    or die "$P: Can't open $newfile for write\n";
	print $f $text;
	close($f);
    }
}

$

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 16:58:35 -07:00
Julia Lawall e2ce504977 drivers/staging/cx25821/cx25821-video.c: introduce missing kfree
Error handling code following a kmalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 14:11:47 -07:00
Arnd Bergmann 0cd301f19a [media] staging/cx25721: serialize access to devlist
Out of the three files accessing the device list,
one uses a mutex, one uses the BKL and one does
not have any locking. That is of course pointless,
so let's make all of them use the same mutex,
and get rid of one more BKL user.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:41 -03:00
Mauro Carvalho Chehab a7862aa90f [media] cx25821: Fix compilation breakage due to BKL dependency
drivers/staging/cx25821/cx25821-video.c: In function ‘video_open’:
drivers/staging/cx25821/cx25821-video.c:817:8: error: implicit declaration of function ‘lock_kernel’
drivers/staging/cx25821/cx25821-video.c:834:9: error: implicit declaration of function ‘unlock_kernel’

This patch just adds a header with BKL function. It should be enough
to avoid compilation breakage, but, as BKL will be removed, we need
to properly fix it on a latter patch.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-by: Anca Emanuel <anca.emanuel@gmail.com>
Cc: Palash Bandyopadhyay <Palash.Bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-05 13:41:40 -02:00
Hans Verkuil 657f227105 [media] v4l: fix handling of v4l2_input.capabilities
The v4l core sets the v4l2_input.capabilities field based on the supplied
v4l2_ioctl_ops. However, several drivers do a memset or memcpy of the v4l2_input
struct, thus overwriting that field incorrectly.

Either remove the memset (which is already done by the v4l core), or add the
proper capabilities field in case of a memcpy.

The same is also true for v4l2_output, but that only affected the ivtv driver.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:29 -02:00
Hans Verkuil 08af245de0 [media] V4L: remove V4L1 compatibility mode
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:07 -02:00
Joe Perches 36d89f7de4 [media] drivers/staging/cx25821: Use pr_fmt and pr_<level>
Fix several defects with bad line continuation uses that
introduce whitespace.
Fix several defects with lines missing "\n".
Standardize prefixes via pr_fmt.
Remove internal cx25821 prefixes.
Standardize :%s():" ... __func__ uses.
Coalesce long formats.
Add KERN_<level> prefixes via pr_<level> to printks.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:46 -02:00
Mauro Carvalho Chehab a757ee2216 [media] Don't export format_by_forcc on two different drivers
Drivers should append their name on exported symbols, to avoid
conflicts with allyesconfig:

drivers/staging/built-in.o: In function `format_by_fourcc':
/home/v4l/work_trees/linus/drivers/staging/cx25821/cx25821-video.c:96: multiple definition of `format_by_fourcc'
drivers/media/built-in.o:/home/v4l/work_trees/linus/drivers/media/common/saa7146_video.c:88: first defined here

Let's rename both occurences with a small shellscript:

for i in drivers/staging/cx25821/*.[ch]; do sed s,format_by_fourcc,cx25821_format_by_fourcc,g <$i >a && mv a $i; done
for i in drivers/media/common/saa7146*.[ch]; do sed s,format_by_fourcc,saa7146_format_by_fourcc,g <$i >a && mv a $i; done
for i in include/media/saa7146*.[ch]; do sed s,format_by_fourcc,saa7146_format_by_fourcc,g <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-02 01:59:10 -02:00
Hans Verkuil 08bff03ed6 V4L/DVB: videobuf: add ext_lock argument to the queue init functions
Add an ext_lock argument to the videobuf init functions. This allows
drivers to pass the vdev->lock pointer (or any other externally held lock)
to videobuf. For now all drivers just pass NULL.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00