Skip to content
Snippets Groups Projects
  1. Jan 24, 2014
    • Joe Perches's avatar
      checkpatch: attempt to find missing switch/case break; · c34c09a8
      Joe Perches authored
      
      switch case statements missing a break statement are an unfortunately
      common error.
      
      e.g.:
        commit 4a2c94c9 ("HID: kye: Add report fixup for Genius Manticore Keyboard")
      
      case blocks should end in a break/return/goto/continue.
      
      If a fall-through is used, it should have a comment showing that it is
      intentional.  Ideally that comment should be something like:
      "/* fall-through */"
      
      Add a test to look for missing break statements.
      
      This looks only at the context lines before an inserted case so it's
      possible to have false positives when the context contains a close brace
      and the break is before the brace and not part of the patch context.
      
      Looking at recent patches, this is a pretty rare occurrence.  The normal
      kernel style uses a break as the last line of the previous block.
      
      Signed-off-by: default avatarJoe Perches <joe@perche.com>
      Cc: Andy Whitcroft <apw@shadowen.org>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c34c09a8
    • David Rientjes's avatar
      checkpatch: add warning of future __GFP_NOFAIL use · 7e4915e7
      David Rientjes authored
      
      gfp.h and page_alloc.c already specify that __GFP_NOFAIL is deprecated and
      no new users should be added.
      
      Add a warning to checkpatch to catch this.
      
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7e4915e7
    • Joe Perches's avatar
      checkpatch: warn only on "space before semicolon" at end of line · d2e248e7
      Joe Perches authored
      
      The "space before a non-naked semicolon" test has unwanted output when
      used in "for ( ;; )" loops.
      
      Make the test work only on end-of-line statement termination semicolons.
      
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d2e248e7
    • Joe Perches's avatar
      checkpatch: more comprehensive split strings warning · 8c5fcd24
      Joe Perches authored
      
      The current checkpatch test for split strings does not find several
      cases that should be found.
      
      For instance:
      
       		/* Else poor success; go back to mode in "active" table */
       		} else {
       			IWL_DEBUG_RATE(mvm,
      -				       "LQ: GOING BACK TO THE OLD TABLE suc=%d cur-tpt=%d old-tpt=%d\n",
      +				       "GOING BACK TO THE OLD TABLE: SR %d "
      +				       "cur-tpt %d old-tpt %d\n",
       				       window->success_ratio,
       				       window->average_tpt,
       				      lq_sta->last_tpt);
      
      does not currently emit a warning.
      
      Improve the test to find these cases.
      
      Add more exceptions to reduce false positives for assembly and octal/hex
      string constants.
      
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8c5fcd24
    • Joe Perches's avatar
      get_maintainer: add commit author information to --rolestats · c9ecefea
      Joe Perches authored
      
      get_maintainer currently uses "Signed-off-by" style lines to find
      interested parties to send patches to when the MAINTAINERS file does not
      have a specific section entry with a matching file pattern.
      
      Add statistics for commit authors and lines added and deleted to the
      information provided by --rolestats.
      
      These statistics are also emitted whenever --rolestats and --git are
      selected even when there is a specified maintainer.
      
      This can have the effect of expanding the number of people that are shown
      as possible "maintainers" of a particular file because "authors",
      "added_lines", and "removed_lines" are also used as criterion for the
      --max-maintainers option separate from the "commit_signers".
      
      The first "--git-max-maintainers" values of each criterion
      are emitted.  Any "ties" are not shown.
      
      For example: (forcedeth does not have a named maintainer)
      
      Old output:
      
      $ ./scripts/get_maintainer.pl -f drivers/net/ethernet/nvidia/forcedeth.c
      "David S. Miller" <davem@davemloft.net> (commit_signer:8/10=80%)
      Jiri Pirko <jiri@resnulli.us> (commit_signer:2/10=20%)
      Patrick McHardy <kaber@trash.net> (commit_signer:2/10=20%)
      Larry Finger <Larry.Finger@lwfinger.net> (commit_signer:1/10=10%)
      Peter Zijlstra <peterz@infradead.org> (commit_signer:1/10=10%)
      netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
      linux-kernel@vger.kernel.org (open list)
      
      New output:
      
      $ ./scripts/get_maintainer.pl -f drivers/net/ethernet/nvidia/forcedeth.c
      "David S. Miller" <davem@davemloft.net> (commit_signer:8/10=80%)
      Jiri Pirko <jiri@resnulli.us> (commit_signer:2/10=20%,authored:2/10=20%,removed_lines:3/33=9%)
      Patrick McHardy <kaber@trash.net> (commit_signer:2/10=20%,authored:2/10=20%,added_lines:12/95=13%,removed_lines:10/33=30%)
      Larry Finger <Larry.Finger@lwfinger.net> (commit_signer:1/10=10%,authored:1/10=10%,added_lines:35/95=37%)
      Peter Zijlstra <peterz@infradead.org> (commit_signer:1/10=10%)
      "Peter Hüwe" <PeterHuewe@gmx.de> (authored:1/10=10%,removed_lines:15/33=45%)
      Joe Perches <joe@perches.com> (authored:1/10=10%)
      Neil Horman <nhorman@tuxdriver.com> (added_lines:40/95=42%)
      Bill Pemberton <wfp5p@virginia.edu> (removed_lines:3/33=9%)
      netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
      linux-kernel@vger.kernel.org (open list)
      
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c9ecefea
    • Paul Bolle's avatar
      headers_check: special case seqbuf_dump() · a7e1d98f
      Paul Bolle authored
      "make headers_check" warns about soundcard.h for (at least) five years
      now:
          [...]/usr/include/linux/soundcard.h:1054: userspace cannot reference function or variable defined in the kernel
      
      We're apparently stuck with providing OSSlib-3.8 compatibility, so let's
      special case this declaration just to silence it.
      
      Notes:
      
      0) Support for OSSlib post 3.8 was already removed in commit 43a99076
         ("sound: Remove OSSlib stuff from linux/soundcard.h").  Five years have
         passed since that commit: do people still care about OSSlib-3.8?  If
         not, quite a bit of code could be remove from soundcard.h (and probably
         ultrasound.h).
      
      2) By the way, what is actually meant by:
          It is no longer possible to actually link against OSSlib with this
          header, but we still provide these macros for programs using them.
      
      Doesn't that mean compatibility to OSSlib isn't even useful?
      
      3) Anyhow, a previous discussion soundcard.h, which led to that commit,
         starts at https://lkml.org/lkml/2009/1/20/349
      
       .
      
      4) And, yes, I sneaked in a whitespace fix.
      
      Signed-off-by: default avatarPaul Bolle <pebolle@tiscali.nl>
      Cc: Takashi Iwai <tiwai@suse.de>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a7e1d98f
    • Michal Simek's avatar
      microblaze: extable: sort the exception table at build time · 372c7209
      Michal Simek authored
      
      Sort the exception table at build-time rather than during boot.
      
      Microblaze is the same case as AARCH64 that's why EM_MICROBLAZE
      conditional check was added to allow cross-compilation on machines which
      are not running the latest libc-dev.
      
      Inspired by AARCH64 commit adace895 ("arm64: extable: sort the
      exception table at build time").
      
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Acked-by: default avatarDavid Daney <david.daney@cavium.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      372c7209
  2. Jan 08, 2014
  3. Dec 20, 2013
  4. Dec 13, 2013
  5. Dec 10, 2013
  6. Dec 05, 2013
  7. Dec 02, 2013
  8. Nov 25, 2013
  9. Nov 22, 2013
  10. Nov 13, 2013
  11. Nov 08, 2013
  12. Nov 07, 2013
  13. Nov 06, 2013
Loading