History log of /linux-master/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
Revision Date Author Comments
# 883c84ac 02-Sep-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: dvb-ttusb-budget: cleanup printk logic

Instead of calling printk(), use pr_foo() macros.

While here, do some cleanup at the printed messages, as some
has __func__, while others have the module name (sometimes
spelled as "ttusb_dvb").

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 36e3cf0c 01-Sep-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: dvb-ttusb-budget: don't use stack for USB transfers

As reported by smatch:

drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:311 ttusb_boot_dsp() error: doing dma on the stack (b)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:321 ttusb_boot_dsp() error: doing dma on the stack (b)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:330 ttusb_boot_dsp() error: doing dma on the stack (b)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:351 ttusb_set_channel() error: doing dma on the stack (b)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:361 ttusb_del_channel() error: doing dma on the stack (b)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:412 ttusb_init_controller() error: doing dma on the stack (b0)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:416 ttusb_init_controller() error: doing dma on the stack (b1)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:422 ttusb_init_controller() error: doing dma on the stack (b2)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:425 ttusb_init_controller() error: doing dma on the stack (b3)
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:430 ttusb_init_controller() error: doing dma on the stack (get_version)

This driver still uses the USB stack for DMA transfers,
which is broken for a long time. I almost dropped this driver,
as there's a high chance that nobody is using it with upstream
Kernels, as we didn't receive any bug reports.

As fixing this won't be hard, I ended opting to fix.

While here, I dropped an ugly hack that implemented read via
a separate function that was just doing a memcpy().

It should be noticed that, during the init phase, there's
a "b4" register that were never initialized, as its buffer
were used just to store the results of "b3" initialization.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3e4d8f48 18-Feb-2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: usb: fix several typos

Use codespell to fix lots of typos over frontends.

Manually verified to avoid false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# cc1e6315 10-Sep-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: replace strcpy() by strscpy()

The strcpy() function is being deprecated upstream. Replace
it by the safer strscpy().

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 894f3009 10-Jan-2018 Christoph Hellwig <hch@lst.de>

media: ttusb-budget: Remove pci_zalloc_coherent() abuse

Switch to a plain kzalloc() instead of pci_zalloc_coherent() to allocate
memory for the USB DMA.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


# fada1935 28-Dec-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: move dvb kAPI headers to include/media

Except for DVB, all media kAPI headers are at include/media.

Move the headers to it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# cba862dc 29-Nov-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: drivers: remove "/**" from non-kernel-doc comments

Several comments are wrongly tagged as kernel-doc, causing
those warnings:

drivers/media/rc/st_rc.c:98: warning: No description found for parameter 'irq'
drivers/media/rc/st_rc.c:98: warning: No description found for parameter 'data'
drivers/media/pci/solo6x10/solo6x10-enc.c:183: warning: No description found for parameter 'solo_dev'
drivers/media/pci/solo6x10/solo6x10-enc.c:183: warning: No description found for parameter 'ch'
drivers/media/pci/solo6x10/solo6x10-enc.c:183: warning: No description found for parameter 'qp'
drivers/media/usb/pwc/pwc-dec23.c:652: warning: Cannot understand *
on line 652 - I thought it was a doc line
drivers/media/usb/dvb-usb/cinergyT2-fe.c:40: warning: No description found for parameter 'op'
drivers/media/usb/dvb-usb/friio-fe.c:301: warning: Cannot understand * (reg, val) commad list to initialize this module.
on line 301 - I thought it was a doc line
drivers/media/rc/streamzap.c:201: warning: No description found for parameter 'urb'
drivers/media/rc/streamzap.c:333: warning: No description found for parameter 'intf'
drivers/media/rc/streamzap.c:333: warning: No description found for parameter 'id'
drivers/media/rc/streamzap.c:464: warning: No description found for parameter 'interface'
drivers/media/i2c/ov5647.c:432: warning: Cannot understand * @short Subdev core operations registration
on line 432 - I thought it was a doc line
drivers/media/usb/dvb-usb/friio.c:35: warning: No description found for parameter 'd'
drivers/media/usb/dvb-usb/friio.c:35: warning: No description found for parameter 'addr'
drivers/media/usb/dvb-usb/friio.c:35: warning: No description found for parameter 'wbuf'
drivers/media/usb/dvb-usb/friio.c:35: warning: No description found for parameter 'wlen'
drivers/media/usb/dvb-usb/friio.c:35: warning: No description found for parameter 'rbuf'
drivers/media/usb/dvb-usb/friio.c:35: warning: No description found for parameter 'rlen'
drivers/media/platform/vim2m.c:350: warning: No description found for parameter 'priv'
drivers/media/dvb-frontends/tua6100.c:34: warning: cannot understand function prototype: 'struct tua6100_priv '
drivers/media/platform/sti/hva/hva-h264.c:140: warning: cannot understand function prototype: 'struct hva_h264_stereo_video_sei '
drivers/media/platform/sti/hva/hva-h264.c:150: warning: Cannot understand * @frame_width: width in pixels of the buffer containing the input frame
on line 150 - I thought it was a doc line
drivers/media/platform/sti/hva/hva-h264.c:356: warning: Cannot understand * @ slice_size: slice size
on line 356 - I thought it was a doc line
drivers/media/platform/sti/hva/hva-h264.c:369: warning: Cannot understand * @ bitstream_size: bitstream size
on line 369 - I thought it was a doc line
drivers/media/platform/sti/hva/hva-h264.c:395: warning: Cannot understand * @seq_info: sequence information buffer
on line 395 - I thought it was a doc line
drivers/media/dvb-frontends/sp887x.c:137: warning: No description found for parameter 'fe'
drivers/media/dvb-frontends/sp887x.c:137: warning: No description found for parameter 'fw'
drivers/media/dvb-frontends/sp887x.c:287: warning: No description found for parameter 'n'
drivers/media/dvb-frontends/sp887x.c:287: warning: No description found for parameter 'd'
drivers/media/dvb-frontends/sp887x.c:287: warning: No description found for parameter 'quotient_i'
drivers/media/dvb-frontends/sp887x.c:287: warning: No description found for parameter 'quotient_f'
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:83: warning: cannot understand function prototype: 'struct ttusb '
drivers/media/platform/sh_veu.c:277: warning: No description found for parameter 'priv'
drivers/media/dvb-frontends/zl10036.c:33: warning: cannot understand function prototype: 'int zl10036_debug; '
drivers/media/dvb-frontends/zl10036.c:179: warning: No description found for parameter 'state'
drivers/media/dvb-frontends/zl10036.c:179: warning: No description found for parameter 'frequency'
drivers/media/platform/rcar_fdp1.c:1139: warning: No description found for parameter 'priv'
drivers/media/platform/ti-vpe/vpe.c:933: warning: No description found for parameter 'priv'
drivers/media/usb/gspca/ov519.c:36: warning: No description found for parameter 'fmt'
drivers/media/usb/dvb-usb/dib0700_devices.c:3367: warning: No description found for parameter 'adap'

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 7fb2e072 13-Aug-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

media: usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

'drivers/media/usb/b2c2/flexcop-usb.c' Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 8d08a4c1 09-Jul-2017 Gustavo A. R. Silva <garsilva@embeddedor.com>

media: dvb-ttusb-budget: constify i2c_algorithm structure

Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 80ebec68 18-Oct-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] ttusb-budget: don't break long lines

Due to the 80-cols restrictions, and latter due to checkpatch
warnings, several strings were broken into multiple lines. This
is not considered a good practice anymore, as it makes harder
to grep for strings at the source code.

As we're right now fixing other drivers due to KERN_CONT, we need
to be able to identify what printk strings don't end with a "\n".
It is a way easier to detect those if we don't break long lines.

So, join those continuation lines.

The patch was generated via the script below, and manually
adjusted if needed.

</script>
use Text::Tabs;
while (<>) {
if ($next ne "") {
$c=$_;
if ($c =~ /^\s+\"(.*)/) {
$c2=$1;
$next =~ s/\"\n$//;
$n = expand($next);
$funpos = index($n, '(');
$pos = index($c2, '",');
if ($funpos && $pos > 0) {
$s1 = substr $c2, 0, $pos + 2;
$s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
$s2 =~ s/^\s+//;

$s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");

print unexpand("$next$s1\n");
print unexpand("$s2\n") if ($s2 ne "");
} else {
print "$next$c2\n";
}
$next="";
next;
} else {
print $next;
}
$next="";
} else {
if (m/\"$/) {
if (!m/\\n\"$/) {
$next=$_;
next;
}
}
}
print $_;
}
</script>

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 0df289a2 07-Jun-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] dvb: Get rid of typedev usage for enums

The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*


# 6850aeab 08-Aug-2014 Joe Perches <joe@perches.com>

media: use pci_zalloc_consistent

Remove the now unnecessary memset too.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 0ee4c2ac 28-Jun-2014 Fabian Frederick <fabf@skynet.be>

[media] drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c: remove unnecessary null test before usb_free_urb

Fix checkpatch warning:
WARNING: usb_free_urb(NULL) is safe this check is probably not required

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# b9d4b2da 10-Jun-2013 Alexey Khoroshilov <khoroshilov@ispras.ru>

[media] ttusb-budget: fix memory leak in ttusb_probe()

If something goes wrong starting from i2c_add_adapter(),
ttusb->iso_urb[] and ttusb itself are not deallocated.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# fde04ab9 04-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# bf5bbed1 07-Feb-2013 Dan Carpenter <dan.carpenter@oracle.com>

[media] dvb-usb: check for invalid length in ttusb_process_muxpack()

This patch is driven by a static checker warning.
The ttusb_process_muxpack() function is only called from
ttusb_process_frame(). Before calling, it verifies that len >= 2. The
problem is that len == 2 is not valid and would lead to an array
underflow.
Odd number values for len are also invalid and would lead to reading
past the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 786baecf 14-Jun-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] dvb-usb: move it to drivers/media/usb/dvb-usb

As media/dvb will be removed, move it to a proper place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>