Re: [PATCH][next] selftests: kvm: fix shift of 32 bit unsigned int more than 32 bits

2024-05-23 Thread Dan Carpenter
ot;unknown feature"); > - else if (KNOWN_FEATURES & (1u << i)) > + else if (KNOWN_FEATURES & BIT_ULL(u)) ^ Should be i. How does this build? :P regards, dan carpenter

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Dan Carpenter
__ret; > > > }) > > > > Sounds good to me, but I'd call them test_malloc, test_calloc, etc. and > > put them in include/test_util.h > > Possibly terrible idea: what if we used kmalloc() and kcalloc()? K is for > KVM :-) That's a legit terrible idea... It probably would trigger more static checker warnings because the general policy is kmalloc() is kernel code and we *have* to test for errors. To be honest, I would have just rejected the first patch. You obviously know this and have said this earlier in the thread but just for the other people, this is a userspace test that runs for a short time and then exits. If it gets killed because we don't have enough memory that's fine. It would be better to just fix the static checker to not print pointless warnings or educate people to ignore warnings like this. Creating the test_malloc() to silence the warning also seems like an okay idea as well. regards, dan carpenter

Re: [PATCH 00/14] Add support for suppressing warning backtraces

2024-03-13 Thread Dan Carpenter
Thanks! Acked-by: Dan Carpenter regards, dan carpenter

Re: [PATCH bpf-next 2/5] bpf: tracing: support to attach program to multi hooks

2024-02-20 Thread Dan Carpenter
-...@intel.com/config) compiler: m68k-linux-gcc (GCC) 13.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r

Re: [PATCH] kunit: Fix a NULL vs IS_ERR() bug

2024-01-11 Thread Dan Carpenter
On Fri, Jan 12, 2024 at 07:39:14AM +0800, David Gow wrote: > On Thu, 11 Jan 2024 at 02:55, Dan Carpenter wrote: > > > > The kunit_device_register() function doesn't return NULL, it returns > > error pointers. Change the KUNIT_ASSERT_NOT_NULL() to check for > > E

[PATCH] kunit: Fix a NULL vs IS_ERR() bug

2024-01-10 Thread Dan Carpenter
The kunit_device_register() function doesn't return NULL, it returns error pointers. Change the KUNIT_ASSERT_NOT_NULL() to check for ERR_OR_NULL(). Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") Signed-off-by: Dan Carpenter --- It's a pity that t

[PATCH] kunit: device: Fix a NULL vs IS_ERR() check in init()

2024-01-10 Thread Dan Carpenter
The root_device_register() function does not return NULL, it returns error pointers. Fix the check to match. Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") Signed-off-by: Dan Carpenter --- lib/kunit/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [RFC PATCH v3 0/3] Add test to verify probe of devices from discoverable busses

2024-01-01 Thread Dan Carpenter
Life hack: Don't put RFC in the subject. Especially if it's a v2 or higher. No one reads RFC patches. This patchset seems like a low risk patch to apply. regards, dan carpenter

Re: [PATCH v2 RESEND] kunit: debugfs: Handle errors from alloc_string_stream()

2023-11-30 Thread Dan Carpenter
thing. There are between 2-5 places which do this in the kernel. 2) If it's a API that used to return NULL and it's changed to returning error pointers. I've never seen anyone do this, but I've proposed it as a solution to make backporting easier. regards, dan carpenter

Re: [RFC PATCH 0/2] Add a test to verify device probing on ACPI platforms

2023-11-23 Thread Dan Carpenter
an be probed? I feel like you're not valuing your stuff at the right level. This shouldn't be in debugfs. It should be a first class citizen in sysfs. The exact format for this information is slightly tricky and people will probably debate that. But I think most people will agree that it's super useful. regards, dan carpenter

Re: [RFC PATCH 0/2] Add a test to verify device probing on ACPI platforms

2023-11-22 Thread Dan Carpenter
Your talk was interesting at Linux Plumbers. https://www.youtube.com/watch?v=oE73eVSyFXQ [time +2:35] This is probably a stupid question, but why not just add something to call_driver_probe() which creates a sysfs directory tree with all the driver information? regards, dan carpenter

Re: [PATCH v1] selftests/media_tests: fix a resource leak

2023-11-21 Thread Dan Carpenter
On Tue, Nov 21, 2023 at 01:32:38AM -0800, Zhu Jun wrote: > From: zhujun2 > > The opened file should be closed in main(), otherwise resource > leak will occur that this problem was discovered by code reading > > Signed-off-by: zhujun2 > --- > > Hi Dan Carpenter

Re: [PATCH] selftests/media_tests: fix a resource leak

2023-11-20 Thread Dan Carpenter
ort running programs. It's different for an operating system or a web server which is expected to have a long uptime. But these programs are going to run quickly and then exit so resource leaks are not an issue. regards, dan carpenter

Re: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-11-15 Thread Dan Carpenter
know to look for WARN(), lockdep, and KASAN. What other bugs formats do we have? Probably someone like the syzbot devs have already has written a script like this? regards, dan carpenter

Re: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-11-01 Thread Dan Carpenter
Let me add Richard to the CC list. See lore for more details. https://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/ On Tue, Oct 31, 2023 at 09:57:48PM +0530, Naresh Kamboju wrote: > On Mon, 30 Oct 2023 at 14:33, Dan Carpenter wrote: > > &g

[RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-10-30 Thread Dan Carpenter
t; message at the end. I haven't actually tested this patch... Daniel, do you have a list of intentional stack traces we could annotate? Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tests/drm_rect_test.c | 2 ++ include/kunit/test.h | 3 +++ 2 files changed, 5 insertions(+)

[bug report] kunit: test: Fix the possible memory leak in executor_test

2023-10-05 Thread Dan Carpenter
_add_action(test, free_suite_set, (void *)free); 279 } regards, dan carpenter

Re: [PATCH] kunit: debugfs: Handle errors from alloc_string_stream()

2023-09-27 Thread Dan Carpenter
te_suite() error: 'test_case->log' > dereferencing possible ERR_PTR() > > Signed-off-by: Richard Fitzgerald > Reported-by: Dan Carpenter > Fixes: 05e2006ce493 ("kunit: Use string_stream for test log") > --- > lib/kunit/debugfs.c | 29 -

Re: [PATCH] kunit: Check for kunit_parse_glob_filter() failure

2023-09-26 Thread Dan Carpenter
On Tue, Sep 19, 2023 at 02:49:43PM -0400, Rae Moar wrote: > On Fri, Sep 15, 2023 at 8:58 AM Dan Carpenter > wrote: > > > > Smatch complains that the missing error checks would lead to a crash: > > > > lib/kunit/executor_test.c:40 parse_filter_tes

[PATCH] kunit: Check for kunit_parse_glob_filter() failure

2023-09-15 Thread Dan Carpenter
Smatch complains that the missing error checks would lead to a crash: lib/kunit/executor_test.c:40 parse_filter_test() error: double free of 'filter.test_glob' We may as well do it right... Fixes: a127b154a8f2 ("kunit: tool: allow filtering test cases via glob") Signed-o