[RESEND PATCH] accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()

2024-08-20 Thread Thorsten Blum
Use kvfree() to fix the following Coccinelle/coccicheck warning reported by kfree_mismatch.cocci: WARNING kvmalloc is used to allocate this memory at line 10398 Reviewed-by: Tomer Tayar Signed-off-by: Thorsten Blum --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +- 1 file changed, 1

[RESEND PATCH] accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()

2024-07-03 Thread Thorsten Blum
Use kvfree() to fix the following Coccinelle/coccicheck warning reported by kfree_mismatch.cocci: WARNING kvmalloc is used to allocate this memory at line 10398 Reviewed-by: Tomer Tayar Signed-off-by: Thorsten Blum --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +- 1 file changed, 1

[RESEND PATCH] drm: Combine identical if/elif code blocks

2024-07-09 Thread Thorsten Blum
l seems to be able to handle this now. Signed-off-by: Thorsten Blum --- include/uapi/drm/drm.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 16122819edfe..315af7b19c97 100644 --- a/include/uapi/drm/drm.h +++ b/includ

[PATCH] drm/i915: Explicitly cast divisor to fix Coccinelle warning

2024-07-10 Thread Thorsten Blum
: Thorsten Blum --- drivers/gpu/drm/i915/i915_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 0b1cd4c7a525..24722e758aaf 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915

Re: [PATCH] drm/i915: Explicitly cast divisor to fix Coccinelle warning

2024-07-10 Thread Thorsten Blum
On 10. Jul 2024, at 13:38, Ville Syrjälä wrote: > On Wed, Jul 10, 2024 at 09:46:51AM +0200, Thorsten Blum wrote: >> As the comment explains, the if check ensures that the divisor oa_period >> is a u32. Explicitly cast oa_period to u32 to remove the following >> Coccinel

[PATCH] drm/tegra: hub: Use fn parameter directly to fix Coccinelle warning

2024-07-10 Thread Thorsten Blum
: do_div() does a 64-by-32 division, please consider using div64_u64 instead Signed-off-by: Thorsten Blum --- drivers/gpu/drm/tegra/hub.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index f21e57e8599e..e0c2019a591b

[PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap()

2024-07-24 Thread Thorsten Blum
Use the vma_pages() helper function and remove the following Coccinelle/coccicheck warning reported by vma_pages.cocci: WARNING: Consider using vma_pages helper on vma Signed-off-by: Thorsten Blum --- drivers/gpu/drm/xe/xe_oa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH v2] drm/i915: Explicitly cast divisor and use div_u64()

2024-08-02 Thread Thorsten Blum
preferred div_u64() function instead of the do_div() macro and remove the now unnecessary local variable tmp. Signed-off-by: Thorsten Blum --- Changes in v2: - Use div_u64() instead of do_div() after feedback from Ville Syrjälä - Link to v1: https://lore.kernel.org/linux-kernel/20240710074650.419902-2

[PATCH v3] drm/i915: Explicitly cast divisor and use div_u64()

2024-08-07 Thread Thorsten Blum
preferred div_u64() function instead of the do_div() macro and remove the now unnecessary local variable tmp. Inline the if/else and invert the conditional expression. Reviewed-by: Jonathan Cavitt Signed-off-by: Thorsten Blum --- Changes in v2: - Use div_u64() instead of do_div() after feedback from

[RESEND PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap()

2024-08-19 Thread Thorsten Blum
Use the vma_pages() helper function and remove the following Coccinelle/coccicheck warning reported by vma_pages.cocci: WARNING: Consider using vma_pages helper on vma Reviewed-by: Ashutosh Dixit Signed-off-by: Thorsten Blum --- drivers/gpu/drm/xe/xe_oa.c | 3 +-- 1 file changed, 1

[PATCH] drm: Combine identical if/elif code blocks

2024-05-13 Thread Thorsten Blum
Merge the identical if/elif code blocks and remove the following two warnings reported by make includecheck: asm/ioctl.h is included more than once linux/types.h is included more than once Signed-off-by: Thorsten Blum --- include/uapi/drm/drm.h | 8 +--- 1 file changed, 1

Re: [PATCH] drm: Combine identical if/elif code blocks

2024-05-15 Thread Thorsten Blum
On 15. May 2024, at 09:43, Luc Ma wrote: > On Tue, 14 May 2024 at 19:37, Thorsten Blum wrote: >> >> Merge the identical if/elif code blocks and remove the following two >> warnings reported by make includecheck: >> >>asm/ioctl.h is included more tha

Re: [PATCH] drm: Combine identical if/elif code blocks

2024-05-15 Thread Thorsten Blum
On 15. May 2024, at 11:22, Thorsten Blum wrote: > On 15. May 2024, at 09:43, Luc Ma wrote: >> On Tue, 14 May 2024 at 19:37, Thorsten Blum wrote: >>> >>> Merge the identical if/elif code blocks and remove the following two >>> warnings reported by make includ

[PATCH] accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()

2024-04-02 Thread Thorsten Blum
Fixes the following Coccinelle/coccicheck warning reported by kfree_mismatch.cocci: WARNING kvmalloc is used to allocate this memory at line 10398 Signed-off-by: Thorsten Blum --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] treewide: Fix common grammar mistake "the the"

2024-04-11 Thread Thorsten Blum
Use `find . -type f -exec sed -i 's/\/the/g' {} +` to find all occurrences of "the the" and replace them with a single "the". Changes only comments and documentation - no code changes. Signed-off-by: Thorsten Blum --- Documentation/trace/histogram.rst

[PATCH v2] treewide: Fix common grammar mistake "the the"

2024-04-11 Thread Thorsten Blum
Use `find . -type f -exec sed -i 's/\/the/g' {} +` to find all occurrences of "the the" and replace them with a single "the". In arch/arm/include/asm/unwind.h replace "the the" with "to the". Changes only comments and documentation - no code c

Re: [PATCH] treewide: Fix common grammar mistake "the the"

2024-04-11 Thread Thorsten Blum
On 11. Apr 2024, at 17:25, Dan Carpenter wrote: > > It's tricky to know which tree a patch like this would go through. The patch is based on the mainline tree. Should I have sent it directly to Linus then? I'm relatively new here and therefore only sent it to the corresponding mailing lists. T

[PATCH] drm/amdgpu: Add missing space to DRM_WARN() message

2024-04-14 Thread Thorsten Blum
s/,please/, please/ Signed-off-by: Thorsten Blum --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 7753a2e64d41..3cba0e196ca8 100644

[RESEND PATCH] drm/managed: Simplify if condition

2024-07-01 Thread Thorsten Blum
The if condition !A || A && B can be simplified to !A || B. Fixes the following Coccinelle/coccicheck warning reported by excluded_middle.cocci: WARNING !A || A && B is equivalent to !A || B Compile-tested only. Acked-by: Thomas Zimmermann Signed-off-by: Thorsten Bl

[RESEND PATCH] accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()

2024-05-31 Thread Thorsten Blum
Use kvfree() to fix the following Coccinelle/coccicheck warning reported by kfree_mismatch.cocci: WARNING kvmalloc is used to allocate this memory at line 10398 Signed-off-by: Thorsten Blum --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] drm/xe/vm: Simplify if condition

2024-06-03 Thread Thorsten Blum
The if condition !A || A && B can be simplified to !A || B. Fixes the following Coccinelle/coccicheck warning reported by excluded_middle.cocci: WARNING !A || A && B is equivalent to !A || B Compile-tested only. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/xe/xe_

Re: [PATCH] drm: Combine identical if/elif code blocks

2024-06-03 Thread Thorsten Blum
On 16. May 2024, at 03:24, Luc Ma wrote: > On Wed, 15 May 2024 at 17:31, Thorsten Blum wrote: >> On 15. May 2024, at 11:22, Thorsten Blum wrote: >>> On 15. May 2024, at 09:43, Luc Ma wrote: >>>> On Tue, 14 May 2024 at 19:37, Thorsten Blum >>>> wrote

[RESEND PATCH] drm: Combine identical if/elif code blocks

2024-06-04 Thread Thorsten Blum
cause make headers_install seems to be able to handle this now. Signed-off-by: Thorsten Blum --- include/uapi/drm/drm.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 16122819edfe..315af7b19c97 100644 --- a/include/uapi/drm/d

[PATCH] drm/amd/display: Simplify if conditions

2024-06-04 Thread Thorsten Blum
WARNING !A || A && B is equivalent to !A || B Compile-tested only. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 6 +++--- .../gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)

[PATCH] drm/managed: Simplify if condition

2024-06-05 Thread Thorsten Blum
The if condition !A || A && B can be simplified to !A || B. Fixes the following Coccinelle/coccicheck warning reported by excluded_middle.cocci: WARNING !A || A && B is equivalent to !A || B Compile-tested only. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_man

[PATCH] drm/amd/display: Fix dml_print_mode_support() for USRRetrainingSupport

2024-06-06 Thread Thorsten Blum
The address of a struct field is usually not NULL, making this test always truthy. Test the boolean value instead. Fixes the following Coccinelle/coccicheck error reported by test_addr.cocci: ERROR: test of a variable/field address Compile-tested only. Signed-off-by: Thorsten Blum

[RESEND PATCH] drm/vmwgfx: Remove unnecessary NULL checks before kvfree()

2024-10-07 Thread Thorsten Blum
WARNING: NULL check before some freeing functions is not needed Signed-off-by: Thorsten Blum --- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c index

[PATCH] drm/vmwgfx: Remove unnecessary NULL checks before kvfree()

2024-09-23 Thread Thorsten Blum
WARNING: NULL check before some freeing functions is not needed Signed-off-by: Thorsten Blum --- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c index

[PATCH] drm/i915: Use memdup_user() instead of kmalloc() and copy_from_user()

2024-09-25 Thread Thorsten Blum
Use memdup_user() instead of kmalloc() followed by copy_from_user() to simplify set_context_image(). Fixes the following Coccinelle/coccicheck warning reported by memdup_user.cocci: WARNING opportunity for memdup_user Signed-off-by: Thorsten Blum --- drivers/gpu/drm/i915/gem

[PATCH] fbdev: Use str_enabled_disabled() helper in sm501fb_init_fb()

2025-01-12 Thread Thorsten Blum
Remove hard-coded strings by using the str_enabled_disabled() helper function. Signed-off-by: Thorsten Blum --- drivers/video/fbdev/sm501fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 86ecbb2d86db

[PATCH] drm: Use strscpy() instead of strscpy_pad()

2025-04-11 Thread Thorsten Blum
the argument is omitted. This makes the explicit size arguments unnecessary. No functional changes intended. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm

[RESEND PATCH] drm: Use strscpy() instead of strscpy_pad()

2025-04-29 Thread Thorsten Blum
the argument is omitted. This makes the explicit size arguments unnecessary. No functional changes intended. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm

[PATCH] drm/gma500: Replace deprecated strncpy() with strscpy()

2025-02-25 Thread Thorsten Blum
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy() instead and remove the manual NUL-termination. Compile-tested only. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-harden...@vger.kernel.org Signed-off-by: Thorsten Blum --- drivers/gpu/drm/gma500

[PATCH RESEND] drm: Use strscpy() instead of strscpy_pad()

2025-05-21 Thread Thorsten Blum
the argument is omitted. This makes the explicit size arguments unnecessary. No functional changes intended. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm

[PATCH RESEND] drm: Use strscpy() instead of strscpy_pad()

2025-06-19 Thread Thorsten Blum
the argument is omitted. This makes the explicit size arguments unnecessary. No functional changes intended. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm

[PATCH RESEND] drm: Use strscpy() instead of strscpy_pad()

2025-07-16 Thread Thorsten Blum
the argument is omitted. This makes the explicit size arguments unnecessary. No functional changes intended. Signed-off-by: Thorsten Blum --- drivers/gpu/drm/drm_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm