Mauro Carvalho Chehab
cb06b8ddeb
scripts: get_abi.pl: stop check loop earlier when regex is found
...
Right now, there are two loops used to seek for a regex. Make
sure that both will be skip when a match is found.
While here, drop the unused $defined variable.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/2ba722d2cdbe7c7d0f1d1b58d350052576d1d703.1632411447.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-23 18:45:08 +02:00
Mauro Carvalho Chehab
0cd9e25b08
scripts: get_abi.pl: ignore some sysfs nodes earlier
...
When checking for undefined symbols, some nodes aren't easy
or don't make sense to be checked right now. Prevent allocating
memory for those, as they'll be ignored anyway.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/5228789cbef8241d44504ad29fca5cab356cdc53.1632411447.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-23 18:45:08 +02:00
Mauro Carvalho Chehab
9263589422
scripts: get_abi.pl: Better handle leaves with wildcards
...
When the the leaf of a regex ends with a wildcard, the speedup
algorithm to reduce the number of regexes to seek won't work.
So, when those are found, place at the "others" exception.
That slows down the search from 0.14s to 1 minute on my
machine, but the results are a lot more consistent.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/60bb97cf337333783f9f52e114b896439e9cc215.1632411447.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-23 18:45:08 +02:00
Mauro Carvalho Chehab
46f661fd0f
scripts: get_abi.pl: improve debug logic
...
Add a level for debug, in order to allow it to be extended to
debug other parts of the script.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/0203416c6c418abb4fc20577a5f48d0d2a41bae7.1632411447.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-23 18:45:08 +02:00
Mauro Carvalho Chehab
45495db979
scripts: get_abi.pl: call get_leave() a little late
...
The $what conversions need to replace some characters to avoid
breaking regex expressions found on some What:.
only after replacing them back, the script should get the
$leave devnode.
Fixes: ca8e055c22 ("scripts: get_abi.pl: add a graph to speedup the undefined algorithm")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/a21631f8a884f50a962beafdd800f27891348d95.1632411447.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-23 18:45:08 +02:00
Mauro Carvalho Chehab
e27c42a52e
scripts: get_abi.pl: Fix get_abi.pl search output
...
Currently, the get_abi.pl will print an invalid symbol
(\xac character). Fix it.
Fixes: ab9c14805b ("scripts: get_abi.pl: Better handle multiple What parameters")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/fb27ac372e38f5ae9d088f9f4e9710c659e0b9e8.1632411447.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-23 18:45:08 +02:00
Mauro Carvalho Chehab
ca8e055c22
scripts: get_abi.pl: add a graph to speedup the undefined algorithm
...
Searching for symlinks is an expensive operation with the current
logic, as it is at the order of O(n^3). In practice, running the
check spends 2-3 minutes to check all symbols.
Fix it by storing the directory tree into a graph, and using
a Breadth First Search (BFS) to find the links for each sysfs node.
With such improvement, it can now report issues with ~11 seconds
on my machine.
It comes with a price, though: there are more symbols reported
as undefined after this change. I suspect it is due to some
sysfs circular loops that are dropped by BFS. Despite such
increase, it seems that the reports are now more coherent.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/f5c1e7b14a27132821c08f0459ba9aea3ed69028.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
0b87a1b81b
scripts: get_abi.pl: Ignore fs/cgroup sysfs nodes earlier
...
In order to speedup the parser and store less data, handle
fs/cgroup exceptions a lot earlier.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/caa37831c9e02ae58677d1515ed7cee94f52ea9d.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
50116aec11
scripts: get_abi.pl: don't skip what that ends with wildcards
...
The search algorithm used inside check_undefined_symbols
has an optimization: it seeks only whats that have the same
leave name. This helps not only to speedup the search, but
it also allows providing a hint about a partial match.
There's a drawback, however: when "what:" finishes with a
wildcard, the logic will skip the what, reporting it as
"not found".
Fix it by grouping the remaining cases altogether, and
disabing any hints for such cases.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/79ba5139643355230e3bba136b20991cfc92020f.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
14c942578e
scripts: get_abi.pl: add an option to filter undefined results
...
The output of this script can be too big. Add an option to
filter out results, in order to help finding issues at the
ABI files.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/7b56c10195bb5e5dfd8b5838a3db8d361231d884.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
ab02c5150b
scripts: get_abi.pl: detect softlinks
...
The way sysfs works is that the same leave may be present under
/sys/devices, /sys/bus and /sys/class, etc, linked via soft
symlinks.
To make it harder to parse, the ABI definition usually refers
only to one of those locations.
So, improve the logic in order to retrieve the symlinks.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/77c49f7d158d88e17f18d40652b75cdde9e179eb.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
f090db4395
scripts: get_abi.pl: Check for missing symbols at the ABI specs
...
Check for the symbols that exists under /sys but aren't
defined at Documentation/ABI.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/958e4f3a319148af6d847c0df95e35426f9c4c5f.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
ab9c14805b
scripts: get_abi.pl: Better handle multiple What parameters
...
Using a comma here is problematic, as some What: expressions
may already contain a comma. So, use \xac character instead.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/e83e7ffaf3429f8dfca00d1d01653ecfa36f6119.1631957565.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:32:53 +02:00
Mauro Carvalho Chehab
eb74c39abd
ABI: sysfs-class-rapidio: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/aa073b85ab04b5b201d40f747ccdb6806f38eb66.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
64b609fd68
ABI: sysfs-ptp: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Acked-by: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/03dcf9985244f8f9d8202af1ba203abb1f405e7d.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
3f6b07adb5
ABI: sysfs-platform-sst-atom: use wildcards on What definitions
...
%x is not a valid wildcard. Use <x> instead, as this allows
script/get_abi.pl to convert it into a regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/ca1f384f1e77210e2807f97abe77a36ac5fa284a.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
3d253b9912
ABI: sysfs-firmware-efi-esrt: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/44f63335333d019490297903609a8a1754a66183.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
26d6ba2f89
ABI: sysfs-devices-system-cpu: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/d18385a391b6797373a5d1382ea024857fb29987.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
5097586d21
ABI: sysfs-devices-platform-dock: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/56790ba596b34c234da1e0d17ca7f19435df87ff.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
6b85d2f715
ABI: sysfs-class-uwb_rc-wusbhc: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/89dfa95676376f48a7191e1d34264d48a72b3f6a.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
c8d4b62def
ABI: sysfs-class-uwb_rc: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/e723a4d9ea835f02e820142909499c752dab21b7.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
a5d01b5fce
ABI: sysfs-class-rc-nuvoton: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/8cfb786e625bfe8f1c73837cf76107af187c9d85.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
fa1d8fdd23
ABI: sysfs-class-rc: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/42778ca4b2f9bf73fafecb9b388a8fcd0e66be26.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:17 +02:00
Mauro Carvalho Chehab
24e83d415e
ABI: sysfs-class-pwm: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/eb3edca0f3cf693d8d28ee7bd00339cac2039014.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
03f5721ac2
ABI: sysfs-class-mux: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Acked-by: Peter Rosin <peda@axentia.se >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/7e8ff8601d5b44b76c5c7f77b6dcf3b1d45bc5be.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
0d502366d6
ABI: sysfs-class-mei: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/3789f936a637f1b4059400099ae7a592cd4df8f5.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
c84aaa4da1
ABI: sysfs-class-gnss: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Acked-by: Johan Hovold <johan@kernel.org >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/80b7f60a6bac7bb1938d60dca509d75dff3c2c62.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
c5c0c4ea0e
ABI: sysfs-bus-soundwire-slave: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/416f4a746c116147abb08fb0155a6a4ed065dfd7.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
5475cd780c
ABI: sysfs-bus-soundwire-master: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/eb62c19ce92c0dc1a50eb57c1052866256250644.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
24d732a908
ABI: sysfs-bus-pci: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/4ede4ec98e295f054f3e5a6f3f9393b5e3d5d2a7.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
92d35cdc9a
ABI: sysfs-class-infiniband: use wildcards on What definitions
...
An "N" upper letter is not a wildcard, nor can easily be identified
by script, specially since the USB sysfs define things like.
bNumInterfaces. Use, instead, <N>, in order to let script/get_abi.pl
to convert it into a Regex.
Acked-by: Jason Gunthorpe <jgg@nvidia.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/3cb5cad69f457ed92b38d719ff7f6f0fc9364285.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
2e6a032394
ABI: sysfs-ata: use a proper wildcard for ata_*
...
In order to let script/get_abi.pl to convert it into a Regex,
replace the three "..." at the end, meaning a wildcard to
a real filesystem wildcard.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/72f783bc0287411f11d6640368926f8a357c002d.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
4e25928cf8
ABI: sysfs-class-typec: fix a typo on a What field
...
This what:
/sys/class/typec/<port>-partner>/identity/
Contains an extra ">" character. Remove it.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/bff0e7c137fb4f41ac0b2ed9c5a21c0948203f15.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
9fc3678e47
ABI: pstore: Fix What field
...
If both /sys/fs/pstore/... and /dev/pstore/... are possible,
it should use, instead, two What: fields.
Acked-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/e19daafb779bd3a8f9ae1c15f670752355e5d40f.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
743e4636b7
ABI: sysfs-class-mic: use the right wildcards on What definitions
...
On most ABI files, the wildcards are used as <x>, instead of (x).
Replace it to make it using a more standard wildcard. That helps
get_abi.pl to convert it into a regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/d0713698c609410506f9e520fa879c0592a5e11d.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:16 +02:00
Mauro Carvalho Chehab
6f0e465183
ABI: sysfs-class-devfreq-event: use the right wildcards on What
...
On most ABI files, the wildcards are used as <x>, instead of (x).
Replace it to make it using a more standard wildcard. That helps
get_abi.pl to convert it into a regex.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/3a0b6aa8f740c3dea78463f4256eafea6e973f92.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
1e0349f6d8
ABI: sysfs-class-cxl: place "not in a guest" at description
...
The What: field should have just the location of the ABI.
Anything else should be inside the description.
This fixes its parsing by get_abi.pl script.
Acked-by: Andrew Donnellan <ajd@linux.ibm.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/cb1f2af183369d682a46efa4e5c01ad5f66e99c4.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
08981d29c3
ABI: sysfs-bus-rapidio: use wildcards on What definitions
...
While humans may be able to understand that something like:
/sys/bus/rapidio/devices/nn:d:iiii
could actually mean:
/sys/bus/rapidio/devices/00:e:0000
This is something that computers can't easily identify. As
get_abi.pl needs to convert it into a regex, change What: lines
to:
/sys/bus/rapidio/devices/<nn>:<d>:<iiii>
Which is the commonly-used pattern on ABI files for wildcards.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/207762e994d50eec0bf8d61c3adf153030c821eb.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
ea84409f88
ABI: sysfs-class-tpm: use wildcards for pcr-* nodes
...
Change how this expression is defined:
/sys/class/tpm/tpmX/pcr-H/N
in order to allow get_abi.pl to convert it into this regex:
/sys/class/tpm/tpmX/pcr-.*/.*
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/4ab3fce91ea2bd7c36a07e6c646bf7bd6f4f8634.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
18e49b3046
ABI: security: fix location for evm and ima_policy
...
The What: definitions there are wrong, pointing to different
locations than what's expected.
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/b2563ac34c2e234cdd728f0c701b57ac9023c45a.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
a19ea9e3c8
ABI: sysfs-kernel-slab: use a wildcard for the cache name
...
the "cache" part of the description is actually a wildcard,
as, in practice, this will use per-subsystem names:
/sys/kernel/slab/Acpi-Namespace/align
/sys/kernel/slab/Acpi-Operand/align
/sys/kernel/slab/Acpi-Parse/align
...
/sys/kernel/slab/zswap_entry/align
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/64095cc0a38d0f675ab798d4f04d8631674b59f7.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
05d2024ad1
ABI: sysfs-tty: better document module name parameter
...
On almost all ABI documents, variable arguments are declared
as <foo_bar>. Change it here too, in order to allow replacing
such wildcards by regexes on a scriptable way.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/6280edfacdbcbf8db1aeb7bf11e899187c11ac4c.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Mauro Carvalho Chehab
3628f57342
ABI: sysfs-bus-usb: better document variable argument
...
On almost all ABI documents, variable arguments are declared
as <foo_bar>. Change it here too, in order to allow replacing
such wildcards by regexes on a scriptable way.
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com >
Acked-by: Rajat Jain <rajatja@google.com >
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org >
Link: https://lore.kernel.org/r/2f7e4e874677dbd82693a6b219decefa18802e8f.1631782432.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:31:15 +02:00
Douglas Anderson
7065f92255
driver core: Clarify that dev_err_probe() is OK even w/out -EPROBE_DEFER
...
There is some debate about whether it's deemed acceptable to call
dev_err_probe() if you know that the error code can never be
-EPROBE_DEFER. Clarify in the function comments that this is
OK. Specifically this makes us able to transform code like this:
ret = do_something_that_cant_defer();
if (ret < 0) {
dev_err(dev, "The foo failed to bar (%pe)\n", ERR_PTR(ret));
return ret;
}
to code like this:
ret = do_something_that_cant_defer();
if (ret < 0)
return dev_err_probe(dev, ret, "The foo failed to bar\n");
It is also possible that in the future folks might want a CONFIG
option to strip out all probe error strings to save space (keeping
non-probe errors) with the argument that probe errors rarely happen
after bringup. Having probe errors reported with a consistent function
would allow that.
Cc: Stephen Boyd <swboyd@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://lore.kernel.org/r/20210916161931.1.I32bea713bd6c6fb419a24da73686145742b6c117@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-21 18:29:35 +02:00
Christoph Hellwig
820879ee18
sysfs: simplify sysfs_kf_seq_show
...
Contrary to the comment ->show is never called from lseek for sysfs,
given that sysfs does not use seq_lseek. So remove the NULL ->show
case and just WARN and return an error if some future code path ends
up here.
Acked-by: Tejun Heo <tj@kernel.org >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Link: https://lore.kernel.org/r/20210913054121.616001-7-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-14 17:03:01 +02:00
Christoph Hellwig
d1a1a9606e
sysfs: refactor sysfs_add_file_mode_ns
...
Regroup the code so that preallocated attributes and normal attributes are
handled in clearly separate blocks.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com >
Acked-by: Tejun Heo <tj@kernel.org >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Link: https://lore.kernel.org/r/20210913054121.616001-6-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-14 17:02:58 +02:00
Christoph Hellwig
5cf3bb0d3a
sysfs: split out binary attribute handling from sysfs_add_file_mode_ns
...
Split adding binary attributes into a separate handler instead of
overloading sysfs_add_file_mode_ns.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com >
Acked-by: Tejun Heo <tj@kernel.org >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Link: https://lore.kernel.org/r/20210913054121.616001-5-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-14 16:59:46 +02:00
Christoph Hellwig
eaf501e0d8
kernfs: remove the unused lockdep_key field in struct kernfs_ops
...
Not actually used anywhere.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com >
Acked-by: Tejun Heo <tj@kernel.org >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Link: https://lore.kernel.org/r/20210913054121.616001-4-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-14 16:55:19 +02:00
Christoph Hellwig
2935662449
kernfs: remove kernfs_create_file and kernfs_create_file_ns
...
All callers actually use __kernfs_create_file.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com >
Acked-by: Tejun Heo <tj@kernel.org >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Link: https://lore.kernel.org/r/20210913054121.616001-3-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-14 16:54:55 +02:00
Cai Huoqing
86854b4379
driver core: platform: Make use of the helper macro SET_RUNTIME_PM_OPS()
...
Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
operators ".runtime_suspend/.runtime_resume", because the
SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
in to make code a little clearer, a little more concise.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com >
Link: https://lore.kernel.org/r/20210828090219.1177-1-caihuoqing@baidu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-09-14 16:52:41 +02:00