1. 05 6月, 2018 1 次提交
    • A
      media: marvel-ccic: allow ccic and mmp drivers to coexist · ee20a445
      Arnd Bergmann 提交于
      Randconfig builds fail when one of the two is a built-in driver and
      the other one is a loadable module:
      
      drivers/media/platform/marvell-ccic/mcam-core.o: In function `mccic_register':
      mcam-core.c:(.text+0x2594): undefined reference to `__this_module'
      drivers/media/platform/marvell-ccic/mcam-core.o:(.rodata+0x50): undefined reference to `__this_module'
      
      The problem is that mcam-core.c can not be built both ways at the smae
      time. However, we can make kbuild take care of that by making the core
      driver a separate module, which can be either built-in or loadable
      as needed.
      Making it a separate module requires exporting a few symbols and
      adding the module license from the header.
      
      Fixes: 0a9c643c ("media: marvel-ccic: re-enable mmp-driver build")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      ee20a445
  2. 23 2月, 2018 1 次提交
  3. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  4. 27 8月, 2017 1 次提交
    • B
      media: platform: make video_device const · 5303135c
      Bhumika Goyal 提交于
      Make these const as they are only used during a copy operation.
      Done using Coccinelle:
      
      @match disable optional_qualifier@
      identifier s;
      @@
      static struct video_device s = {...};
      
      @ref@
      position p;
      identifier match.s;
      @@
      s@p
      
      @good1@
      identifier match.s;
      expression list[3] es;
      position ref.p;
      @@
      cx88_vdev_init(es,&s@p,...)
      
      @good2@
      position ref.p;
      identifier match.s,f,c;
      expression e;
      @@
      (
      e = s@p
      |
      e = s@p.f
      |
      c(...,s@p.f,...)
      |
      c(...,s@p,...)
      )
      
      @bad depends on  !good1 && !good2@
      position ref.p;
      identifier match.s;
      @@
      s@p
      
      @depends on forall !bad disable optional_qualifier@
      identifier match.s;
      @@
      static
      + const
      struct video_device s;
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      5303135c
  5. 19 5月, 2017 1 次提交
    • M
      [media] media drivers: annotate fall-through · 06eeefe8
      Mauro Carvalho Chehab 提交于
      Avoid warnings like those:
      
      drivers/media/pci/ddbridge/ddbridge-core.c: In function 'dvb_input_detach':
      drivers/media/pci/ddbridge/ddbridge-core.c:787:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (input->fe) {
            ^
      drivers/media/pci/ddbridge/ddbridge-core.c:792:2: note: here
        case 4:
        ^~~~
      ...
      
      On several cases, it is just that gcc 7.1 is not capable of
      understanding the comment, but on other places, we need an
      annotation.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      06eeefe8
  6. 21 10月, 2016 1 次提交
    • M
      [media] marvell-ccic: don't break long lines · a4585c31
      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>
      a4585c31
  7. 12 7月, 2016 1 次提交
  8. 09 7月, 2016 2 次提交
  9. 18 12月, 2015 2 次提交
  10. 17 11月, 2015 1 次提交
    • M
      [media] include/media: split I2C headers from V4L2 core · b5dcee22
      Mauro Carvalho Chehab 提交于
      Currently, include/media is messy, as it contains both the V4L2 core
      headers and some driver-specific headers on the same place. That makes
      harder to identify what core headers should be documented and what
      headers belong to I2C drivers that are included only by bridge/main
      drivers that would require the functions provided by them.
      
      Let's move those i2c specific files to its own subdirectory.
      
      The files to move were produced via the following script:
      	mkdir include/media/i2c
      	(cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
      	(cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/*/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
      	for i in include/media/*.h; do n=`basename $i`;  (for j in $(git grep -l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep i2c list`" != "" ]; then git mv $i include/media/i2c; fi; fi; done
      
      And the references corrected via this script:
          MAIN_DIR="media/"
          PREV_DIR="media/"
          DIRS="i2c/"
      
          echo "Checking affected files" >&2
          for i in $DIRS; do
      	for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
      		 n=`basename $j`
      		git grep -l $n
      	done
          done|sort|uniq >files && (
      	echo "Handling files..." >&2;
      	echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
      	(
      		cd include/$MAIN_DIR;
      		for j in $DIRS; do
      			for i in $(ls $j); do
      				echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\";
      			done;
      		done;
      		echo "cat > a && mv a \$i; done";
      	);
      	echo "Handling documentation..." >&2;
      	echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
      	(
      		cd include/$MAIN_DIR;
      		for j in $DIRS; do
      			for i in $(ls $j); do
      				echo "  perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
      			done;
      		done;
      		echo "cat > a && mv a \$i; done"
      	);
          ) >script && . ./script
      
      Merged Sakari Ailus patch that moves smiapp.h to include/media/i2c.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      b5dcee22
  11. 21 10月, 2015 1 次提交
  12. 01 10月, 2015 1 次提交
  13. 12 5月, 2015 1 次提交
  14. 01 5月, 2015 19 次提交
  15. 28 4月, 2015 1 次提交
    • H
      [media] marvell-ccic: fix Y'CbCr ordering · 2a700d8e
      Hans Verkuil 提交于
      Various formats had their byte ordering implemented incorrectly, and
      the V4L2_PIX_FMT_UYVY is actually impossible to create, instead you
      get V4L2_PIX_FMT_YVYU.
      
      This was working before commit ad6ac452
      ("add new formats support for marvell-ccic driver"). That commit broke
      the original format support and the OLPC XO-1 laptop showed wrong
      colors ever since (if you are crazy enough to attempt to run the latest
      kernel on it, like I did).
      
      The email addresses of the authors of that patch are no longer valid,
      so without a way to reach them and ask them about their test setup
      I am going with what I can test on the OLPC laptop.
      
      If this breaks something for someone on their non-OLPC setup, then
      contact the linux-media mailinglist. My suspicion however is that
      that commit went in untested.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NJonathan Corbet <corbet@lwn.net>
      Cc: <stable@vger.kernel.org>      # for v3.19 and up
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      2a700d8e
  16. 24 3月, 2015 1 次提交
  17. 23 12月, 2014 1 次提交
  18. 02 12月, 2014 2 次提交
  19. 25 11月, 2014 1 次提交
    • H
      [media] vb2-dma-sg: move dma_(un)map_sg here · d790b7ed
      Hans Verkuil 提交于
      This moves dma_(un)map_sg to the get_userptr/put_userptr and alloc/put
      memops of videobuf2-dma-sg.c and adds dma_sync_sg_for_device/cpu to the
      prepare/finish memops.
      
      Now that vb2-dma-sg will sync the buffers for you in the prepare/finish
      memops we can drop that from the drivers that use dma-sg.
      
      For the solo6x10 driver that was a bit more involved because it needs to
      copy JPEG or MPEG headers to the buffer before returning it to userspace,
      and that cannot be done in the old place since the buffer there is still
      setup for DMA access, not for CPU access. However, the buf_finish
      op is the ideal place to do this. By the time buf_finish is called
      the buffer is available for CPU access, so copying to the buffer is fine.
      
      [mchehab@osg.samsung.com: Fix a compilation breakage:
       drivers/media/v4l2-core/videobuf2-dma-sg.c:150:19: error: 'struct vb2_dma_sg_buf' has no member named 'dma_sgt']
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      d790b7ed