Fix trace_string() by assigning the string length to the return variable
which got lost in commit ddeea494a16f ("tracing/synthetic: Use union
instead of casts") and caused trace_string() to always return 0.
Signed-off-by: Thorsten Blum
---
kernel/trace/trace_events_synth.c | 3 +
Fixes Coccinelle/coccicheck warnings reported by do_div.cocci.
Compared to do_div(), div64_u64() does not implicitly cast the divisor and
does not unnecessarily calculate the remainder.
Signed-off-by: Thorsten Blum
---
kernel/trace/trace_benchmark.c | 5 ++---
1 file changed, 2 insertions
Explicitly cast the divisor to u32 to fix a Coccinelle/coccicheck warning
reported by do_div.cocci.
Signed-off-by: Thorsten Blum
---
kernel/trace/trace_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
On 20. Mar 2024, at 11:27, Masami Hiramatsu (Google)
wrote:
>
> Hmm, strange, trace_do_benchmark() has another do_div(u64, u64).
>
>do {
>last_seed = seed;
>seed = stddev;
>if (!last_seed)
>
On 20. Mar 2024, at 16:01, Thorsten Blum wrote:
>
> Coccinelle also finds this one, but please ignore this patch as I just
> realized
> this was already fixed in another patch of mine from February.
>
> Sorry for the inconvenience.
>
> Link:
> https://l
s already used twice in trace_do_benchmark() when
calculating the standard deviation:
do_div(stddev, (u32)bm_cnt);
do_div(stddev, (u32)bm_cnt - 1);
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Update patch with latest changes from master
- Update patch title and description
---
kernel/
s already used twice in trace_do_benchmark() when
calculating the standard deviation:
do_div(stddev, (u32)bm_cnt);
do_div(stddev, (u32)bm_cnt - 1);
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Update patch with latest changes from master
- Update patch title and description
---
kernel/
Use the vma_pages() helper function and fix the following
Coccinelle/coccicheck warning reported by vma_pages.cocci:
WARNING: Consider using vma_pages helper on vma
Rename the local variable vma_pages accordingly.
Signed-off-by: Thorsten Blum
---
kernel/trace/ring_buffer.c | 8
Use the vma_pages() helper function and fix the following
Coccinelle/coccicheck warning reported by vma_pages.cocci:
WARNING: Consider using vma_pages helper on vma
Rename the local variable vma_pages accordingly.
Signed-off-by: Thorsten Blum
---
kernel/trace/ring_buffer.c | 8
1
The header file linux/bootconfig.h is included whether __KERNEL__ is
defined or not.
Include it only once before the #ifdef/#else/#endif preprocessor
directives and remove the following make includecheck warning:
linux/bootconfig.h is included more than once
Signed-off-by: Thorsten Blum
delete the now empty #else block.
Signed-off-by: Thorsten Blum
---
Changes in v2:
- Move comment and delete #else as suggested by Masami Hiramatsu
- Link to v1:
https://lore.kernel.org/linux-kernel/20240711002152.800028-2-thorsten.b...@toblux.com/
---
lib/bootconfig.c | 20 +---
1
Replace the custom BOOL_TO_STR() macro with the str_true_false() helper
function and remove the macro.
Signed-off-by: Thorsten Blum
---
net/ieee802154/trace.h | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/ieee802154/trace.h b/net/ieee802154/trace.h
index
On 28. Oct 2024, at 23:29, Huang, Kai wrote:
> On 27/10/2024 12:32 am, Thorsten Blum wrote:
>> Use vmalloc_array() instead of vmalloc() to calculate the number of
>> bytes to allocate.
>
> This says nothing about _why_. Is it because we want to take advantage of
> the
Hi Stefan,
> On 28. Oct 2024, at 16:57, Stefan Schmidt wrote:
>
> Hello Thorsten Blum.
>
> On Sun, 20 Oct 2024 13:23:13 +0200, Thorsten Blum wrote:
>> Replace the custom BOOL_TO_STR() macro with the str_true_false() helper
>> function and remove the macro.
>&g
Use vmalloc_array() instead of vmalloc() to calculate the number of
bytes to allocate.
Reviewed-by: Jarkko Sakkinen
Signed-off-by: Thorsten Blum
---
arch/x86/kernel/cpu/sgx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86
Use vmalloc_array() instead of vmalloc() to calculate the number of
bytes to allocate.
Reviewed-by: Jarkko Sakkinen
Acked-by: Kai Huang
Signed-off-by: Thorsten Blum
---
arch/x86/kernel/cpu/sgx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/sgx
Use vmalloc_array() instead of vmalloc() to calculate the number of
bytes to allocate.
Signed-off-by: Thorsten Blum
---
arch/x86/kernel/cpu/sgx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index
Remove hard-coded strings by using the str_yes_no() helper function.
Signed-off-by: Thorsten Blum
---
drivers/char/virtio_console.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 24442485e73e
using sizeof() when the argument is
omitted. RPMSG_NAME_SIZE is equal to sizeof(rpdev->id.name) and can be
removed - remove it.
No functional changes intended.
Signed-off-by: Thorsten Blum
---
drivers/rpmsg/qcom_glink_native.c | 2 +-
drivers/rpmsg/qcom_smd.c | 2 +-
2 files changed
using sizeof() when the argument is
omitted. RPMSG_NAME_SIZE is equal to sizeof(rpdev->id.name) and can be
removed - remove it.
No functional changes intended.
Signed-off-by: Thorsten Blum
---
drivers/rpmsg/qcom_glink_native.c | 2 +-
drivers/rpmsg/qcom_smd.c | 2 +-
2 files changed
The size parameter is optional and strscpy() automatically determines
the length of the destination buffer using sizeof() if the argument is
omitted. This makes the explicit sizeof() unnecessary. Remove it to
shorten and simplify the code.
Signed-off-by: Thorsten Blum
---
kernel/module/main.c
Hi Mathieu,
On 30. Apr 2025, at 16:59, Mathieu Poirier wrote:
> On Tue, 29 Apr 2025 at 04:46, Thorsten Blum wrote:
>>
>> kzalloc() already zero-initializes the destination buffer, making
>> strscpy() sufficient for safely copying the name. The additional NUL-
>> paddi
22 matches
Mail list logo