From: Fawzi Khaber <fawzi.khaber(a)tdk.com>
iio_format_avail_range() should print range as follow [min, step, max], so
the function was previously calling iio_format_list() with length = 3,
length variable refers to the array size of values not the number of
elements. In case of non IIO_VAL_INT values each element has integer part
and decimal part. With length = 3 this would cause premature end of loop
and result in printing only one element.
Signed-off-by: Fawzi Khaber <fawzi.khaber(a)tdk.com>
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol(a)tdk.com>
Fixes: eda20ba1e25e ("iio: core: Consolidate iio_format_avail_{list,range}()")
---
drivers/iio/industrialio-core.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 358b909298c0..0f4dbda3b9d3 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -812,7 +812,23 @@ static ssize_t iio_format_avail_list(char *buf, const int *vals,
static ssize_t iio_format_avail_range(char *buf, const int *vals, int type)
{
- return iio_format_list(buf, vals, type, 3, "[", "]");
+ int length;
+
+ /*
+ * length refers to the array size , not the number of elements.
+ * The purpose is to print the range [min , step ,max] so length should
+ * be 3 in case of int, and 6 for other types.
+ */
+ switch (type) {
+ case IIO_VAL_INT:
+ length = 3;
+ break;
+ default:
+ length = 6;
+ break;
+ }
+
+ return iio_format_list(buf, vals, type, length, "[", "]");
}
static ssize_t iio_read_channel_info_avail(struct device *dev,
--
2.17.1
with reference to other email thread on perf build failure on Linus mainline
https://lore.kernel.org/bpf/20220715191641.go6xbmhic3kafcsc@awork3.anarazel…
I see perf build failures on stable-rc 5.18 .. 5.4 with this error [1]
and also noticed on today's linus mainline tree.
Reported-by: Linux Kernel Functional Testing <lkft(a)linaro.org>
steps to reproduce:
--------------------
tuxmake --runtime podman \
--target-arch x86_64 \
--toolchain gcc-11 \
--kconfig
https://builds.tuxbuild.com/2C7oWWWYOYGFtqq4SWX1yG4a2Ne/config \
debugkernel headers kernel modules perf
Error log:
-----------
CC event-parse-api.o
CC staticobjs/btf_dump.o
find: 'x86_64-linux-gnu-gcc/arch': No such file or directory
error: Found argument '-I' which wasn't expected, or isn't valid in this context
USAGE:
sccache [FLAGS] [OPTIONS] [cmd]...
For more information try --help
and
CC util/annotate.o
MKDIR util/
CC util/block-range.o
MKDIR bench/
CC bench/sched-pipe.o
util/annotate.c: In function 'symbol__disassemble_bpf':
util/annotate.c:1752:9: error: too few arguments to function
'init_disassemble_info'
1752 | init_disassemble_info(&info, s,
| ^~~~~~~~~~~~~~~~~~~~~
In file included from util/annotate.c:1709:
/usr/include/dis-asm.h:472:13: note: declared here
472 | extern void init_disassemble_info (struct disassemble_info
*dinfo, void *stream,
| ^~~~~~~~~~~~~~~~~~~~~
[1] https://builds.tuxbuild.com/2C7oWWWYOYGFtqq4SWX1yG4a2Ne/
Best regards
Naresh Kamboju
--
Linaro LKFT
https://lkft.linaro.org
Hi,
these two patches are the backport for 3.18.y of the following commits:
commit a96ef8b504efb2ad445dfb6d54f9488c3ddf23d2
bus: mhi: host: pci_generic: add Telit FN980 v1 hardware revisio
commit 77fc41204734042861210b9d05338c9b8360affb
bus: mhi: host: pci_generic: add Telit FN990
The cherry-pick of the original commits don't apply because the commit
89ad19bea649 (bus: mhi: host: pci_generic: Sort mhi_pci_id_table based
on the PID, 2022-04-11) was not cherry-picked. Another solution is to
cherry-pick those three commits all togheter.
In the following days I will send backport for longterm releases.
Thanks!
v2:
- fixed my email
Fabio Porcedda (2):
bus: mhi: host: pci_generic: add Telit FN980 v1 hardware revision
bus: mhi: host: pci_generic: add Telit FN990
drivers/bus/mhi/host/pci_generic.c | 79 ++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
--
2.37.1