08 Jan, 2019
1 commit
-
dma_zalloc_coherent() is no longer needed as it has no users because
dma_alloc_coherent() already zeroes out memory for us.The Coccinelle grammar rule that used to check for dma_alloc_coherent()
+ memset() is modified so that it just tells the user that the memset is
not needed anymore.Suggested-by: Christoph Hellwig
Signed-off-by: Luis Chamberlain
Signed-off-by: Christoph Hellwig
06 Jan, 2019
2 commits
-
Coccinelle doesn't always have access to the values of named
(#define) constants, and they may likely often be bound to true
and false values anyway, resulting in false positives. So stop
warning about them.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Avoid reporting on the use of an iterator index variable when
the variable is redeclared.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
30 Dec, 2018
1 commit
-
Pull Kbuild updates from Masahiro Yamada:
"Kbuild core:
- remove unneeded $(call cc-option,...) switches
- consolidate Clang compiler flags into CLANG_FLAGS
- announce the deprecation of SUBDIRS
- fix single target build for external module
- simplify the dependencies of 'prepare' stage targets
- allow fixdep to directly write to .*.cmd files
- simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS
- change if_changed_rule to accept multi-line recipe
- move .SECONDARY special target to scripts/Kbuild.include
- remove redundant 'set -e'
- improve parallel execution for CONFIG_HEADERS_CHECK
- misc cleanupsTreewide fixes and cleanups
- set Clang flags correctly for PowerPC boot images
- fix UML build error with CONFIG_GCC_PLUGINS
- remove unneeded patterns from .gitignore files
- refactor firmware/Makefile
- remove unneeded rules for *offsets.s
- avoid unneeded regeneration of intermediate .s files
- clean up ./KbuildModpost:
- remove unused -M, -K options
- fix false positive warnings about section mismatch
- use simple devtable lookup instead of linker magic
- misc cleanupsCoccinelle:
- relax boolinit.cocci checks for overall consistency
- fix warning messages of boolinit.cocciOther tools:
- improve -dirty check of scripts/setlocalversion
- add a tool to generate compile_commands.json from .*.cmd files"* tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (51 commits)
kbuild: remove unused cmd_gentimeconst
kbuild: remove $(obj)/ prefixes in ./Kbuild
treewide: add intermediate .s files to targets
treewide: remove explicit rules for *offsets.s
firmware: refactor firmware/Makefile
firmware: remove unnecessary patterns from .gitignore
scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore
um: remove unused filechk_gen_header in Makefile
scripts: add a tool to produce a compile_commands.json file
kbuild: add -Werror=implicit-int flag unconditionally
kbuild: add -Werror=strict-prototypes flag unconditionally
kbuild: add -fno-PIE flag unconditionally
scripts: coccinelle: Correct warning message
scripts: coccinelle: only suggest true/false in files that already use them
kbuild: handle part-of-module correctly for *.ll and *.symtypes
kbuild: refactor part-of-module
kbuild: refactor quiet_modtag
kbuild: remove redundant quiet_modtag for $(obj-m)
kbuild: refactor Makefile.asm-generic
user/Makefile: Fix typo and capitalization in comment section
...
16 Dec, 2018
2 commits
-
"Assignment" requires the assigned value before the place that
value is stored into.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Some code may overall use 0 and 1, so don't introduce occasional
uses of true and false in these cases.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
25 Nov, 2018
1 commit
-
The coccinelle script was used to rename some (deprecated) functions
which no longer exist now.Signed-off-by: Fernando Ramos
Reviewed-by: Linus Walleij
Acked-by: Julia Lawall
Signed-off-by: Linus Walleij
Link: https://patchwork.freedesktop.org/patch/msgid/20181115221634.22715-9-greenfoo@gluegarage.com
22 Aug, 2018
1 commit
-
Because pci_alloc_consistent has been deprecated. We prefer to use
dma_alloc_coherent directly. Therefore, we should remove pci_alloc_consistent
to increase the confidence.Acked-by: Julia Lawall
Acked-by: Himanshu Jha
Signed-off-by: zhong jiang
Signed-off-by: Masahiro Yamada
14 Aug, 2018
1 commit
-
Ensure that the cited expression is not a function call or an
assignment to reduce the chance of false positives.Slightly modify the warning message to indicate another source
of false positves.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
18 Jul, 2018
1 commit
-
atomic_as_refcounter.cocci script allows detecting
cases when refcount_t type and API should be used
instead of atomic_t.Signed-off-by: Elena Reshetova
Acked-by: Julia Lawall
Reviewed-by: Kees Cook
Signed-off-by: Masahiro Yamada
07 Jun, 2018
1 commit
-
Pull Kbuild updates from Masahiro Yamada:
- improve fixdep to coalesce consecutive slashes in dep-files
- fix some issues of the maintainer string generation in deb-pkg script
- remove unused CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX and clean-up
several tools and linker scripts- clean-up modpost
- allow to enable the dead code/data elimination for PowerPC in EXPERT
mode- improve two coccinelle scripts for better performance
- pass endianness and machine size flags to sparse for all architecture
- misc fixes
* tag 'kbuild-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
kbuild: add machine size to CHECKFLAGS
kbuild: add endianness flag to CHEKCFLAGS
kbuild: $(CHECK) doesnt need NOSTDINC_FLAGS twice
scripts: Fixed printf format mismatch
scripts/tags.sh: use `find` for $ALLSOURCE_ARCHS generation
coccinelle: deref_null: improve performance
coccinelle: mini_lock: improve performance
powerpc: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selected
kbuild: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selectable if enabled
kbuild: LD_DEAD_CODE_DATA_ELIMINATION no -ffunction-sections/-fdata-sections for module build
kbuild: Fix asm-generic/vmlinux.lds.h for LD_DEAD_CODE_DATA_ELIMINATION
modpost: constify *modname function argument where possible
modpost: remove redundant is_vmlinux() test
modpost: use strstarts() helper more widely
modpost: pass struct elf_info pointer to get_modinfo()
checkpatch: remove VMLINUX_SYMBOL() check
vmlinux.lds.h: remove no-op macro VMLINUX_SYMBOL()
kbuild: remove CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
export.h: remove code for prefixing symbols with underscore
depmod.sh: remove symbol prefix support
...
22 May, 2018
2 commits
-
Move rules looking for some special cases of safe dereferences before
the collection of NULL-tested values. The special cases are fairly
rare, but somewhat costly to find, because isomorphisms create many
variants of the rules. There is thus no need to search for them over
and over for each NULL tested expression. Collecting them just once
is sufficient and more efficient.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Replace by ... when any. is slow, and in some
obscure cases involving backward jumps it doesn't force the unlock to
actually come after the end of the if.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
31 Mar, 2018
1 commit
-
Backmerging to pick up a fix from drm-misc-next-fixes.
Signed-off-by: Sean Paul
28 Mar, 2018
1 commit
-
Linux 4.16-rc7
This was requested by Daniel, and things were getting
a bit hard to reconcile, most of the conflicts were
trivial though.
22 Mar, 2018
1 commit
-
This patch remove the compatibility aliases
drm_property_{reference/unreference}_blob of
drm_property_blob_{get/put} since all callers have been converted to the
prefered _{get/put}.Remove the helpers from the semantic patch drm-get-put-cocci.
Signed-off-by: Haneen Mohammed
Signed-off-by: Sean Paul
Link: https://patchwork.freedesktop.org/patch/msgid/20180320133749.GA11695@haneen-VirtualBox
19 Mar, 2018
1 commit
-
This patch remove the compatibility aliases
drm_mode_object_{reference/unreference} of drm_mode_object_{get/put}
since all callers have been converted to the prefered _{get/put}.Remove the helpers from the semantic patch drm-get-put-cocci.
Signed-off-by: Haneen Mohammed
Signed-off-by: Sean Paul
Link: https://patchwork.freedesktop.org/patch/msgid/20180319055820.GA17502@haneen-VirtualBox
02 Mar, 2018
1 commit
-
Replace 'kmemdep' with 'kmemdup' in warning messages.
Signed-off-by: Dafna Hirschfeld
Acked-by: Julia Lawall
Acked-by: Nicolas Palix
Signed-off-by: Masahiro Yamada
07 Feb, 2018
2 commits
-
The effect of the rules ifm1, pr11, and pr12 is only used in the final rule,
which depends on context && !org && !report. Thus these rules should only
be performed in those circumstances.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Some files use both a non-devm allocation and a devm_allocation. Don't
complain about a free when the same function contains a non-devm
allocation.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
29 Jan, 2018
1 commit
-
The kmemdup line in the non-patch case was left over from the added kmemdup
line in the patch case.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
16 Jan, 2018
5 commits
-
Rename kzalloc-simple to zalloc-simple since now the rule is not
specific to kzalloc function only, but also to many other zero memory
allocating functions specified in the rule.Suggested-by: SF Markus Elfring
Signed-off-by: Himanshu Jha
Acked-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Remove the unncessary part of the warning reported, in the report
mode, so that a single warning produced does not exceed more than line
and hence improve readability of the warnings produced in the subsequent
reports to a file.Signed-off-by: Himanshu Jha
Acked-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Add more memory allocating functions that are frequently used in the
kernel code to the existing list and remove the useless casts where
it is unnecessary.But preserve those casts having __attribute__ such as __force, __iomem,
etc. which are used by Sparse in the static analysis of the code.Also remove two blank lines at EOF.
Signed-off-by: Himanshu Jha
Acked-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Rule r does not depend on rule i (which is the include of
linux/kernel.h) so the output should not depend on i in
org and report mode.Signed-off-by: Jérémy Lefaure
Acked-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
There are many instances where memory is allocated using regular
allocator functions immediately followed by setting the allocated
memory to 0 value using memset.We already have zero memory allocator functions to set the memory to
0 value instead of manually setting it using memset.Therefore, use zero memory allocating functions instead of regular
memory allocators followed by memset 0 to remove redundant memset and
make the code more cleaner and also reduce the code size.Signed-off-by: Himanshu Jha
Acked-by: Julia Lawall
Signed-off-by: Masahiro Yamada
22 Nov, 2017
1 commit
-
Both the init_timer() and timer_setup() APIs have been removed. This
script will not be needed any more.Signed-off-by: Kees Cook
18 Nov, 2017
1 commit
-
…asahiroy/linux-kbuild
Pull Kbuild misc updates from Masahiro Yamada:
- Clean up and fix RPM package build
- Fix a warning in DEB package build
- Improve coccicheck script
- Improve some semantic patches
* tag 'kbuild-misc-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
docs: dev-tools: coccinelle: delete out of date wiki reference
coccinelle: orplus: reorganize to improve performance
coccinelle: use exists to improve efficiency
builddeb: Pass the kernel:debarch substvar to dpkg-genchanges
Coccinelle: use false positive annotation
coccinelle: fix verbose message about .cocci file being run
coccinelle: grep Options and Requires fields more precisely
Coccinelle: make DEBUG_FILE option more useful
coccinelle: api: detect identical chip data arrays
coccinelle: Improve setup_timer.cocci matching
Coccinelle: setup_timer: improve messages from setup_timer
kbuild: rpm-pkg: do not force -jN in submake
kbuild: rpm-pkg: keep spec file until make mrproper
kbuild: rpm-pkg: fix jobserver unavailable warning
kbuild: rpm-pkg: replace $RPM_BUILD_ROOT with %{buildroot}
kbuild: rpm-pkg: fix build error when CONFIG_MODULES is disabled
kbuild: rpm-pkg: refactor mkspec with here doc
kbuild: rpm-pkg: clean up mkspec
kbuild: rpm-pkg: install vmlinux.bz2 unconditionally
kbuild: rpm-pkg: remove ppc64 specific image handling
16 Nov, 2017
2 commits
-
Pull drm updates from Dave Airlie:
"This is the main drm pull request for v4.15.Core:
- Atomic object lifetime fixes
- Atomic iterator improvements
- Sparse/smatch fixes
- Legacy kms ioctls to be interruptible
- EDID override improvements
- fb/gem helper cleanups
- Simple outreachy patches
- Documentation improvements
- Fix dma-buf rcu races
- DRM mode object leasing for improving VR use cases.
- vgaarb improvements for non-x86 platforms.New driver:
- tve200: Faraday Technology TVE200 block.This "TV Encoder" encodes a ITU-T BT.656 stream and can be found in
the StorLink SL3516 (later Cortina Systems CS3516) as well as the
Grain Media GM8180.New bridges:
- SiI9234 supportNew panels:
- S6E63J0X03, OTM8009A, Seiko 43WVF1G, 7" rpi touch panel, Toshiba
LT089AC19000, Innolux AT043TN24i915:
- Remove Coffeelake from alpha support
- Cannonlake workarounds
- Infoframe refactoring for DisplayPort
- VBT updates
- DisplayPort vswing/emph/buffer translation refactoring
- CCS fixes
- Restore GPU clock boost on missed vblanks
- Scatter list updates for userptr allocations
- Gen9+ transition watermarks
- Display IPC (Isochronous Priority Control)
- Private PAT management
- GVT: improved error handling and pci config sanitizing
- Execlist refactoring
- Transparent Huge Page support
- User defined priorities support
- HuC/GuC firmware refactoring
- DP MST fixes
- eDP power sequencing fixes
- Use RCU instead of stop_machine
- PSR state tracking support
- Eviction fixes
- BDW DP aux channel timeout fixes
- LSPCON fixes
- Cannonlake PLL fixesamdgpu:
- Per VM BO support
- Powerplay cleanups
- CI powerplay support
- PASID mgr for kfd
- SR-IOV fixes
- initial GPU reset for vega10
- Prime mmap support
- TTM updates
- Clock query interface for Raven
- Fence to handle ioctl
- UVD encode ring support on Polaris
- Transparent huge page DMA support
- Compute LRU pipe tweaks
- BO flag to allow buffers to opt out of implicit sync
- CTX priority setting API
- VRAM lost infrastructure plumbingqxl:
- fix flicker since atomic reworkamdkfd:
- Further improvements from internal AMD tree
- Usermode events
- Drop radeon supportnouveau:
- Pascal temperature sensor support
- Improved BAR2 handling
- MMU rework to support Pascal MMUexynos:
- Improved HDMI/mixer support
- HDMI audio interface supporttegra:
- Prep work for tegra186
- Cleanup/fixesmsm:
- Preemption support for a5xx
- Display fixes for 8x96 (snapdragon 820)
- Async cursor plane fixes
- FW loading rework
- GPU debugging improvementsvc4:
- Prep for DSI panels
- fix T-format tiling scanout
- New madvise ioctlRockchip:
- LVDS supportomapdrm:
- omap4 HDMI CEC supportetnaviv:
- GPU performance counters groundworksun4i:
- refactor driver load + TCON backend
- HDMI improvements
- A31 support
- Misc fixesudl:
- Probe/EDID read fixes.tilcdc:
- Misc fixes.pl111:
- Support more variantsadv7511:
- Improve EDID handling.
- HDMI CEC supportsii8620:
- Add remote control support"* tag 'drm-for-v4.15' of git://people.freedesktop.org/~airlied/linux: (1480 commits)
drm/rockchip: analogix_dp: Use mutex rather than spinlock
drm/mode_object: fix documentation for object lookups.
drm/i915: Reorder context-close to avoid calling i915_vma_close() under RCU
drm/i915: Move init_clock_gating() back to where it was
drm/i915: Prune the reservation shared fence array
drm/i915: Idle the GPU before shinking everything
drm/i915: Lock llist_del_first() vs llist_del_all()
drm/i915: Calculate ironlake intermediate watermarks correctly, v2.
drm/i915: Disable lazy PPGTT page table optimization for vGPU
drm/i915/execlists: Remove the priority "optimisation"
drm/i915: Filter out spurious execlists context-switch interrupts
drm/amdgpu: use irq-safe lock for kiq->ring_lock
drm/amdgpu: bypass lru touch for KIQ ring submission
drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories()
drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs()
drm/amd/powerplay: initialize a variable before using it
drm/amd/powerplay: suppress KASAN out of bounds warning in vega10_populate_all_memory_levels
drm/amd/amdgpu: fix evicted VRAM bo adjudgement condition
drm/vblank: Tune drm_crtc_accurate_vblank_count() WARN down to a debug
drm/rockchip: add CONFIG_OF dependency for lvds
... -
Adding two #define constants is less common than performing & and |
operations on them, so put the addition first to reduce the set of cases
that have to be considered in detail. At the same time, add & and |
patterns for both arguments of +, to account for commutativity and obtain
more results.Running time is divided by 3 when applying this to the whole kernel on my
laptop with an Intel i5-6200U CPU.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
14 Nov, 2017
6 commits
-
This just needs to find any reassignment of the loop iterator, and doesn't
need such a thing on all execution paths, so use exists on the first rule.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
/// is to describe the semantic patch, while //# indicates reasons
for false positives.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Currently, the required version for badzero.cocci is picked up from
its "Comments:" line since it contains the word "Requires".Surprisingly, ld-version.sh can extract the version number from the
string "Requires Coccinelle version 1.0.0-rc20 or later", but this
expectation is fragile. Fix the .cocci file. I removed "-rc20"
because ld-version.sh cannot handle it.Make the coccicheck script to see exact patterns for "Options:" and
"Requires:" in order to avoid accidental matching to what just happens
to appear in comment lines.Signed-off-by: Masahiro Yamada
Acked-by: Julia Lawall
Acked-by: Nicolas Palix -
This semantic patch detects duplicate arrays declared using BQ27XXX_DATA
within a single structure. It is currently specific to the file
drivers/power/supply/bq27xxx_battery.c. Nevertheless, having the script in
the kernel will allow others to check their code if the data structures
change in the future.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
This improves the patch mode of setup_timer.cocci. Several patterns
were missing:
- assignments-before-init_timer() cases
- limit the .data case removal to the specific struct timer_list instance
- handling calls by dereference (timer->field vs timer.field)Cc: Gilles Muller
Cc: Nicolas Palix
Cc: Michal Marek
Cc: cocci@systeme.lip6.fr
Signed-off-by: Kees Cook
Acked-by: Julia Lawall
Signed-off-by: Masahiro Yamada -
Allow messages about multiple timers.
Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
02 Nov, 2017
1 commit
-
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
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
26 Sep, 2017
1 commit
-
Reference counting functions in the kernel typically use get/put suffixes. For
maintaining coding style consistency, introduce drm_dev_{get/put} functions. All
callers of drm_dev_ref() API have been converted in this patch and hence it has
been dropped while the drm_dev_unref() API with non-trivial number of users
remains for compatibility.The semantic patch scripts/coccinelle/api/drm-get-put.cocci has been updated
with the new helper for conversion of drm_dev_unref() to drm_dev_put()Signed-off-by: Aishwarya Pant
Signed-off-by: Daniel Vetter
Link: https://patchwork.freedesktop.org/patch/msgid/6babda56134035a98220d5d37a4fd4048df214ce.1506413698.git.aishpant@gmail.com
28 Feb, 2017
2 commits
-
For consistency with other reference counting APIs in the kernel, add
drm_property_blob_get() and drm_property_blob_put() to reference count
DRM blob properties.Compatibility aliases are added to keep existing code working. To help
speed up the transition, all the instances of the old functions in the
DRM core are already replaced in this commit.A semantic patch is provided that can be used to convert all drivers to
the new helpers.Reviewed-by: Sean Paul
Acked-by: Christian König
Signed-off-by: Thierry Reding
Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-7-thierry.reding@gmail.com -
For consistency with other reference counting APIs in the kernel, add
drm_gem_object_get() and drm_gem_object_put(), as well as an unlocked
variant of the latter, to reference count GEM buffer objects.Compatibility aliases are added to keep existing code working. To help
speed up the transition, all the instances of the old functions in the
DRM core are already replaced in this commit.The existing semantic patch for the DRM subsystem-wide conversion is
extended to account for these new helpers.Reviewed-by: Sean Paul
Acked-by: Christian König
Signed-off-by: Thierry Reding
Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-6-thierry.reding@gmail.com