Commit Graph

16 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab 01153bf04d media: dvb: do some coding style cleanup
Fix a bunch of coding style issues found by checkpatch on the
part of the code that the previous patches touched.

WARNING: please, no space before tabs
+ * ^I^Icallback.$

ERROR: space required before the open parenthesis '('
+	switch(cmd) {

WARNING: line over 80 characters
+			err = dtv_property_process_get(fe, &getp, tvp + i, file);

WARNING: line over 80 characters
+			err = fe->ops.diseqc_recv_slave_reply(fe, (struct dvb_diseqc_slave_reply*) parg);

ERROR: "(foo*)" should be "(foo *)"
+			err = fe->ops.diseqc_recv_slave_reply(fe, (struct dvb_diseqc_slave_reply*) parg);

WARNING: line over 80 characters
+				err = fe->ops.read_signal_strength(fe, (__u16 *) parg);

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:51:41 -04:00
Mauro Carvalho Chehab 6128a68dbc media: dvb_demux.h: document functions
The functions used on dvb_demux.h are largely used on DVB drivers.
Yet, none of them are documented.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:19:34 -04:00
Mauro Carvalho Chehab 198688cdc1 media: dvb_demux.h: document structs defined on it
There are three structs defined inside dvb_demux.h. None
of them are currently documented.

Add documentation for them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:18:33 -04:00
Mauro Carvalho Chehab e5c4be821a media: dvb_demux: document dvb_demux_filter and dvb_demux_feed
Document those two structs using kernel-doc markups.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:14:10 -04:00
Mauro Carvalho Chehab 4bc8525a34 media: dvb_demux: fix type of dvb_demux_feed.ts_type
Just like pes_type, this field represents an enum. Properly
identify it as such.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:12:28 -04:00
Mauro Carvalho Chehab cd3c601949 media: dvb_demux.h: get rid of DMX_FEED_ENTRY() macro
This isn't used anywere. Get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:11:49 -04:00
Mauro Carvalho Chehab 2c53275c1e media: dvb_demux: dvb_demux_feed.pusi_seen is boolean
Instead of using an integer to represent it, use boolean,
as this better describes what this field really means.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:10:59 -04:00
Mauro Carvalho Chehab 392cc7afbb media: dvb_demux: mark a boolean field as such
The struct dvb_demux_filter.doneq is a boolean.

Mark it as such, as it helps to understand what it does.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:10:35 -04:00
Mauro Carvalho Chehab 68d84ae02f media: dvb_demux.h: get rid of unused timer at struct dvb_demux_filter
This field is not used. So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:09:14 -04:00
Mauro Carvalho Chehab 999f3d25b8 media: dvb_demux.h: add an enum for DMX_STATE_* and document
kernel-doc allows documenting enums. Also, it makes clearer
about the meaning of each field on structures.

So, convert DMX_STATE_* to an enum.

While here, get rid of the unused DMX_STATE_SET.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:08:37 -04:00
Mauro Carvalho Chehab 0463625ee9 media: dvb_demux.h: add an enum for DMX_TYPE_* and document
kernel-doc allows documenting enums. Also, it makes clearer
about the meaning of each field on structures.

So, convert DMX_TYPE_* to an enum.

While here, get rid of the unused DMX_TYPE_PES.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-11 13:08:13 -04:00
Sakari Ailus bcb63314e2 [media] media: Drop FSF's postal address from the source code files
Drop the FSF's postal address from the source code files that typically
contain mostly the license text. Of the 628 removed instances, 578 are
outdated.

The patch has been created with the following command without manual edits:

git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
	drivers/media/ include/media|while read i; do i=$i perl -e '
open(F,"< $ENV{i}");
$a=join("", <F>);
$a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
	&& $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
close(F);
open(F, "> $ENV{i}");
print F $a;
close(F);'; done

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2017-01-27 11:38:09 -02:00
Mauro Carvalho Chehab dd79d27e1b [media] dvb-core: get rid of demux optional circular buffer
There is a provision at the dvb_demux.c to use a vmalloc'ed
circular buffer, enabled via an extra #ifdef option that it
is not at Kconfig. Enabling it will only make the Kernel to
allocate/deallocate such buffer, but no code would actually
use it. So, no practical effect, except for sparing some
memory without any good reason.

So, get rid of such dead code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 08:43:24 -02:00
Arnd Bergmann e95be15886 [media] dvb: use ktime_t for internal timeout
The dvb demuxer code uses a 'struct timespec' to pass a timeout
as absolute time. This will cause problems on 32-bit architectures
in 2038 when time_t overflows, and it is racy with a concurrent
settimeofday() call.

This patch changes the code to use ktime_get() instead, using
the monotonic time base to avoid both the race and the overflow.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08 16:36:00 -03:00
Mauro Carvalho Chehab fde04ab95d [media] demux.h: Remove duplicated enum
"enum dmx_ts_pes" and "typedef enum dmx_pes_type_t" are just the
same enum declared twice, since Kernel (2.6.12). There's no reason
to duplicate it there, and sparse complains about that:
	drivers/media/dvb-core/dmxdev.c:600:55: warning: mixing different enum types
So, remove the internal define, keeping just the external one.
Internally, use only "enum dmx_ts_pes", as it is too late to drop
dmx_pes_type_t from the userspace API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 06:53:15 -03:00
Mauro Carvalho Chehab 3d6c2bc08a [media] dvb: move the dvb core one level up
just like the V4L2 core, move the DVB core to drivers/media, as the
intention is to get rid of both "video" and "dvb" directories.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:08:14 -03:00