1. 23 9月, 2017 1 次提交
  2. 27 8月, 2017 1 次提交
  3. 20 8月, 2017 2 次提交
  4. 08 8月, 2017 2 次提交
  5. 21 7月, 2017 1 次提交
    • G
      media: saa7146: constify i2c_algorithm structure · ea925e4d
      Gustavo A. R. Silva 提交于
      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: NGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      ea925e4d
  6. 17 4月, 2017 1 次提交
    • B
      [media] b2c2: constify nxt200x_config structure · c5db7475
      Bhumika Goyal 提交于
      Declare nxt200x_config structure as const as it is only passed as
      an argument to the function dvb_attach. dvb_attach calls its first
      argument on the rest of its arguments. The first argument of
      dvb_attach in the changed case is nxt200x_attach and the parameter of
      this function to which the object reference is passed is of type
      const. So, nxt200x_config structures having this property can be made
      const.
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         7566	    568	      0	   8134	   1fc6	common/b2c2/flexcop-fe-tuner.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         7582	    536	      0	   8118	   1fb6	common/b2c2/flexcop-fe-tuner.o
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      c5db7475
  7. 11 4月, 2017 2 次提交
  8. 03 3月, 2017 1 次提交
  9. 03 2月, 2017 1 次提交
    • A
      [media] b2c2: use IS_REACHABLE() instead of open-coding it · 30f895a9
      Arnd Bergmann 提交于
      The FE_SUPPORTED() macro is basically the same as IS_REACHABLE, except
      that it causes a warning with gcc-7:
      
      common/b2c2/flexcop-fe-tuner.c:30:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
      common/b2c2/flexcop-fe-tuner.c:30:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
      common/b2c2/flexcop-fe-tuner.c:30:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
      
      Using IS_REACHABLE() to define it avoids the warning.
      
      Fixes: 3785bc17 ("[media] b2c2: break it into common/pci/usb directories")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      30f895a9
  10. 30 1月, 2017 2 次提交
  11. 27 1月, 2017 1 次提交
    • S
      [media] media: Drop FSF's postal address from the source code files · bcb63314
      Sakari Ailus 提交于
      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: NSakari Ailus <sakari.ailus@linux.intel.com>
      bcb63314
  12. 29 11月, 2016 1 次提交
  13. 24 11月, 2016 1 次提交
    • A
      [media] saa7146: Fix for while releasing video buffers · 59eba2d1
      Andrey Utkin 提交于
      Fix this bug:
      	"[BUG] process stuck when closing saa7146 [dvb_ttpci]"
      
      Release queued DMA buffers when ending streaming, so that
      videobuf_waiton() doesn't block forever.
      
      As reported, this fixes avoids occasional lockup of process reading from
      video device, which manifests in such log:
      
      INFO: task ffmpeg:9864 blocked for more than 120 seconds.
            Tainted: P           O    4.6.7 #3
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      ffmpeg          D ffff880177cc7b00     0  9864      1 0x00000000
       ffff880177cc7b00 0000000000000202 0000000000000202 ffffffff8180b4c0
       ffff88019d79e4c0 ffffffff81064050 ffff880177cc7ae0 ffff880177cc8000
       ffff880177cc7b18 ffff8801fd41d648 ffff8802307acca0 ffff8802307acc70
      Call Trace:
       [<ffffffff81064050>] ? preempt_count_add+0x89/0xab
       [<ffffffff81477215>] schedule+0x86/0x9e
       [<ffffffff81477215>] ? schedule+0x86/0x9e
       [<ffffffffa0fe1c96>] videobuf_waiton+0x131/0x15e [videobuf_core]
       [<ffffffff8107727b>] ? wait_woken+0x6d/0x6d
       [<ffffffffa1017be9>] saa7146_dma_free+0x39/0x5b [saa7146_vv]
       [<ffffffffa10186c4>] buffer_release+0x2a/0x3e [saa7146_vv]
       [<ffffffffa0fee4a8>] videobuf_vm_close+0xd8/0x103 [videobuf_dma_sg]
       [<ffffffff8112049e>] remove_vma+0x25/0x4d
       [<ffffffff81121a32>] exit_mmap+0xce/0xf7
       [<ffffffff8104381d>] mmput+0x4e/0xe2
       [<ffffffff810491fd>] do_exit+0x372/0x920
       [<ffffffff81049813>] do_group_exit+0x3c/0x98
       [<ffffffff810522ef>] get_signal+0x4e8/0x56e
       [<ffffffff810710a5>] ? task_dead_fair+0xd/0xf
       [<ffffffff81017020>] do_signal+0x23/0x521
       [<ffffffff81479e82>] ? _raw_spin_unlock_irqrestore+0x13/0x25
       [<ffffffff8109710d>] ? hrtimer_try_to_cancel+0xd7/0x104
       [<ffffffff8109b306>] ? ktime_get+0x4c/0xa1
       [<ffffffff81096ea6>] ? update_rmtp+0x46/0x5b
       [<ffffffff81097ce0>] ? hrtimer_nanosleep+0xe4/0x10e
       [<ffffffff81096e3c>] ? hrtimer_init+0xeb/0xeb
       [<ffffffff810014f8>] exit_to_usermode_loop+0x4f/0x93
       [<ffffffff810019fe>] syscall_return_slowpath+0x3b/0x46
       [<ffffffff8147a355>] entry_SYSCALL_64_fastpath+0x8d/0x8f
      Reported-by: NPhilipp Matthias Hahn <pmhahn+video@pmhahn.de>
      Tested-by: NPhilipp Matthias Hahn <pmhahn+video@pmhahn.de>
      Signed-off-by: NAndrey Utkin <andrey_utkin@fastmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      59eba2d1
  14. 19 11月, 2016 1 次提交
  15. 18 11月, 2016 1 次提交
    • M
      [media] tveeprom: print log messages using pr_foo() · 6037b3ca
      Mauro Carvalho Chehab 提交于
      Unfortunately, the callers of tveeprom don't do the right
      thing to initialize the device. So, it produces log messages
      like:
      
      [  267.533010]  (null): Hauppauge model 42012, rev C186, serial# 2819348
      [  267.533012]  (null): tuner model is Philips FQ1236 MK3 (idx 86, type 43)
      [  267.533013]  (null): TV standards NTSC(M) (eeprom 0x08)
      [  267.533014]  (null): audio processor is MSP3445 (idx 12)
      [  267.533015]  (null): has radio
      
      So, replace it to pr_foo(), as it should work fine.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      6037b3ca
  16. 22 10月, 2016 7 次提交
  17. 21 10月, 2016 6 次提交
    • M
      [media] tveeprom: use dev_foo() for printk messages · 7cda4c5b
      Mauro Carvalho Chehab 提交于
      Instead of calling a V4L-specific macro, do the right thing
      and use the dev_foo() macros.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      7cda4c5b
    • M
      [media] common: don't break long lines · 2a3edc5d
      Mauro Carvalho Chehab 提交于
      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: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      2a3edc5d
    • M
      [media] b2c2: don't break long lines · d9942ad0
      Mauro Carvalho Chehab 提交于
      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: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      d9942ad0
    • M
      [media] cx2341x: mark printk continuation lines as such · 6dd23d4c
      Mauro Carvalho Chehab 提交于
      This driver has printk continuation lines for debugging purposes.
      
      Since commit 56387331 ("Merge branch 'printk-cleanups'"),
      this won't work as expected anymore. So, let's add KERN_CONT to
      those lines.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      6dd23d4c
    • M
      [media] flexcop-i2c: mark printk continuation lines as such · 7887d371
      Mauro Carvalho Chehab 提交于
      This driver has printk continuation lines for debugging purposes.
      
      Since commit 56387331 ("Merge branch 'printk-cleanups'"),
      this won't work as expected anymore. So, let's add KERN_CONT to
      those lines.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      7887d371
    • M
      [media] dvb-core: move dvb_filter out of the DVB core · b676e731
      Mauro Carvalho Chehab 提交于
      The dvb_filter.c can hardly be considered as part of the DVB
      core. More than half of the code there is commented out by
      av7110 and ttusb_dec.
      
      On the latter, just two small helper functions and a struct
      definition is used.
      
      Being part of the core means that it would require an
      amount of work to fix issues in it, like bad printk's
      on it, and to document it on some future, like other kAPI
      headers. It simply not worth the effort for something that
      seems to be deprecated, as no new drivers use it.
      
      So, move it out of the core, by moving it to pci/ttpci
      directory, where av7110 driver is kept, and copy the two
      routines used by ttyusb_dec directly into its code.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      b676e731
  18. 24 8月, 2016 1 次提交
  19. 09 7月, 2016 1 次提交
  20. 21 4月, 2016 1 次提交
  21. 16 2月, 2016 1 次提交
    • M
      [media] siano: firmware buffer is too small · 21cf734c
      Mauro Carvalho Chehab 提交于
      As pointed by KASAN:
      
      	BUG: KASAN: slab-out-of-bounds in memcpy+0x1d/0x40 at addr ffff880000038d8c
      	Read of size 128 by task systemd-udevd/2536
      	page:ffffea0000000800 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
      	flags: 0xffff8000004000(head)
      	page dumped because: kasan: bad access detected
      	CPU: 1 PID: 2536 Comm: systemd-udevd Not tainted 4.5.0-rc3+ #47
      	Hardware name:                  /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
      	  ffff880000038d8c ffff8803b0f1f1e8 ffffffff81933901 0000000000000080
      	  ffff8803b0f1f280 ffff8803b0f1f270 ffffffff815602c5 ffffffff8284cf93
      	  ffffffff822ddc00 0000000000000282 0000000000000001 ffff88009c7c6000
      	Call Trace:
      	  [<ffffffff81933901>] dump_stack+0x85/0xc4
      	  [<ffffffff815602c5>] kasan_report_error+0x525/0x550
      	  [<ffffffff815606e9>] kasan_report+0x39/0x40
      	  [<ffffffff8155f84d>] memcpy+0x1d/0x40
      	  [<ffffffffa120cb90>] smscore_set_device_mode+0xee0/0x2560 [smsmdtv]
      
      Such error happens at the memcpy code below:
      
      0x4bc0 is in smscore_set_device_mode (drivers/media/common/siano/smscoreapi.c:975).
      970					      sizeof(u32) + payload_size));
      971
      972			data_msg->mem_addr = mem_address;
      973			memcpy(data_msg->payload, payload, payload_size);
      974
      975			rc = smscore_sendrequest_and_wait(coredev, data_msg,
      976					data_msg->x_msg_header.msg_length,
      977					&coredev->data_download_done);
      978
      979			payload += payload_size;
      
      The problem is that the Siano driver uses a header to store the firmware,
      with requires a few more bytes than allocated.
      
      Tested with:
      	PCTV 77e (2013:0257)
      	Hauppauge WinTV MiniStick (2040:5510)
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      21cf734c
  22. 05 2月, 2016 1 次提交
  23. 01 2月, 2016 1 次提交
    • A
      [media] b2c2: flexcop: avoid unused function warnings · 733d0def
      Arnd Bergmann 提交于
      The flexcop driver has two functions that are normally used, except
      when multiple frontend drivers are disabled:
      
      drivers/media/common/b2c2/flexcop-fe-tuner.c:42:12: warning: 'flexcop_set_voltage' defined but not used [-Wunused-function]
      drivers/media/common/b2c2/flexcop-fe-tuner.c:71:12: warning: 'flexcop_sleep' defined but not used [-Wunused-function]
      
      This avoids the build warning by updating the #ifdef for flexcop_set_voltage
      to the exact condition under which it is used. For flexcop_sleep, the
      condition is rather complex, so I resort to marking it as __maybe_unused,
      so the compiler can silently drop it.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      733d0def
  24. 25 1月, 2016 1 次提交
  25. 11 1月, 2016 1 次提交