Re: [Intel-gfx] [PATCH] drm/i915/gvt: Fix NULL pointer dereference in intel_vgpu_reg_rw_edid()

2020-09-08 Thread Markus Elfring
> In the function intel_vgpu_reg_rw_edid of gvt/kvmgt.c, pos can get equal to > NULL for GPUs that do not > properly support EDID. … * I propose to reconsider the previous patch subject once more. * Did the script “checkpatch.pl” point any adjustment possibilities out for the change descriptio

Re: [Intel-gfx] [PATCH] drm/i915/gem: Fix inconsistent IS_ERR and PTR_ERR

2020-05-04 Thread Markus Elfring
… > The proper pointer to be passed as argument is ce. > > This bug was detected with the help of Coccinelle. My software development attention was caught also by your commit message. … > +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c > @@ -1325,7 +1325,7 @@ static int __reloc_gpu_alloc(st

Re: [Intel-gfx] drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()

2017-10-24 Thread SF Markus Elfring
>> Do you prefer to delegate the proposed software refactoring >> only to a corresponding optimiser? > > yes. Will any applications around the semantic patch language (Coccinelle software) fit also in the preferred tool category? Regards, Markus ___ In

Re: [Intel-gfx] drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()

2017-10-24 Thread SF Markus Elfring
>> … It's just that two out of three error >> messages happened to be the same and Markus wants to save a bit of >> memory by using the same string. The memory savings is not so big that >> it's worth making the code less readable. > > I agree with Dan. > > It doesn't save any real memory eithe

Re: [Intel-gfx] drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()

2017-10-24 Thread SF Markus Elfring
> This isn't the case here. I find your view interesting for further clarification somehow. > Instead of making the code more readable, we're making it more convoluted. Can the shown software refactoring usually help here? > It's just that two out of three error messages happened to be the sa

[Intel-gfx] [PATCH 2/2] drm/i915/dp: Use common error handling code in intel_dp_sink_crc_stop()

2017-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 24 Oct 2017 15:40:47 +0200 Adjust jump targets so that a specific error code assignment will be in the implementation only at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm

[Intel-gfx] [PATCH 1/2] drm/i915/dp: Delete an unnecessary goto statement in intel_dp_sink_crc()

2017-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 24 Oct 2017 15:15:20 +0200 A jump was specified for a location which was directly behind. Thus remove such an unnecessary goto statement. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915

[Intel-gfx] [PATCH 0/2] GPU-DRM-i915-DP: Fine-tuning for two function implementations

2017-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 24 Oct 2017 15:54:32 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an unnecessary goto statement in intel_dp_sink_crc() Use common error handling code in intel_dp_sink_crc_stop() drivers

Re: [Intel-gfx] drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()

2017-10-24 Thread SF Markus Elfring
>> Add a jump target so that a call of the function "gvt_vgpu_err" is stored >> only once at the end of this function implementation. >> Replace two calls by goto statements. >> >> This issue was detected by using the Coccinelle software. > > I don't think this is an issue or an improvement. Do y

[Intel-gfx] [PATCH] drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()

2017-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 24 Oct 2017 14:20:06 +0200 Add a jump target so that a call of the function "gvt_vgpu_err" is stored only once at the end of this function implementation. Replace two calls by goto statements. This issue was detected by using the Coccinelle software.

Re: [Intel-gfx] [PATCH 7/9] drm/i915: Combine substrings for a message in gen6_drpc_info()

2017-05-04 Thread SF Markus Elfring
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c >> @@ -1529,8 +1529,8 @@ static int gen6_drpc_info(struct seq_file *m) >> >> forcewake_count = >> READ_ONCE(dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER].wake_count); >> if (forcewake_count) { >> -seq_puts(m, "RC information in

[Intel-gfx] [PATCH 5/9] drm/i915: Adjust seven checks for null pointers

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 13:52:19 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written … Thus fix affected source code places

[Intel-gfx] [PATCH 9/9] drm/i915: Combine substrings for two messages in i915_ggtt_probe_hw()

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 14:30:37 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix the affected source code place. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_gem

[Intel-gfx] [PATCH 8/9] drm/i915: Replace a seq_puts() call by seq_putc() in two functions

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 14:23:32 +0200 Two single characters (line breaks) should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gp

[Intel-gfx] [PATCH 4/9] drm/i915: Delete unnecessary braces in three functions

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 13:40:53 +0200 Do not use curly brackets at some source code places where a single statement should be sufficient. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_debugfs.c | 19 --- 1 file changed, 8 insertions(+), 11

[Intel-gfx] [PATCH 3/9] drm/i915: Replace 14 seq_printf() calls by seq_puts()

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 13:20:47 +0200 Some strings which did not contain data format specifications should be put into a sequence. Thus use the corresponding function "seq_puts". This issue was detected by using the Coccinelle software. Signed-off-by: Mark

[Intel-gfx] [PATCH 7/9] drm/i915: Combine substrings for a message in gen6_drpc_info()

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 14:15:00 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix the affected source code place. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_deb

[Intel-gfx] [PATCH 6/9] drm/i915: Add spaces for better code readability

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 14:04:38 +0200 Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_debugfs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions

[Intel-gfx] [PATCH 2/9] drm/i915: Combine five seq_printf() calls in i915_display_info()

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 13:17:10 +0200 Some text was put into a sequence by separate function calls. Print the same data by two single function calls instead. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_debugfs.c | 7 ++- 1 file changed, 2 insertions

[Intel-gfx] [PATCH 1/9] drm/i915: Replace ten seq_puts() calls by seq_putc()

2017-05-04 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 4 May 2017 11:04:45 +0200 Some single characters should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_debu

Re: [Intel-gfx] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put"

2015-11-06 Thread SF Markus Elfring
>> The pwm_put() function tests whether its argument is NULL and then >> returns immediately. Thus the test around the call is not needed. > > The compiler doesn't need it, but IMO it's useful documentation for humans. How do you think about to extend the explicit documentation for the affected p

[Intel-gfx] [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put"

2015-11-06 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 6 Nov 2015 13:38:22 +0100 The pwm_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers

Re: [Intel-gfx] [PATCH 00/39] drop null test before destroy functions

2015-09-14 Thread SF Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following > functions able to tolerate NULL arguments: > > kmem_cache_destroy (commit 3942d29918522) > mempool_destroy (commit 4e3ca3e033d1) > dma_pool_destroy (commit 44d7175da6ea) How do you think about to extend an other SmPL scrip