1. 29 Nov, 2017 1 commit
  2. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      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: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  3. 25 Oct, 2017 2 commits
    • Takashi Iwai's avatar
      ALSA: sb: Minor optimization / fix of timer usage in sb8_midi.c · 20e5f8bf
      Takashi Iwai authored
      Currently the SB8 MIDI code sets up the timer object at each time
      before scheduling it at trigger callback, but basically this is
      superfluous once after set up.  Also, the code misses the
      del_timer_sync() call that may leave a race condition for
      use-after-free.
      
      This patch addresses these issues, moving timer_setup() to
      snd_sb8dsp_midi(), and adding the del_timer_sync() call at
      snd_sb8dsp_midi_output_trigger() to make sure.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      20e5f8bf
    • Kees Cook's avatar
      ALSA: sb: Convert timers to use timer_setup() · 4f928246
      Kees Cook authored
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      
      [Re-use the existing chip->midi_substream_output instead of assigning
       a new field to struct snd_sb -- tiwai]
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4f928246
  4. 24 Oct, 2017 1 commit
  5. 17 Aug, 2017 15 commits
  6. 15 Aug, 2017 1 commit
  7. 12 Aug, 2017 9 commits
  8. 18 Jul, 2017 4 commits
    • Arnd Bergmann's avatar
      ALSA: opti9xx: fix format string overflow warning · 24d22077
      Arnd Bergmann authored
      We pass a long name from "codec->pcm->name" into the longname
      string of the same length:
      
      sound/isa/opti9xx/miro.c: In function 'snd_miro_probe':
      sound/isa/opti9xx/miro.c:1356:39: error: '%s' directive writing up to 79 bytes into a region of size between 35 and 72 [-Werror=format-overflow=]
        sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
                                             ^~
      sound/isa/opti9xx/miro.c:1356:26: note: using the range [0, 4294967295] for directive argument
        sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      sound/isa/opti9xx/miro.c:1356:2: note: 'sprintf' output between 32 and 185 bytes into a destination of size 80
        sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
      
      There is no easy way to avoid the theoretical overflow in this case,
      but using snprintf() will turn it into a harmless truncation.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      24d22077
    • Arnd Bergmann's avatar
      ALSA: ad1848: fix format string overflow warning · 003d3e70
      Arnd Bergmann authored
      The snd_pcm name is too long to fit into the card shortname
      or a part of the longname:
      
      sound/isa/ad1848/ad1848.c: In function 'snd_ad1848_probe':
      sound/isa/ad1848/ad1848.c:116:26: error: ' at 0x' directive writing 6 bytes into a region of size between 1 and 80 [-Werror=format-overflow=]
        sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      sound/isa/ad1848/ad1848.c:116:2: note: 'sprintf' output between 22 and 128 bytes into a destination of size 80
        sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         chip->pcm->name, chip->port, irq[n], dma1[n]);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This changes the code to use length-checking functions that truncate
      if necessary. The "[Thinkpad]" substring is now also part of the
      snprintf(), as that could also overflow the buffer.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      003d3e70
    • Arnd Bergmann's avatar
      ALSA: cs423x: fix format string overflow warning · 6d8b04de
      Arnd Bergmann authored
      The snd_pcm name may overflow the card->longname total size:
      
      sound/isa/cs423x/cs4231.c: In function 'snd_cs4231_probe':
      sound/isa/cs423x/cs4231.c:115:26: error: ' at 0x' directive writing 6 bytes into a region of size between 1 and 80 [-Werror=format-overflow=] 0x%lx, irq %d, dma %d",
        sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This changes the driver to use snprintf() so we truncate the string
      instead of overflowing into the next field if that happens.
      
      I decided to split out the second format string for the extra
      DMA channel to keep the code simpler.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6d8b04de
    • Arnd Bergmann's avatar
      ALSA: als100: fix format string overflow warning · 8a463639
      Arnd Bergmann authored
      The compiler sees that the format string might overflow for the longname:
      
      sound/isa/als100.c: In function 'snd_als100_pnp_detect':
      sound/isa/als100.c:225:27: error: ', dma ' directive writing 6 bytes into a region of size between 0 and 64 [-Werror=format-overflow=]
         sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      sound/isa/als100.c:225:3: note: 'sprintf' output between 24 and 113 bytes into a destination of size 80
         sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
      
      Open-coding "shortname" here gets us below the limit, and using
      snprintf() is a good idea too.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8a463639
  9. 07 Jul, 2017 1 commit
  10. 20 Jun, 2017 1 commit
    • Ingo Molnar's avatar
      sched/wait: Rename wait_queue_t => wait_queue_entry_t · ac6424b9
      Ingo Molnar authored
      Rename:
      
      	wait_queue_t		=>	wait_queue_entry_t
      
      'wait_queue_t' was always a slight misnomer: its name implies that it's a "queue",
      but in reality it's a queue *entry*. The 'real' queue is the wait queue head,
      which had to carry the name.
      
      Start sorting this out by renaming it to 'wait_queue_entry_t'.
      
      This also allows the real structure name 'struct __wait_queue' to
      lose its double underscore and become 'struct wait_queue_entry',
      which is the more canonical nomenclature for such data types.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ac6424b9
  11. 12 Jun, 2017 1 commit
    • Takashi Iwai's avatar
      ALSA: seq: Allow the modular sequencer registration · 111b0cdb
      Takashi Iwai authored
      Many drivers bind the sequencer stuff in off-load by another driver
      module, so that it's loaded only on demand.  In the current code, this
      mechanism doesn't work when the driver is built-in while the sequencer
      is module.  We check with IS_REACHABLE() and enable only when the
      sequencer is in the same level of build.
      
      However, this is basically a overshoot.  The binder code
      (snd-seq-device) is an individual module from the sequencer core
      (snd-seq), and we just have to make the former a built-in while
      keeping the latter a module for allowing the scenario like the above.
      
      This patch achieves that by rewriting Kconfig slightly.  Now, a driver
      that provides the manual sequencer device binding should select
      CONFIG_SND_SEQ_DEVICE in a way as
      	select SND_SEQ_DEVICE if SND_SEQUENCER != n
      
      Note that the "!=n" is needed here to avoid the influence of the
      sequencer core is module while the driver is built-in.
      
      Also, since rawmidi.o may be linked with snd_seq_device.o when
      built-in, we have to shuffle the code to make the linker happy.
      (the kernel linker isn't smart enough yet to handle such a case.)
      That is, snd_seq_device.c is moved to sound/core from sound/core/seq,
      as well as Makefile.
      
      Last but not least, the patch replaces the code using IS_REACHABLE()
      with IS_ENABLED(), since now the condition meets always when enabled.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      111b0cdb
  12. 09 Jun, 2017 3 commits
    • Takashi Iwai's avatar
      ALSA: synth: Select snd-emux-synth explicitly · 82721155
      Takashi Iwai authored
      Instead of the non-standard way to enable the build of snd-emux-synth
      module inside Makefile, rewrite Kconfig to select the item explicitly
      from each driver (sbawe and emu10k1).  This is the standard way.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      82721155
    • Takashi Iwai's avatar
      ALSA: seq: Reorganize kconfig and build · 0181307a
      Takashi Iwai authored
      This is a slightly intensive rewrite of Kconfig and Makefile about
      ALSA sequencer stuff.
      
      The first major change is that the kconfig items for the sequencer are
      moved to sound/core/seq/Kconfig.  OK, that's easy.
      
      The substantial change is that, instead of hackish top-level module
      selection in Makefile, we define a Kconfig item for each sequencer
      module.  The driver that requires such sequencer components select
      exclusively the kconfig items.  This is more straightforward and
      standard way.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      0181307a
    • Takashi Iwai's avatar
      ALSA: seq: Allow the tristate build of OSS emulation · 3d774d5e
      Takashi Iwai authored
      Currently OSS sequencer emulation is tied with ALSA sequencer core,
      both are built in the same level; i.e. when CONFIG_SND_SEQUENCER=y,
      the OSS sequencer emulation is also always built-in, even though the
      functionality can be built as an individual module.
      
      This patch changes the rule and allows users to build snd-seq-oss
      module while others are built-in.  Essentially, it's just a few simple
      changes in Kconfig and Makefile.  Some driver codes like opl3 need to
      convert from the simple ifdef to IS_ENABLED().  But that's all.
      
      You might wonder how about the dependency: right, it can be messy, but
      it still works.  Since we rewrote the sequencer binding with the
      standard bus, the driver can be bound at any time on demand.  So, the
      synthesizer driver module can be loaded individually from the OSS
      emulation core before/after it.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3d774d5e