19 Oct, 2020
1 commit
-
Pull coccinelle updates from Julia Lawall.
* 'for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
coccinelle: api: add kfree_mismatch script
coccinelle: iterators: Add for_each_child.cocci script
scripts: coccicheck: Change default condition for parallelism
scripts: coccicheck: Add quotes to improve portability
coccinelle: api: kfree_sensitive: print memset position
coccinelle: misc: add flexible_array.cocci script
coccinelle: api: add kvmalloc script
scripts: coccicheck: Change default value for parallelism
coccinelle: misc: add excluded_middle.cocci script
scripts: coccicheck: Improve error feedback when coccicheck fails
coccinelle: api: update kzfree script to kfree_sensitive
coccinelle: misc: add uninitialized_var.cocci script
coccinelle: ifnullfree: add vfree(), kvfree*() functions
coccinelle: api: add kobj_to_dev.cocci script
coccinelle: add patch rule for dma_alloc_coherent
scripts: coccicheck: Add chain mode to list of modes
18 Oct, 2020
1 commit
-
Check that alloc and free types of functions match each other.
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
16 Oct, 2020
1 commit
-
While iterating over child nodes with the for_each functions, if
control is transferred from the middle of the loop, as in the case
of a break or return or goto, there is no decrement in the
reference counter thus ultimately resulting in a memory leak.Add this script to detect potential memory leaks caused by
the absence of of_node_put() before break, goto, or, return
statements which transfer control outside the loop.Signed-off-by: Sumera Priyadarsini
Signed-off-by: Julia Lawall
11 Oct, 2020
1 commit
-
Print memset() call position in addition to the kfree() position to
ease issues identification.Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
04 Oct, 2020
1 commit
-
One-element and zero-length arrays are deprecated [1]. Kernel
code should always use "flexible array members" instead, except
for existing uapi definitions.The script warns about one-element and zero-length arrays in structs.
[1] commit 68e4cd17e218 ("docs: deprecated.rst: Add zero-length and
one-element arrays")Cc: Kees Cook
Cc: Gustavo A. R. Silva
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
02 Oct, 2020
1 commit
-
Suggest kvmalloc, kvfree instead of opencoded patterns.
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
22 Sep, 2020
1 commit
-
Check for !A || A && B condition. It's equivalent to !A || B.
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
12 Sep, 2020
1 commit
-
Commit 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")
renames kzfree to kfree_sensitive and uses memzero_explicit(...) instead of
memset(..., 0, ...) internally. Update cocci script to reflect these
changes.Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
11 Sep, 2020
1 commit
-
sysfs.txt was converted and renamed to sysfs.rst.
Update device_attr_show.cocci script accordingly.
Signed-off-by: Mauro Carvalho Chehab
Link: https://lore.kernel.org/r/048ed24b09aefa0051d76396d6250e35e6ba035c.1599660067.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet
06 Sep, 2020
1 commit
-
uninitialized_var() macro was removed from the sources [1] and
other warning-silencing tricks were deprecated [2]. The purpose of this
cocci script is to prevent new occurrences of uninitialized_var()
open-coded variants.[1] commit 63a0895d960a ("compiler: Remove uninitialized_var() macro")
[2] commit 4b19bec97c88 ("docs: deprecated.rst: Add uninitialized_var()")Cc: Kees Cook
Cc: Gustavo A. R. Silva
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
02 Sep, 2020
1 commit
-
Extend the list of free functions with kvfree(), kvfree_sensitive(),
vfree().Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
22 Aug, 2020
2 commits
-
Use kobj_to_dev() instead of container_of().
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall -
Commit dfd32cad146e ("dma-mapping: remove dma_zalloc_coherent()")
removed the definition of dma_zalloc_coherent() and also removed the
corresponding patch rule for replacing instances of dma_alloc_coherent +
memset in zalloc-simple.cocci (though left the report rule).Add a new patch rule to remove unnecessary calls to memset after
allocating with dma_alloc_coherent. While we're at it, fix a couple of
typos.Fixes: dfd32cad146e ("dma-mapping: remove dma_zalloc_coherent()")
Signed-off-by: Alex Dewar
Signed-off-by: Julia Lawall
08 Aug, 2020
1 commit
-
As said by Linus:
A symmetric naming is only helpful if it implies symmetries in use.
Otherwise it's actively misleading.In "kzalloc()", the z is meaningful and an important part of what the
caller wants.In "kzfree()", the z is actively detrimental, because maybe in the
future we really _might_ want to use that "memfill(0xdeadbeef)" or
something. The "zero" part of the interface isn't even _relevant_.The main reason that kzfree() exists is to clear sensitive information
that should not be leaked to other future users of the same memory
objects.Rename kzfree() to kfree_sensitive() to follow the example of the recently
added kvfree_sensitive() and make the intention of the API more explicit.
In addition, memzero_explicit() is used to clear the memory to make sure
that it won't get optimized away by the compiler.The renaming is done by using the command sequence:
git grep -w --name-only kzfree |\
xargs sed -i 's/kzfree/kfree_sensitive/'followed by some editing of the kfree_sensitive() kerneldoc and adding
a kzfree backward compatibility macro in slab.h.[akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h]
[akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more]Suggested-by: Joe Perches
Signed-off-by: Waiman Long
Signed-off-by: Andrew Morton
Acked-by: David Howells
Acked-by: Michal Hocko
Acked-by: Johannes Weiner
Cc: Jarkko Sakkinen
Cc: James Morris
Cc: "Serge E. Hallyn"
Cc: Joe Perches
Cc: Matthew Wilcox
Cc: David Rientjes
Cc: Dan Carpenter
Cc: "Jason A . Donenfeld"
Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.com
Signed-off-by: Linus Torvalds
07 Aug, 2020
1 commit
-
Pull coccinelle updates from Julia Lawall:
"New semantic patches and semantic patch improvements from Denis
Efremov"* 'for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
coccinelle: api: filter out memdup_user definitions
coccinelle: api: extend memdup_user rule with vmemdup_user()
coccinelle: api: extend memdup_user transformation with GFP_USER
coccinelle: api: add kzfree script
coccinelle: misc: add array_size_dup script to detect missed overflow checks
coccinelle: api/kstrdup: fix coccinelle position
coccinelle: api: add device_attr_show script
05 Aug, 2020
7 commits
-
Don't match memdup_user/vmemdup_user.
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall -
Add vmemdup_user() transformations to the memdup_user.cocci rule.
Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced
vmemdup_user(). The function uses kvmalloc with GPF_USER flag.Signed-off-by: Denis Efremov
-
Match GFP_USER and optional __GFP_NOWARN allocations with
memdup_user.cocci rule.
Commit 6c2c97a24f09 ("memdup_user(): switch to GFP_USER") switched
memdup_user() from GFP_KERNEL to GFP_USER. In almost all cases it
is still a good idea to recommend memdup_user() for GFP_KERNEL
allocations. The motivation behind altering memdup_user() to GFP_USER:
https://lkml.org/lkml/2018/1/6/333Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall -
Check for memset()/memzero_explicit() followed by kfree()/vfree()/kvfree().
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall -
Detect an opencoded expression that is used before or after
array_size()/array3_size()/struct_size() to compute the same size.Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall -
There is a typo in rule r2. Position p1 should be attached to kzalloc()
call.Fixes: 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some semantic patches")
Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall -
According to the documentation[1] show() methods of device attributes
should return the number of bytes printed into the buffer. This is
the return value of scnprintf(). show() must not use snprintf()
when formatting the value to be returned to user space. snprintf()
returns the length the resulting string would be, assuming it all
fit into the destination array[2]. scnprintf() return the length of
the string actually created in buf. If one can guarantee that an
overflow will never happen sprintf() can be used otherwise scnprintf().[1] Documentation/filesystems/sysfs.txt
[2] "snprintf() confusion" https://lwn.net/Articles/69419/Signed-off-by: Denis Efremov
Signed-off-by: Julia Lawall
10 Jul, 2020
1 commit
-
When running `make coccicheck` in report mode using the
add_namespace.cocci file, it will fail for files that contain
MODULE_LICENSE. Those match the replacement precondition, but spatch
errors out as virtual.ns is not set.In order to fix that, add the virtual rule nsdeps and only do search and
replace if that rule has been explicitly requested.In order to make spatch happy in report mode, we also need a dummy rule,
as otherwise it errors out with "No rules apply". Using a script:python
rule appears unrelated and odd, but this is the shortest I could come up
with.Adjust scripts/nsdeps accordingly to set the nsdeps rule when run trough
`make nsdeps`.Suggested-by: Julia Lawall
Fixes: c7c4e29fb5a4 ("scripts: add_namespace: Fix coccicheck failed")
Cc: YueHaibing
Cc: jeyu@kernel.org
Cc: cocci@systeme.lip6.fr
Cc: stable@vger.kernel.org
Signed-off-by: Matthias Maennich
Reported-by: Shuah Khan
Acked-by: Julia Lawall
Link: https://lore.kernel.org/r/20200604164145.173925-1-maennich@google.com
Signed-off-by: Greg Kroah-Hartman
08 May, 2020
1 commit
-
The NL_SET_ERR_MSG_MOD macro is used to report a string describing an
error message to userspace via the netlink extended ACK structure. It
should not have a trailing newline.Add a cocci script which catches cases where the newline marker is
present. Using this script, fix the handful of cases which accidentally
included a trailing new line.I couldn't figure out a way to get a patch mode working, so this script
only implements context, report, and org.Signed-off-by: Jacob Keller
Cc: Jakub Kicinski
Cc: Andy Whitcroft
Cc: Joe Perches
Signed-off-by: David S. Miller
04 Feb, 2020
1 commit
-
Since 5.5-rc1 the last user of this function is gone, so remove the
functionality.See commit
2ad9d7747c10 ("netfilter: conntrack: free extension area immediately")
for details.Link: http://lkml.kernel.org/r/20191212223442.22141-1-fw@strlen.de
Signed-off-by: Florian Westphal
Acked-by: Andrew Morton
Acked-by: David Rientjes
Reviewed-by: David Hildenbrand
Cc: Christoph Lameter
Cc: Pekka Enberg
Cc: Joonsoo Kim
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
06 Jan, 2020
1 commit
-
ioremap has provided non-cached semantics by default since the Linux 2.6
days, so remove the additional ioremap_nocache interface.Signed-off-by: Christoph Hellwig
Acked-by: Arnd Bergmann
18 Oct, 2019
1 commit
-
While it is useful for new drivers to use devm_platform_ioremap_resource,
this script is currently used to spam maintainers, often updating very
old drivers. The net benefit is the removal of 2 lines of code in the
driver but the review load for the maintainers is huge. As of now, more
that 560 patches have been sent, some of them obviously broken, as in:https://lore.kernel.org/lkml/9bbcce19c777583815c92ce3c2ff2586@www.loen.fr/
Remove the script to reduce the spam.
Signed-off-by: Alexandre Belloni
Acked-by: Julia Lawall
Signed-off-by: Linus Torvalds
07 Oct, 2019
1 commit
-
Now all scripts in scripts/coccinelle to be automatically called
by coccicheck. However new adding add_namespace.cocci does not
support report mode, which make coccicheck failed.
This add "virtual report" to make the coccicheck go ahead smoothly.Fixes: eb8305aecb95 ("scripts: Coccinelle script for namespace dependencies.")
Acked-by: Julia Lawall
Acked-by: Matthias Maennich
Signed-off-by: YueHaibing
Signed-off-by: Jessica Yu
23 Sep, 2019
1 commit
-
Pull modules updates from Jessica Yu:
"The main bulk of this pull request introduces a new exported symbol
namespaces feature. The number of exported symbols is increasingly
growing with each release (we're at about 31k exports as of 5.3-rc7)
and we currently have no way of visualizing how these symbols are
"clustered" or making sense of this huge export surface.Namespacing exported symbols allows kernel developers to more
explicitly partition and categorize exported symbols, as well as more
easily limiting the availability of namespaced symbols to other parts
of the kernel. For starters, we have introduced the USB_STORAGE
namespace to demonstrate the API's usage. I have briefly summarized
the feature and its main motivations in the tag below.Summary:
- Introduce exported symbol namespaces.
This new feature allows subsystem maintainers to partition and
categorize their exported symbols into explicit namespaces. Module
authors are now required to import the namespaces they need.Some of the main motivations of this feature include: allowing
kernel developers to better manage the export surface, allow
subsystem maintainers to explicitly state that usage of some
exported symbols should only be limited to certain users (think:
inter-module or inter-driver symbols, debugging symbols, etc), as
well as more easily limiting the availability of namespaced symbols
to other parts of the kernel.With the module import requirement, it is also easier to spot the
misuse of exported symbols during patch review.Two new macros are introduced: EXPORT_SYMBOL_NS() and
EXPORT_SYMBOL_NS_GPL(). The API is thoroughly documented in
Documentation/kbuild/namespaces.rst.- Some small code and kbuild cleanups here and there"
* tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
module: Remove leftover '#undef' from export header
module: remove unneeded casts in cmp_name()
module: move CONFIG_UNUSED_SYMBOLS to the sub-menu of MODULES
module: remove redundant 'depends on MODULES'
module: Fix link failure due to invalid relocation on namespace offset
usb-storage: export symbols in USB_STORAGE namespace
usb-storage: remove single-use define for debugging
docs: Add documentation for Symbol Namespaces
scripts: Coccinelle script for namespace dependencies.
modpost: add support for generating namespace dependencies
export: allow definition default namespaces in Makefiles or sources
module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
modpost: add support for symbol namespaces
module: add support for symbol namespaces.
export: explicitly align struct kernel_symbol
module: support reading multiple values per modinfo tag
19 Sep, 2019
1 commit
-
Pull driver core updates from Greg Kroah-Hartman:
"Here is the big driver core update for 5.4-rc1.There was a bit of a churn in here, with a number of core and OF
platform patches being added to the tree, and then after much
discussion and review and a day-long in-person meeting, they were
decided to be reverted and a new set of patches is currently being
reviewed on the mailing list.Other than that churn, there are two "persistent" branches in here
that other trees will be pulling in as well during the merge window.
One branch to add support for drivers to have the driver core
automatically add sysfs attribute files when a driver is bound to a
device so that the driver doesn't have to manually do it (and then
clean it up, as it always gets it wrong).There's another branch in here for generic lookup helpers for the
driver core that lots of busses are starting to use. That's the
majority of the non-driver-core changes in this patch series.There's also some on-going debugfs file creation cleanup that has been
slowly happening over the past few releases, with the goal to
hopefully get that done sometime next year.All of these have been in linux-next for a while now with no reported
issues"[ Note that the above-mentioned generic lookup helpers branch was
already brought in by the LED merge (commit 4feaab05dc1e) that had
shared it.Also note that that common branch introduced an i2c bug due to a bad
conversion, which got fixed here. - Linus ]* tag 'driver-core-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (49 commits)
coccinelle: platform_get_irq: Fix parse error
driver-core: add include guard to linux/container.h
sysfs: add BIN_ATTR_WO() macro
driver core: platform: Export platform_get_irq_optional()
hwmon: pwm-fan: Use platform_get_irq_optional()
driver core: platform: Introduce platform_get_irq_optional()
Revert "driver core: Add support for linking devices during device addition"
Revert "driver core: Add edit_links() callback for drivers"
Revert "of/platform: Add functional dependency link from DT bindings"
Revert "driver core: Add sync_state driver/bus callback"
Revert "of/platform: Pause/resume sync state during init and of_platform_populate()"
Revert "of/platform: Create device links for all child-supplier depencencies"
Revert "of/platform: Don't create device links for default busses"
Revert "of/platform: Fix fn definitons for of_link_is_valid() and of_link_property()"
Revert "of/platform: Fix device_links_supplier_sync_state_resume() warning"
Revert "of/platform: Disable generic device linking code for PowerPC"
devcoredump: fix typo in comment
devcoredump: use memory_read_from_buffer
of/platform: Disable generic device linking code for PowerPC
device.h: Fix warnings for mismatched parameter names in comments
...
10 Sep, 2019
1 commit
-
A script that uses the '.ns_deps' files generated by modpost to
automatically add the required symbol namespace dependencies to each
module.Usage:
1) Move some symbols to a namespace with EXPORT_SYMBOL_NS() or define
DEFAULT_SYMBOL_NAMESPACE
2) Run 'make' (or 'make modules') and get warnings about modules not
importing that namespace.
3) Run 'make nsdeps' to automatically add required import statements
to said modules.This makes it easer for subsystem maintainers to introduce and maintain
symbol namespaces into their codebase.Co-developed-by: Martijn Coenen
Signed-off-by: Martijn Coenen
Acked-by: Julia Lawall
Reviewed-by: Greg Kroah-Hartman
Signed-off-by: Matthias Maennich
Signed-off-by: Jessica Yu
06 Sep, 2019
1 commit
-
When do coccicheck, I get this error:
spatch -D report --no-show-diff --very-quiet --cocci-file
./scripts/coccinelle/api/platform_get_irq.cocci --include-headers
--dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include
-I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi
-I ./include/uapi -I ./include/generated/uapi
--include ./include/linux/kconfig.h --jobs 192 --chunksize 1
minus: parse error:
File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
around = '\(',
whole content = if ( ret \( < \|
Reviewed-by: Stephen Boyd
Acked-by: Julia Lawall
Link: https://lore.kernel.org/r/20190906033006.17616-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman
31 Jul, 2019
1 commit
-
Add the missing GPLv2 SPDX license identifier.
It appears this single file was missing from 7f904d7e1f3e ("treewide:
Replace GPLv2 boilerplate/reference with SPDX - rule 505"), which
addressed all other files in scripts/coccinelle. Hence I added
GPL-2.0-only consitently with the mentioned patch.Cc: linux-spdx@vger.kernel.org
Cc: Elena Reshetova
Signed-off-by: Matthias Maennich
Acked-by: Julia Lawall
Signed-off-by: Greg Kroah-Hartman
30 Jul, 2019
1 commit
-
Add a coccinelle script to check for the usage of dev_err() after a call
to platform_get_irq{,_byname}() as it's redundant now that the function
already prints an error when it fails.Cc: Greg Kroah-Hartman
Cc: Rob Herring
Cc: Bartlomiej Zolnierkiewicz
Cc: Javier Martinez Canillas
Cc: Andrzej Hajda
Cc: Mark Brown
Cc: Russell King - ARM Linux
Cc: Marek Szyprowski
Cc: Rafael J. Wysocki
Cc: Andy Shevchenko
Cc: Markus Elfring
Signed-off-by: Stephen Boyd
Link: https://lore.kernel.org/r/20190730053845.126834-4-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman
21 Jul, 2019
1 commit
-
Pull more Kbuild updates from Masahiro Yamada:
- match the directory structure of the linux-libc-dev package to that
of Debian-based distributions- fix incorrect include/config/auto.conf generation when Kconfig
creates it along with the .config file- remove misleading $(AS) from documents
- clean up precious tag files by distclean instead of mrproper
- add a new coccinelle patch for devm_platform_ioremap_resource
migration- refactor module-related scripts to read modules.order instead of
$(MODVERDIR)/*.mod files to get the list of created modules- remove MODVERDIR
- update list of header compile-test
- add -fcf-protection=none flag to avoid conflict with the retpoline
flags when CONFIG_RETPOLINE=y- misc cleanups
* tag 'kbuild-v5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
kbuild: add -fcf-protection=none when using retpoline flags
kbuild: update compile-test header list for v5.3-rc1
kbuild: split out *.mod out of {single,multi}-used-m rules
kbuild: remove 'prepare1' target
kbuild: remove the first line of *.mod files
kbuild: create *.mod with full directory path and remove MODVERDIR
kbuild: export_report: read modules.order instead of .tmp_versions/*.mod
kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod
kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod
kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod
scsi: remove pointless $(MODVERDIR)/$(obj)/53c700.ver
kbuild: remove duplication from modules.order in sub-directories
kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin}
kbuild: do not create empty modules.order in the prepare stage
coccinelle: api: add devm_platform_ioremap_resource script
kbuild: compile-test headers listed in header-test-m as well
kbuild: remove unused hostcc-option
kbuild: remove tag files by distclean instead of mrproper
kbuild: add --hash-style= and --build-id unconditionally
kbuild: get rid of misleading $(AS) from documents
...
17 Jul, 2019
1 commit
-
Use recently introduced devm_platform_ioremap_resource
helper which wraps platform_get_resource() and
devm_ioremap_resource() together. This helps produce much
cleaner code and remove local `struct resource` declaration.Signed-off-by: Himanshu Jha
Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada
15 Jul, 2019
2 commits
-
The audience for the Kernel driver-model is clearly Kernel hackers.
Signed-off-by: Mauro Carvalho Chehab
Acked-by: Jeff Kirsher # ice driver changes -
Pull stream_open() updates from Kirill Smelkov:
"This time on stream_open front it is only two small changes:- the first one converts stream_open.cocci to treat all functions
that start with wait_.* as blocking. Previously it was only
wait_event_.* functions that were considered as blocking, but this
was falsely reporting several deadlock cases as only warning.This was picked by linux-kbuild and entered mainline as commit
0c4ab18fc33b ("coccinelle: api/stream_open: treat all wait_.*()
calls as blocking"), and already merged earlier.- the second one teaches stream_open.cocci to consider files as being
stream-like even if they use noop_llseek. It results in two more
drivers being converted to stream_open() (mousedev.c and
hid-sensor-custom.c)"* tag 'stream_open-5.3' of https://lab.nexedi.com/kirr/linux:
*: convert stream-like files -> stream_open, even if they use noop_llseek
14 Jul, 2019
1 commit
-
This patch continues 10dce8af3422 (fs: stream_open - opener for
stream-like files so that read and write can run simultaneously without
deadlock) and c5bf68fe0c86 (*: convert stream-like files from
nonseekable_open -> stream_open) and teaches steam_open.cocci to
consider files as being stream-like not only if they have
.llseek=no_llseek, but also if they have .llseek=noop_llseek.This is safe to do: the comment about noop_llseek says
This is an implementation of ->llseek useable for the rare special case when
userspace expects the seek to succeed but the (device) file is actually not
able to perform the seek. In this case you use noop_llseek() instead of
falling back to the default implementation of ->llseek.and in general noop_llseek was massively added to drivers in 6038f373a3dc
(llseek: automatically add .llseek fop) when changing default for NULL .llseek
from NOP to no_llseek with the idea to avoid breaking compatibility, if
maybe some user-space program was using lseek on a device without caring
about the result, but caring if it was an error or not.Amended semantic patch produces two changes when applied tree-wide:
drivers/hid/hid-sensor-custom.c:690:8-24: WARNING: hid_sensor_custom_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
drivers/input/mousedev.c:564:1-17: ERROR: mousedev_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.Cc: Julia Lawall
Cc: Jan Blunck
Cc: Arnd Bergmann
Cc: Jiri Kosina
Cc: Jonathan Cameron
Cc: Srinivas Pandruvada
Cc: Benjamin Tissoires
Cc: Dmitry Torokhov
Signed-off-by: Kirill Smelkov
13 Jul, 2019
1 commit
-
Pull Kbuild updates from Masahiro Yamada:
- remove headers_{install,check}_all targets
- remove unreasonable 'depends on !UML' from CONFIG_SAMPLES
- re-implement 'make headers_install' more cleanly
- add new header-test-y syntax to compile-test headers
- compile-test exported headers to ensure they are compilable in
user-space- compile-test headers under include/ to ensure they are self-contained
- remove -Waggregate-return, -Wno-uninitialized, -Wno-unused-value
flags- add -Werror=unknown-warning-option for Clang
- add 128-bit built-in types support to genksyms
- fix missed rebuild of modules.builtin
- propagate 'No space left on device' error in fixdep to Make
- allow Clang to use its integrated assembler
- improve some coccinelle scripts
- add a new flag KBUILD_ABS_SRCTREE to request Kbuild to use absolute
path for $(srctree).- do not ignore errors when compression utility is missing
- misc cleanups
* tag 'kbuild-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (49 commits)
kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix
kbuild: Inform user to pass ARCH= for make mrproper
kbuild: fix compression errors getting ignored
kbuild: add a flag to force absolute path for srctree
kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree
kbuild: remove src and obj from the top Makefile
scripts/tags.sh: remove unused environment variables from comments
scripts/tags.sh: drop SUBARCH support for ARM
kbuild: compile-test kernel headers to ensure they are self-contained
kheaders: include only headers into kheaders_data.tar.xz
kheaders: remove meaningless -R option of 'ls'
kbuild: support header-test-pattern-y
kbuild: do not create wrappers for header-test-y
kbuild: compile-test exported headers to ensure they are self-contained
init/Kconfig: add CONFIG_CC_CAN_LINK
kallsyms: exclude kasan local symbols on s390
kbuild: add more hints about SUBDIRS replacement
coccinelle: api/stream_open: treat all wait_.*() calls as blocking
coccinelle: put_device: Add a cast to an expression for an assignment
coccinelle: put_device: Adjust a message construction
...