summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Coccinelle: Add a new mode named 'chain'Nicolas Palix2010-10-131-5/+11
| | | | | | | | | | | | | spatch now returns -1 when a virtual rule (given with -D on the command line) is not defined in the semantic patch. Using this spatch feature, coccicheck is now tries several modes by default, in the order: patch, report, context, org Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Use new comment format to explain kfree.cocciNicolas Palix2010-10-131-4/+5
| | | | | | | | | Use new comment format to separate proposed commit message and information about generated false positives Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Improve user information with a new kind of commentNicolas Palix2010-10-131-3/+11
| | | | | | | | | | | Improve user information with a new kind of comment about semantic patch output. Fix spelling. Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Update documentationNicolas Palix2010-10-131-7/+35
| | | | | | | | | | - Add information about use of the C={1,2} make flag - Add a description of the new chain mode mechanism - Add a link to the wiki Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* MAINTAINERS: Coccinelle: Update email addressNicolas Palix2010-10-131-1/+1
| | | | | | | Update my email address Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Documentation/kbuild: modules.txt cleanupmatt mooney2010-10-051-30/+32
| | | | | | | | | | A few modifications done for consistency, such as adding the shell prompt for command line examples and trailing slash for directories. Also corrects the module include header and fixes a few grammar issues that I introduced. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Documentation/kbuild: major edit of modules.txt sections 5-8matt mooney2010-09-291-181/+177
| | | | | | | | | | | A follow-up to my edit of the first 4 sections. Shift sections down by one due to the deletion of section 3; grammar corrections along with some rewording; margin width cleanup; and change EXTRA_CFLAGS -> ccflags-y. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Documentation/kbuild: major edit of modules.txt sections 1-4matt mooney2010-09-291-198/+189
| | | | | | | | | Omit needless words and sentences; reorganize and tighten sentence structure; swap sections 2.2 and 2.3 for a more logical flow; remove section 3, therefore shifting 4->3; add to explanations; and add section on building multiple modules. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add misc/ifcol.cocciNicolas Palix2010-08-311-0/+48
| | | | | | | | | | | | | | | Find confusingly indented code in or after an if. An if branch should be indented. The code following an if should not be indented. Sometimes, code after an if that is indented is actually intended to be part of the if branch. This has a high rate of false positives, because Coccinelle's column calculation does not distinguish between spaces and tabs, so code that is not visually aligned may be considered to be in the same column. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add misc/doubleinit.cocciNicolas Palix2010-08-311-0/+53
| | | | | | | | | | Find duplicate field initializations. This has a high rate of false positives due to #ifdefs, which Coccinelle is not aware of in a structure initialization. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Move alloc directory into api directoryNicolas Palix2010-08-312-1/+5
| | | | | | | | | alloc contains various semantic patches related to the allocation APIs Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Move resource_size.cocci to the api directoryNicolas Palix2010-08-311-0/+0
| | | | | | Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Move err_cast.cocci to the api directoryNicolas Palix2010-08-311-0/+0
| | | | | | Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add api/memdup_userNicolas Palix2010-08-311-0/+35
| | | | | | | | | Use kmemdup_user rather than duplicating its implementation This is a little bit restricted to reduce false positives Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add api/memdup.cocciNicolas Palix2010-08-311-0/+40
| | | | | | | | Use kmemdup rather than duplicating its implementation Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add api/kstrdup.cocciNicolas Palix2010-08-311-0/+39
| | | | | | | | Use kstrdup rather than duplicating its implementation Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add free/kfree.cocciNicolas Palix2010-08-311-0/+116
| | | | | | | | | | | Find a use after free. Values of variables may imply that some execution paths are not possible, resulting in false positives. Another source of false positives are macros such as SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add iterators/list_entry_update.cocciNicolas Palix2010-08-311-0/+62
| | | | | | | | | | | list_for_each_entry uses its first argument to get from one element of the list to the next, so it is usually not a good idea to reassign it. The first rule finds such a reassignment and the second rule checks that there is a path from the reassignment back to the top of the loop. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add iterators/itnull.cocciNicolas Palix2010-08-311-0/+58
| | | | | | | | | | | | Many iterators have the property that the first argument is always bound to a real list element, never NULL. False positives arise for some iterators that do not have this property, or in cases when the loop cursor is reassigned. The latter should only happen when the matched code is on the way to a loop exit (break, goto, or return). Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add iterators/fen.cocciNicolas Palix2010-08-311-0/+64
| | | | | | | | | for_each_node iterators only exit normally when the loop cursor is NULL, so there is no point to call of_node_put on the final value. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add locks/mini_lock.cocciNicolas Palix2010-08-311-0/+95
| | | | | | | | | | | | | Find missing unlocks. This semantic match considers the specific case where the unlock is missing from an if branch, and there is a lock before the if and an unlock after the if. False positives are due to cases where the if branch represents a case where the function is supposed to exit with the lock held, or where there is some preceding function call that releases the lock. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add locks/double_lock.cocciNicolas Palix2010-08-311-0/+92
| | | | | | | | | | Find double locks. False positives may occur when some paths cannot occur at execution, due to the values of variables, and when there is an intervening function call that releases the lock. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add locks/call_kern.cocciNicolas Palix2010-08-311-0/+74
| | | | | | | | | | | Find functions that refer to GFP_KERNEL but are called with locks held. The proposed change of converting the GFP_KERNEL is not necessarily the correct one. It may be desired to unlock the lock, or to not call the function under the lock in the first place. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Move deref_null.cocci to a more appropriate directoryNicolas Palix2010-08-311-0/+0
| | | | | | | | | deref_null.cocci is moved to the 'null' directory which contains other null related rules. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add null/kmerr.cocciNicolas Palix2010-08-311-0/+72
| | | | | | | | | | | | This semantic patch looks for kmalloc etc that are not followed by a NULL check. It only gives a report in the case where there is some error handling code later in the function, which may be helpful in determining what the error handling code for the call to kmalloc etc should be. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Coccinelle: Add null/eno.cocciNicolas Palix2010-08-311-0/+20
| | | | | | | | The various basic memory allocation functions don't return ERR_PTR Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* scripts/dtc: Fix a resource leakMartin Ettl2010-07-021-0/+1
| | | | | | | | | | | | | | during a check of the current git head of the linux kernel with the static code analysis tool cppcheck (http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page) the tool discovered a resource leak in linux-2.6/scripts/dtc/fstree.c. Please refer the attached patch, that fixes the issue. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15363 Signed-off-by: Martin Ettl <ettl.martin@gmx.de> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Documentation: fix ubuntu distro nameKulikov Vasiliy2010-06-291-1/+1
| | | | | | | | 10.04 is Lucid, not Karmic. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* MAINTAINERS: Update kbuild git URLsMichal Marek2010-06-291-2/+2
| | | | | | | The kbuild tree was moved to git.kernel.org so that people can find it more easily. Signed-off-by: Michal Marek <mmarek@suse.cz>
* Add support for the C variable in the coccicheck scriptNicolas Palix2010-06-281-25/+51
| | | | | | | | | | | | | | | | This patch makes it possible to use the Coccinelle checker with the C variable of the build system. To check only newly edited code, the following command may be used: 'make C={1,2} CHECK="scripts/coccicheck"' This runs every semantic patch in scripts/coccinelle by default. The COCCI variable may additionally be used to only apply a single semantic patch. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* Merge branch 'kbuild/coccinelle' into kbuild/miscMichal Marek2010-06-1210-3/+923
|\
| * Add scripts/coccinelle/deref_null.cocciNicolas Palix2010-06-121-0/+293
| | | | | | | | | | | | | | | | | | | | | | Add a Coccinelle file to identify the dereferences of NULL variables This semantic patch identifies when a variable is known to be NULL after a test, but it is still dereferenced later. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
| * Add scripts/coccinelle/err_cast.cocciNicolas Palix2010-06-121-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | Add a Coccinelle file to use the ERR_CAST function Before the release 2.6.25, one had to use ERR_PTR(PTR_ERR(...)) to convert the pointer type of an error. Since then, the function ERR_CAST has been available for that purpose. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
| * Add scripts/coccinelle/resource_size.cocciNicolas Palix2010-06-121-0/+93
| | | | | | | | | | | | | | | | | | This semantic patch replaces explicit computations of resource size by a call to resource_size. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
| * Add scripts/coccinelle/alloc/kzalloc-simple.cocciNicolas Palix2010-06-121-0/+82
| | | | | | | | | | | | | | | | | | | | | | This semantic patch replaces a pair of calls to kmalloc and memset by a single call to kzalloc. It only looks for simple cases to avoid false positives. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
| * Add scripts/coccinelle/alloc/drop_kmalloc_cast.cocciNicolas Palix2010-06-121-0/+67
| | | | | | | | | | | | | | | | | | | | The purpose of this semantic patch is to remove useless casts, as mentioned in the Linux documentation. See Chapter 14 in Documentation/CodingStyle for more information. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
| * Add Documentation/coccinelle.txtNicolas Palix2010-06-121-0/+258
| | | | | | | | | | | | | | | | | | | | | | | | The purpose of this file is to document how to use Coccinelle and its spatch tool to check the Linux kernel. It gives information on where and how to retrieve Coccinelle, and how to use it with the Coccinelle scripts integrated in the Linux kernel. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
| * Add a target to use the Coccinelle checkerNicolas Palix2010-06-124-3/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'coccicheck' target is added. It can be called with four different modes. Each one generates a different kind of output, i.e. context, patch, org, report, according to the corresponding mode to be activated. The new target calls the 'coccicheck' front-end in the 'scripts' directory with the MODE argument. Every SmPL file in the subdirectories of 'scripts/coccinelle' is then given to the front-end and applied to the entire source tree. The four modes behave as follows: 'report' generates a list in the following format: file:line:column-column: message 'patch' proposes a fix, when possible. 'context' highlights lines of interest and their context in a diff-like style. Lines of interest are indicated with '-'. 'org' generates a report in the Org mode format of Emacs. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* | scripts: decodecode: remove bashismsRabin Vincent2010-06-041-5/+5
| | | | | | | | | | | | | | | | Remove bashisms to make scripts/decodecode work with other shells. Signed-off-by: Rabin Vincent <rabin@rab.in> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* | Makefile: clarify a commentMichal Marek2010-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | os user <gnusercn@gmail.com> writes: From the last comment, arch makefile will override vmlinux. It seems vmlinux will not be checked by `make'. But from my test, although `all:' will be re-defined in arch Makefile (ARM arch), vmlinux will still be checked and the commands associated will be executed. Should we use another word instead of "overridden"? Reported-by: os user <gnusercn@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* | checkkconfigsymbols.sh: Kconfig symbols sometimes have lowercase lettersRoland Dreier2010-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quite a few Kconfig symbols contain lowercase letters. The current checkkconfigsymbols.sh code only contains A-Z in the regexp it uses to find config symbols in source code, so it comes up with the wrong symbol to look for in Kconfig files and then generates false positives when it doesn't find that wrong symbol. For example checking drivers/net generates a false positive for MAC89 because the the actual config option is MAC89x0. Fix this by also adding a-z to the regexp. Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
* | scripts: add nconf into gitignore fileAmérico Wang2010-06-031-0/+1
|/ | | | | | | | scripts/kconfig/nconf is generated by 'make nconfig', add it into .gitignore. Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* kbuild: Revert part of e8d400a to resolve a conflictMichal Marek2010-05-271-1/+1
| | | | | | | A more complete patch in the kernel-doc tree also contains this change. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Michal Marek <mmarek@suse.cz>
* kbuild: Fix checking of scm-identifier variableGreg Thelen2010-05-061-1/+1
| | | | | | | | | | | | I'm looking Makefile in the -mm branch (dated 2010-04-28-16-53) and seeing what looks like a bug in the checking of scm-identifier. The "ifneq ($scm-identifier)" seems to always execute "ifeq ($(LOCALVERSION,)) ...". This patch fixes the checking of scm-identifier. Signed-off-by: Greg Thelen <gthelen@google.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* gconfig: add support to show hidden options that have promptsLi Zefan2010-04-142-11/+64
| | | | | | | | | | There's a button in gconfig to "Show all options", but I think normally we are not interested in those configs which have no prompt and thus can't be changed, so here I add a new button to show hidden options which have prompts. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* menuconfig: add support to show hidden options which have promptsLi Zefan2010-04-144-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage: Press <Z> to show all config symbols which have prompts. Quote Tim Bird: | I've been bitten by this numerous times. I most often | use ftrace on ARM, but when I go back to x86, I almost | always go through a sequence of searching for the | function graph tracer in the menus, then realizing it's | completely missing until I disable CC_OPTIMIZE_FOR_SIZE. | | Is there any way to have the menu item appear, but be | unsettable unless the SIZE option is disabled? I'm | not a Kconfig guru... I myself found this useful too. For example, I need to test ftrace/tracing and want to be sure all the tracing features are enabled, so I enter the "Tracers" menu, and press <Z> to see if there is any config hidden. I also noticed gconfig and xconfig have a button "Show all options", but that's a bit too much, and I think normally what we are not interested in those configs which have no prompt thus can't be changed by users. Exmaple: --- Tracers -*- Kernel Function Tracer - - Kernel Function Graph Tracer [*] Interrupts-off Latency Tracer - - Preemption-off Latency Tracer [*] Sysprof Tracer Here you can see 2 tracers are not selectable, and then can find out how to make them selectable. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* gconfig: remove show_debug optionLi Zefan2010-04-142-19/+0
| | | | | | | This option is a no-op, so remove it. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* gconfig: remove dbg_print_ptype() and dbg_print_stype()Li Zefan2010-04-141-63/+4
| | | | | | | Just use sym_get_type() and prop_get_type_name(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* kconfig: fix zconfdump()Li Zefan2010-04-142-8/+34
| | | | | | | | | | | | | | | | | zconfdump(), which is used for debugging, can't recognize P_SELECT, P_RANGE and P_MENU (if associated with a symbol, aka "menuconfig"), and output something like this: config X86 boolean default y unknown prop 6! unknown prop 6! unknown prop 6! ... Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* kconfig: some small fixesLi Zefan2010-04-143-4/+4
| | | | | | | | | - fix a typo in documentation - fix a typo in a printk on error - fix comments in dialog_inputbox() Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
OpenPOWER on IntegriCloud